Mishmosh commited on
Commit
cb33233
1 Parent(s): 42ef9e9

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -1
app.py CHANGED
@@ -6,8 +6,11 @@ image_classifier = pipeline("image-classification")
6
 
7
  # Define a function for image classification using Gradio
8
  def classify_image(image):
 
9
  result = image_classifier(image)
10
- return result[0]['label'] # Return the label of the top prediction
 
 
11
 
12
  # Create a Gradio interface
13
  iface = gr.Interface(fn=classify_image, inputs="image", outputs="label")
 
6
 
7
  # Define a function for image classification using Gradio
8
  def classify_image(image):
9
+ print(f"Received image: {image}")
10
  result = image_classifier(image)
11
+ print(f"Classification result: {result}")
12
+ return result[0]['label']
13
+
14
 
15
  # Create a Gradio interface
16
  iface = gr.Interface(fn=classify_image, inputs="image", outputs="label")