Update app.py
Browse files
app.py
CHANGED
@@ -25,9 +25,10 @@ def classify_image(img):
|
|
25 |
return {class_labels[i]: float(predictions[0][i]) for i in range(len(class_labels))}, confidence
|
26 |
|
27 |
# Example images (local paths or URLs)
|
28 |
-
|
29 |
-
|
30 |
-
|
|
|
31 |
|
32 |
# Gradio interface
|
33 |
demo = gr.Interface(
|
@@ -36,6 +37,8 @@ demo = gr.Interface(
|
|
36 |
description = "Predict the bodypart of human bodypart images. This is a demo of our human bodypart image <a href=\"https://huggingface.co/icputrd/Inception-V3-Human-Bodypart-Classifier\">classifier</a>.",
|
37 |
inputs=gr.Image(type="pil"),
|
38 |
outputs=[gr.Label(num_top_classes=len(class_labels)), gr.Number()],
|
|
|
|
|
39 |
live=True,
|
40 |
)
|
41 |
|
|
|
25 |
return {class_labels[i]: float(predictions[0][i]) for i in range(len(class_labels))}, confidence
|
26 |
|
27 |
# Example images (local paths or URLs)
|
28 |
+
example_images = [
|
29 |
+
'head.jpg', # Replace with actual local file paths or URLs
|
30 |
+
'torso.jpg'
|
31 |
+
]
|
32 |
|
33 |
# Gradio interface
|
34 |
demo = gr.Interface(
|
|
|
37 |
description = "Predict the bodypart of human bodypart images. This is a demo of our human bodypart image <a href=\"https://huggingface.co/icputrd/Inception-V3-Human-Bodypart-Classifier\">classifier</a>.",
|
38 |
inputs=gr.Image(type="pil"),
|
39 |
outputs=[gr.Label(num_top_classes=len(class_labels)), gr.Number()],
|
40 |
+
examples=example_images,
|
41 |
+
cache_examples=False,
|
42 |
live=True,
|
43 |
)
|
44 |
|