Spaces:
Sleeping
Sleeping
Update app.py
Browse files
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 |
-
|
|
|
|
|
|
|
| 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")
|