Update app.py
Browse files
app.py
CHANGED
|
@@ -31,11 +31,19 @@ def predict(image):
|
|
| 31 |
except Exception as e:
|
| 32 |
return str(e) # Fehlernachricht zurückgeben
|
| 33 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 34 |
# Gradio-Interface erstellen
|
| 35 |
iface = gr.Interface(
|
| 36 |
fn=predict,
|
| 37 |
inputs=gr.Image(type="pil"), # Bild als PIL-Objekt
|
| 38 |
outputs=gr.Label(),
|
|
|
|
| 39 |
description="Pokémon Classifier"
|
| 40 |
)
|
| 41 |
|
|
|
|
| 31 |
except Exception as e:
|
| 32 |
return str(e) # Fehlernachricht zurückgeben
|
| 33 |
|
| 34 |
+
# Pfade zu den Beispielbildern
|
| 35 |
+
examples = [
|
| 36 |
+
["examples/abra.png"],
|
| 37 |
+
["examples/cloyster.png"],
|
| 38 |
+
["examples/dodrio.png"]
|
| 39 |
+
]
|
| 40 |
+
|
| 41 |
# Gradio-Interface erstellen
|
| 42 |
iface = gr.Interface(
|
| 43 |
fn=predict,
|
| 44 |
inputs=gr.Image(type="pil"), # Bild als PIL-Objekt
|
| 45 |
outputs=gr.Label(),
|
| 46 |
+
examples=examples, # Beispielbilder hinzufügen
|
| 47 |
description="Pokémon Classifier"
|
| 48 |
)
|
| 49 |
|