Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -1,5 +1,6 @@
|
|
1 |
import gradio as gr
|
2 |
from transformers import pipeline
|
|
|
3 |
|
4 |
pipe = pipeline(
|
5 |
model="alfiannajih/trash-classification",
|
@@ -7,6 +8,8 @@ pipe = pipeline(
|
|
7 |
)
|
8 |
|
9 |
def predict(image):
|
|
|
|
|
10 |
pred = pipe(image)
|
11 |
|
12 |
return pred
|
|
|
1 |
import gradio as gr
|
2 |
from transformers import pipeline
|
3 |
+
from PIL import Image
|
4 |
|
5 |
pipe = pipeline(
|
6 |
model="alfiannajih/trash-classification",
|
|
|
8 |
)
|
9 |
|
10 |
def predict(image):
|
11 |
+
image = Image.fromarray(image)
|
12 |
+
|
13 |
pred = pipe(image)
|
14 |
|
15 |
return pred
|