randomshit11 commited on
Commit
fdb8b07
·
verified ·
1 Parent(s): ddd82a5

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -2
app.py CHANGED
@@ -2,6 +2,8 @@ import torch
2
  from torchvision import transforms
3
  from PIL import Image
4
  from torchvision import models
 
 
5
  import gradio as gr
6
 
7
  # Define the ResNet50 model
@@ -45,7 +47,7 @@ def predict_image_label(image):
45
  return label
46
 
47
  # Create Gradio interface
48
- image = gr.inputs.Image(shape=(224, 224))
49
- label = gr.outputs.Label(num_top_classes=2)
50
 
51
  gr.Interface(fn=predict_image_label, inputs=image, outputs=label, title="Leaf or Plant Classifier").launch()
 
2
  from torchvision import transforms
3
  from PIL import Image
4
  from torchvision import models
5
+ import gradio.inputs as gi
6
+ import gradio.outputs as go
7
  import gradio as gr
8
 
9
  # Define the ResNet50 model
 
47
  return label
48
 
49
  # Create Gradio interface
50
+ image = gi.Image(shape=(224, 224))
51
+ label = go.Label(num_top_classes=2)
52
 
53
  gr.Interface(fn=predict_image_label, inputs=image, outputs=label, title="Leaf or Plant Classifier").launch()