Spaces:
Running
Running
Nima Boscarino
commited on
Commit
·
272f2cd
1
Parent(s):
c87420d
Update app.py
Browse files
app.py
CHANGED
@@ -1,11 +1,11 @@
|
|
1 |
import gradio as gr
|
2 |
from transformers import pipeline
|
3 |
|
4 |
-
# Initialize hotdog-not-hotdog pipeline
|
5 |
pipeline = pipeline(task="image-classification", model="julien-c/hotdog-not-hotdog")
|
6 |
|
7 |
def predict(image):
|
8 |
-
|
|
|
9 |
|
10 |
gr.Interface(
|
11 |
predict,
|
|
|
1 |
import gradio as gr
|
2 |
from transformers import pipeline
|
3 |
|
|
|
4 |
pipeline = pipeline(task="image-classification", model="julien-c/hotdog-not-hotdog")
|
5 |
|
6 |
def predict(image):
|
7 |
+
predictions = pipeline(image)
|
8 |
+
return {p["label"]: p["score"] for p in predictions}
|
9 |
|
10 |
gr.Interface(
|
11 |
predict,
|