Update app.py
Browse files
app.py
CHANGED
|
@@ -10,9 +10,9 @@ WORDS_DATABASE = {
|
|
| 10 |
"dog": {"fr": "chien", "audio": "audio/dog.mp3"},
|
| 11 |
}
|
| 12 |
|
| 13 |
-
# Simule un modèle de reconnaissance d'image
|
| 14 |
def recognize_object(image):
|
| 15 |
-
# Simule une reconnaissance aléatoire pour
|
| 16 |
recognized_object = random.choice(list(WORDS_DATABASE.keys()))
|
| 17 |
return recognized_object
|
| 18 |
|
|
@@ -43,17 +43,5 @@ def create_interface():
|
|
| 43 |
|
| 44 |
# Zone de dessin et résultats
|
| 45 |
with gr.Row():
|
| 46 |
-
canvas = gr.
|
| 47 |
-
response_text
|
| 48 |
-
audio_output = gr.Audio(label="Prononciation", interactive=False)
|
| 49 |
-
|
| 50 |
-
# Bouton pour soumettre
|
| 51 |
-
submit_button = gr.Button("Reconnaître et apprendre")
|
| 52 |
-
submit_button.click(handle_drawing, inputs=[canvas], outputs=[response_text, audio_output])
|
| 53 |
-
|
| 54 |
-
return demo
|
| 55 |
-
|
| 56 |
-
# Lancement du Space
|
| 57 |
-
if __name__ == "__main__":
|
| 58 |
-
demo = create_interface()
|
| 59 |
-
demo.launch()
|
|
|
|
| 10 |
"dog": {"fr": "chien", "audio": "audio/dog.mp3"},
|
| 11 |
}
|
| 12 |
|
| 13 |
+
# Simule un modèle de reconnaissance d'image
|
| 14 |
def recognize_object(image):
|
| 15 |
+
# Simule une reconnaissance aléatoire pour la démo
|
| 16 |
recognized_object = random.choice(list(WORDS_DATABASE.keys()))
|
| 17 |
return recognized_object
|
| 18 |
|
|
|
|
| 43 |
|
| 44 |
# Zone de dessin et résultats
|
| 45 |
with gr.Row():
|
| 46 |
+
canvas = gr.Sketchpad(label="Dessine ici !", shape=(256, 256)) # Zone de dessin
|
| 47 |
+
response_text
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|