Shima111 commited on
Commit
bf43f16
·
1 Parent(s): cd8b4b6

with app that test hot dogs

Browse files
Files changed (1) hide show
  1. app.py +18 -0
app.py ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from transformers import pipline
2
+ import gradio as gr
3
+
4
+ import gradio as gr
5
+ from transformers import pipeline
6
+
7
+ pipeline = pipeline(task="image-classification", model="julien-c/hotdog-not-hotdog")
8
+
9
+ def predict(image):
10
+ predictions = pipeline(image)
11
+ return {p["label"]: p["score"] for p in predictions}
12
+
13
+ gr.Interface(
14
+ predict,
15
+ inputs=gr.inputs.Image(label="Upload hot dog candidate", type="filepath"),
16
+ outputs=gr.outputs.Label(num_top_classes=2),
17
+ title="Hot Dog? Or Not?",
18
+ ).launch()