Armen Jeddi commited on
Commit
2ecef0d
·
verified ·
1 Parent(s): cb94d18

create initial app with auth

Browse files
Files changed (1) hide show
  1. app.py +18 -0
app.py ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import gradio as gr
2
+
3
+ pipeline = pipeline(task="image-classification", model="julien-c/hotdog-not-hotdog")
4
+
5
+ def predict(img):
6
+ predictions = pipeline(img)
7
+ return img, {p["label"]: p["score"] for p in predictions}
8
+
9
+ interface = gr.Interface(
10
+ predict,
11
+ inputs=gr.Image(label="Select hot dog candidate", sources=['upload', 'webcam'], type="pil"),
12
+ outputs=[gr.Image(label="Processed Image"), gr.Label(label="Result", num_top_classes=2)],
13
+ title="Hot Dog? Or Not?",
14
+ )
15
+
16
+ if __name__ == '__main__':
17
+ interface.launch(auth=("admin", "admin"), title="Please enter your credentials")
18
+