Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -20,17 +20,18 @@ def predict(img):
|
|
20 |
# Title and description
|
21 |
title = "Female/Male Classifier"
|
22 |
description = "A Female/Male classifier trained on the duckduckgo search result with fastai. Created as a demo for Gradio and HuggingFace Spaces."
|
|
|
23 |
examples = ['femaleDefault.jpg', 'maleDefault.jpg', 'dragQueen1.jpg', 'dragQueen2.jpg', 'femaleAngry1.jpg', 'femaleAngry2.jpg', 'femaleMuscle1.jpg', 'femaleMuscle2.jpg', 'maleAsian.jpg', 'maleEurope.jpg', 'femaleAsian.jpg', 'femaleDefault.jpg', 'maleCrying2.jpg', 'maleCrying2No.jpg']
|
24 |
|
25 |
# Update the Gradio Interface
|
26 |
inter = gr.Interface(
|
27 |
fn=predict,
|
28 |
-
inputs=gr.Image(type="pil"),
|
29 |
outputs=gr.Label(),
|
30 |
title=title,
|
31 |
description=description,
|
32 |
-
examples=examples,
|
33 |
-
cache_examples=
|
34 |
examples_per_page=2
|
35 |
)
|
36 |
|
|
|
20 |
# Title and description
|
21 |
title = "Female/Male Classifier"
|
22 |
description = "A Female/Male classifier trained on the duckduckgo search result with fastai. Created as a demo for Gradio and HuggingFace Spaces."
|
23 |
+
# Ensure the correct path is given to your example images
|
24 |
examples = ['femaleDefault.jpg', 'maleDefault.jpg', 'dragQueen1.jpg', 'dragQueen2.jpg', 'femaleAngry1.jpg', 'femaleAngry2.jpg', 'femaleMuscle1.jpg', 'femaleMuscle2.jpg', 'maleAsian.jpg', 'maleEurope.jpg', 'femaleAsian.jpg', 'femaleDefault.jpg', 'maleCrying2.jpg', 'maleCrying2No.jpg']
|
25 |
|
26 |
# Update the Gradio Interface
|
27 |
inter = gr.Interface(
|
28 |
fn=predict,
|
29 |
+
inputs=gr.Image(type="pil"),
|
30 |
outputs=gr.Label(),
|
31 |
title=title,
|
32 |
description=description,
|
33 |
+
examples=examples, # Make sure the images are correctly referenced
|
34 |
+
cache_examples=False, # Disable example caching
|
35 |
examples_per_page=2
|
36 |
)
|
37 |
|