DHEIVER commited on
Commit
a135d91
·
1 Parent(s): 758c978

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -10,13 +10,13 @@ classifier = VisionClassifierInference(
10
  )
11
 
12
  # Define a Gradio interface
13
- def classify_image(img):
14
- label = classifier.predict(img_path=img)
15
  return f"Predicted class: {label}"
16
 
17
  iface = gr.Interface(
18
  fn=classify_image,
19
- inputs=gr.inputs.Image(type="file", label="Upload an image"),
20
  outputs="text",
21
  title="Image Classifier",
22
  description="Classify images using a pre-trained ViT model",
 
10
  )
11
 
12
  # Define a Gradio interface
13
+ def classify_image(image_file):
14
+ label = classifier.predict(img_path=image_file.name)
15
  return f"Predicted class: {label}"
16
 
17
  iface = gr.Interface(
18
  fn=classify_image,
19
+ inputs=gr.inputs.Image(type="filepath", label="Upload an image"),
20
  outputs="text",
21
  title="Image Classifier",
22
  description="Classify images using a pre-trained ViT model",