Spaces:
Sleeping
Sleeping
Update app.py to use proper pipeline
Browse files
app.py
CHANGED
|
@@ -1,6 +1,8 @@
|
|
| 1 |
import gradio as gr
|
| 2 |
from transformers import pipeline
|
| 3 |
|
|
|
|
|
|
|
| 4 |
def predict(input_img):
|
| 5 |
predictions = pipeline(input_img)
|
| 6 |
return input_img, {p["label"]: p["score"] for p in predictions}
|
|
|
|
| 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(input_img):
|
| 7 |
predictions = pipeline(input_img)
|
| 8 |
return input_img, {p["label"]: p["score"] for p in predictions}
|