NimaBoscarino commited on
Commit
d836bbd
·
1 Parent(s): 8fcffbe

Add Hot Dog classifier w/ Gradio

Browse files
Files changed (1) hide show
  1. app.py +15 -0
app.py ADDED
@@ -0,0 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import gradio as gr
2
+ from transformers import pipeline
3
+
4
+ # Initialize hotdog-not-hotdog pipeline
5
+ pipeline = transformers.pipeline(task="image-classification", model="julien-c/hotdog-not-hotdog")
6
+
7
+ def predict(image):
8
+ return pipeline(image)
9
+
10
+ gr.Interface(
11
+ predict,
12
+ inputs=gradio.inputs.Image(label="Upload hot dog candidate"),
13
+ outputs="image",
14
+ title="Hot Dog? Or Not?",
15
+ ).launch()