googlecreativelab / teachablemachine-community

Example code snippets and machine learning code for Teachable Machine
https://g.co/teachablemachine
Apache License 2.0
1.5k stars 667 forks source link

How does i predict an image instead of a webcam? #209

Open markusgri opened 3 years ago

markusgri commented 3 years ago

Hello, i found the code for tensorflow.js very helpful: https://github.com/googlecreativelab/teachablemachine-community/blob/master/snippets/markdown/image/tensorflowjs/javascript.md

But i couldn't figure out how i can predict an image instead of a webcam image. Is it possible to provide an example for using static images?

Best regards Markus

Gerard-Szulc commented 3 years ago

I know this code is a mess, but it can handle webcam and user uploaded images using filereader API.

https://github.com/Gerard-Szulc/isTodd/blob/main/src/components/ToddChecker.vue