Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
|
@@ -27,7 +27,7 @@ def image_to_output (input_img):
|
|
| 27 |
import os
|
| 28 |
import requests
|
| 29 |
pretrained_repo = 'pretrained_model'
|
| 30 |
-
model_repo_link = 'https://huggingface.co/qmjnh/
|
| 31 |
for item in [
|
| 32 |
'variables.data-00000-of-00001',
|
| 33 |
'variables.index',
|
|
@@ -52,10 +52,11 @@ with open('flower_names.txt') as f:
|
|
| 52 |
labels = f.readlines()
|
| 53 |
|
| 54 |
# Run gradio
|
| 55 |
-
from gradio.components import Image
|
|
|
|
| 56 |
UI=gr.Interface(fn=image_to_output,
|
| 57 |
-
inputs=
|
| 58 |
-
outputs=
|
| 59 |
interpretation="default"
|
| 60 |
)
|
| 61 |
UI.launch()
|
|
|
|
| 27 |
import os
|
| 28 |
import requests
|
| 29 |
pretrained_repo = 'pretrained_model'
|
| 30 |
+
model_repo_link = 'https://huggingface.co/qmjnh/FLowerCLassification-model/resolve/main/'
|
| 31 |
for item in [
|
| 32 |
'variables.data-00000-of-00001',
|
| 33 |
'variables.index',
|
|
|
|
| 52 |
labels = f.readlines()
|
| 53 |
|
| 54 |
# Run gradio
|
| 55 |
+
from gradio.components import Image as gradio_image
|
| 56 |
+
from gradio.components import Label as gradio_label
|
| 57 |
UI=gr.Interface(fn=image_to_output,
|
| 58 |
+
inputs=gradio_image(shape=(224,224)),
|
| 59 |
+
outputs=gradio_label(num_top_classes=5),
|
| 60 |
interpretation="default"
|
| 61 |
)
|
| 62 |
UI.launch()
|