Spaces:
Runtime error
Runtime error
sahal-mulki
commited on
Commit
•
a47f7fe
1
Parent(s):
4668af9
Update app.py
Browse files
app.py
CHANGED
@@ -1,15 +1,16 @@
|
|
1 |
import gradio as gr
|
2 |
-
import
|
3 |
-
|
4 |
-
|
5 |
-
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
|
|
|
1 |
import gradio as gr
|
2 |
+
from transformers import pipeline
|
3 |
+
|
4 |
+
classifier = pipeline("image-classification", model="sahal-mulki/spotting-diffusion")
|
5 |
+
|
6 |
+
def predict(image):
|
7 |
+
predictions = pipeline(image)
|
8 |
+
return {p["label"]: p["score"] for p in predictions}
|
9 |
+
|
10 |
+
|
11 |
+
gr.Interface(fn=classify_image,
|
12 |
+
inputs=gr.inputs.Image(shape=(256, 256)),
|
13 |
+
outputs=gr.outputs.Label(num_top_classes=2),
|
14 |
+
# examples=["banana.jpg", "car.jpg"],
|
15 |
+
theme="default",
|
16 |
+
css=".footer{display:none !important}").launch()
|