Brajananda Mahata commited on
Commit
a72cdf0
1 Parent(s): 165b97d
Files changed (2) hide show
  1. app.py +16 -0
  2. requirements.txt +2 -0
app.py ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import gradio as gr
2
+ from transformers import pipeline
3
+
4
+
5
+ model = pipeline(task="image-classification", model="julien-c/hotdog-not-hotdog")
6
+
7
+ def predict(image):
8
+ predictions = model(image)
9
+ return {p["label"]: p["score"] for p in predictions}
10
+
11
+ gr.Interface(
12
+ predict,
13
+ inputs=gr.image(label="Upload Image", type="filepath"),
14
+ outputs=gr.Label(num_top_classes=2),
15
+ title="Hotdog or not Hotdog? first try"
16
+ ).launch()
requirements.txt ADDED
@@ -0,0 +1,2 @@
 
 
 
1
+ transformers
2
+ torch