Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -80,13 +80,23 @@ def classify_image(image):
|
|
| 80 |
print(f"[ERROR] Exception during classification: {e}")
|
| 81 |
return "Error in classification. Check console for details."
|
| 82 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 83 |
# β
**Gradio Interface**
|
| 84 |
interface = gr.Interface(
|
| 85 |
fn=classify_image,
|
| 86 |
inputs=gr.Image(type="numpy"),
|
| 87 |
outputs="text",
|
| 88 |
title="Clothing1M Image Classifier",
|
| 89 |
-
description="Upload a clothing image, and the model will classify it into one of the 14 categories."
|
|
|
|
| 90 |
)
|
| 91 |
|
| 92 |
# β
**Run the Interface**
|
|
|
|
| 80 |
print(f"[ERROR] Exception during classification: {e}")
|
| 81 |
return "Error in classification. Check console for details."
|
| 82 |
|
| 83 |
+
# β
**Sample Images (Can be URLs or Local Paths)**
|
| 84 |
+
sample_images = [
|
| 85 |
+
"img1.jpg", # Replace with actual URLs or local paths
|
| 86 |
+
"img2.jpg",
|
| 87 |
+
"img3.jpg",
|
| 88 |
+
"img4.jpg",
|
| 89 |
+
"img5.jpg"
|
| 90 |
+
]
|
| 91 |
+
|
| 92 |
# β
**Gradio Interface**
|
| 93 |
interface = gr.Interface(
|
| 94 |
fn=classify_image,
|
| 95 |
inputs=gr.Image(type="numpy"),
|
| 96 |
outputs="text",
|
| 97 |
title="Clothing1M Image Classifier",
|
| 98 |
+
description="Upload a clothing image, or select a sample below, and the model will classify it into one of the 14 categories.",
|
| 99 |
+
examples=sample_images # β
Predefined images for users to try
|
| 100 |
)
|
| 101 |
|
| 102 |
# β
**Run the Interface**
|