rwcuffney commited on
Commit
dec78b0
1 Parent(s): 4e5b7b0

Create app.py

Browse files
Files changed (1) hide show
  1. app.py +16 -0
app.py ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import gradio as gr
2
+ from transformers import pipeline
3
+
4
+ pipeline = pipeline(task="image-classification", model="dazzle-nu/autotrain-weather-classification-3739699409")
5
+
6
+ def predict(image):
7
+ predictions = pipeline(image)
8
+ return {p["label"]: p["score"] for p in predictions}
9
+
10
+ gr.Interface(
11
+ predict,
12
+ inputs=gr.inputs.Image(label="Upload image of a weather to analyze", type="filepath"),
13
+ outputs=gr.outputs.Label(num_top_classes=5),
14
+ title="Weather Image Identification",
15
+ share=True,
16
+ ).launch()