yuragoithf commited on
Commit
49ddf98
·
1 Parent(s): e5ecda2

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -5
app.py CHANGED
@@ -61,14 +61,13 @@ def classify_image(image):
61
  predicted_label = labels.get(index)
62
  score = results[index]
63
  output[predicted_label] = score
64
- print(output)
65
  return output
66
 
67
 
68
 
69
- inputs = gr.inputs.Image(label="Upload an image")
70
  # outputs = gr.outputs.HTML()
71
- outputs = gr.outputs.Label(num_top_classes=10)
72
 
73
  title = "<h1 style='text-align: center;'>Image Classifier</h1>"
74
  description = "Upload an image and get the predicted class."
@@ -78,6 +77,7 @@ gr.Interface(fn=classify_image,
78
  inputs=inputs,
79
  outputs=outputs,
80
  title=title,
81
- examples=["00_plane.jpg", "01_car.jpg", "02_bird.jpg", "03_cat.jpg", "04_deer.jpg"],
82
  # css=css_code,
83
- description=description).launch()
 
 
61
  predicted_label = labels.get(index)
62
  score = results[index]
63
  output[predicted_label] = score
 
64
  return output
65
 
66
 
67
 
68
+ inputs = gr.inputs.Image(type="pil", label="Upload an image")
69
  # outputs = gr.outputs.HTML()
70
+ outputs = gr.outputs.Label(num_top_classes=5)
71
 
72
  title = "<h1 style='text-align: center;'>Image Classifier</h1>"
73
  description = "Upload an image and get the predicted class."
 
77
  inputs=inputs,
78
  outputs=outputs,
79
  title=title,
80
+ examples=[["00_plane.jpg"], ["01_car.jpg"], ["02_bird.jpg"], ["03_cat.jpg"], ["04_deer.jpg"]],
81
  # css=css_code,
82
+ description=description,
83
+ enable_queue=True).launch()