Spaces:
Sleeping
Sleeping
สร้าง app.py
Browse files
app.py
CHANGED
|
@@ -1,11 +1,11 @@
|
|
| 1 |
import gradio as gr
|
| 2 |
from transformers import pipeline
|
| 3 |
|
| 4 |
-
pipeline = pipeline(task="image-classification"
|
| 5 |
|
| 6 |
def predict(input_img):
|
| 7 |
predictions = pipeline(input_img)
|
| 8 |
-
return input_img, {p["label"]: p["score"] for p in predictions}
|
| 9 |
|
| 10 |
gradio_app = 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(input_img):
|
| 7 |
predictions = pipeline(input_img)
|
| 8 |
+
return input_img, {p["label"]: p["score"] for p in predictions}
|
| 9 |
|
| 10 |
gradio_app = gr.Interface(
|
| 11 |
predict,
|