ppicazo commited on
Commit
5e54914
·
1 Parent(s): 4a0c4cc

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +15 -1
app.py CHANGED
@@ -1,3 +1,17 @@
 
1
  import gradio as gr
 
2
 
3
- gr.Interface.load("models/ppicazo/moon-detector-v5").launch()
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ gr.Interface.load("").launch()
2
  import gradio as gr
3
+ from transformers import pipeline
4
 
5
+ pipeline = pipeline(task="image-classification", model="models/ppicazo/moon-detector-v5")
6
+
7
+ def predict(image):
8
+ predictions = pipeline(image)
9
+ return {p["label"]: p["score"] for p in predictions}
10
+
11
+ gr.Interface(
12
+ predict,
13
+ inputs=gr.Image(shape=(1080, None), type="pil", label="Upload image"),
14
+ outputs=gr.Label(num_top_classes=5),
15
+ title="Moon Detector",
16
+ allow_flagging="manual",
17
+ ).launch()