Spaces:
Runtime error
Runtime error
Commit
·
205ae77
1
Parent(s):
96eca85
Create app.py
Browse files
app.py
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import gradio as gr
|
| 2 |
+
from transformers import pipeline
|
| 3 |
+
|
| 4 |
+
pipe = pipeline(task="image-classification", model="SuperSecureHuman/Flower-CNN")
|
| 5 |
+
|
| 6 |
+
class_names = ['daisy', 'dandelion', 'roses', 'sunflowers', 'tulips']
|
| 7 |
+
|
| 8 |
+
image = gr.inputs.Image(shape=(300,300))
|
| 9 |
+
|
| 10 |
+
label = gr.outputs.Label(num_top_classes=5)
|
| 11 |
+
|
| 12 |
+
gr.Interface.from_pipeline(pipe,
|
| 13 |
+
title="Flower Classification",
|
| 14 |
+
description="Flower CNN",
|
| 15 |
+
inputs = image,
|
| 16 |
+
outputs = label,
|
| 17 |
+
live=True,
|
| 18 |
+
allow_flagging="never").launch()
|