Siri23 commited on
Commit
5c4fd9a
·
verified ·
1 Parent(s): 96229d9

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -1,6 +1,5 @@
1
  from transformers import ViTImageProcessor, ViTForImageClassification
2
  from PIL import Image
3
- import requests
4
  import gradio as gr
5
 
6
  # Load the model and processor
@@ -21,11 +20,12 @@ def classify_image(image):
21
 
22
  iface = gr.Interface(
23
  fn=classify_image,
24
- inputs=gr.inputs.Image(type="numpy", label="Upload an Image"),
25
- outputs=gr.outputs.Textbox(label="Predicted Class"),
26
  title="Image Classification with ViT",
27
  description="Upload an image to classify it using the Vision Transformer (ViT) model."
28
  )
29
 
30
  if __name__ == "__main__":
31
  iface.launch()
 
 
1
  from transformers import ViTImageProcessor, ViTForImageClassification
2
  from PIL import Image
 
3
  import gradio as gr
4
 
5
  # Load the model and processor
 
20
 
21
  iface = gr.Interface(
22
  fn=classify_image,
23
+ inputs=gr.Image(type="numpy", label="Upload an Image"),
24
+ outputs=gr.Textbox(label="Predicted Class"),
25
  title="Image Classification with ViT",
26
  description="Upload an image to classify it using the Vision Transformer (ViT) model."
27
  )
28
 
29
  if __name__ == "__main__":
30
  iface.launch()
31
+