google-coral / project-teachable

Example Project: Teachable Machine
https://coral.withgoogle.com/projects/teachable-machine/
Apache License 2.0
26 stars 15 forks source link

teachable.py --keyboard problem #10

Closed PederSmart closed 4 years ago

PederSmart commented 4 years ago

Hi,

I just want to test the teachable.py with the keyboard on my Raspberry PI 4 And the only documentation I find is in step 5

https://coral.withgoogle.com/projects/teachable-machine/

You can instead use the Teachable Machine program with your computer keyboard by passing the --keyboard flag when you run teachable.py.

I have also looked in the README.md file, but not able find how you use --keyoard option.

I get no reaction when I tried to use the keyboard

mtyka commented 4 years ago

Here's the keyboard option: https://github.com/google-coral/project-teachable/blob/master/teachable.py#L268

If you pass this flag, you should be able to use the keys 0,1,2,3 to signify each class and 'q' to clear/reset. See here: https://github.com/google-coral/project-teachable/blob/141f6c332d42a7ed0fcd6491cfe420a31d49098d/teachable.py#L107

Be sure the window focus is on the console window, not the window showing the camera image.