qmjnh commited on
Commit
1f36cab
·
1 Parent(s): 3ad951c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -4
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/FlowerClassification/resolve/main/'
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,Label
 
56
  UI=gr.Interface(fn=image_to_output,
57
- inputs=Image(shape=(224,224)),
58
- outputs=Label(num_top_classes=5),
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()