Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -1,5 +1,6 @@
|
|
1 |
import gradio as gr
|
2 |
from transformers import pipeline
|
|
|
3 |
|
4 |
model_pipeline = pipeline(task="image-classification", model="bortle/moon-detector-v5.a")
|
5 |
|
@@ -19,7 +20,7 @@ def predict(image):
|
|
19 |
# Define the Gradio Interface
|
20 |
gr.Interface(
|
21 |
fn=predict,
|
22 |
-
inputs=gr.Image(
|
23 |
outputs=gr.Label(num_top_classes=5),
|
24 |
title="Moon Detector",
|
25 |
allow_flagging="manual",
|
|
|
1 |
import gradio as gr
|
2 |
from transformers import pipeline
|
3 |
+
from PIL import Image
|
4 |
|
5 |
model_pipeline = pipeline(task="image-classification", model="bortle/moon-detector-v5.a")
|
6 |
|
|
|
20 |
# Define the Gradio Interface
|
21 |
gr.Interface(
|
22 |
fn=predict,
|
23 |
+
inputs=gr.Image(type="pil", label="Upload image"),
|
24 |
outputs=gr.Label(num_top_classes=5),
|
25 |
title="Moon Detector",
|
26 |
allow_flagging="manual",
|