Coder Social home page Coder Social logo

Comments (13)

traumverloren avatar traumverloren commented on June 15, 2024 4

I found this issue when I was trying to figure out how to use my teachable machine model in Node.js. I thought I would comment in case others end up here wondering how to use their model in Node.js with Tensorflow.js. I created a starting template that might be helpful to others. (FYI it is not using the teachable machine library, only its exported trained model.)

https://github.com/traumverloren/teachable-machine-image-nodejs-starter

from teachablemachine-community.

irealva avatar irealva commented on June 15, 2024 3

Hi @tr7zw and @steamp0rt thanks for filing the issue. We are working on the savedmodel export it should be fixed soon.

And you're right we have not implemented nodeJs support. It's good to know that you would like to use it in this environment and we'll keep it in mind for future planning.

from teachablemachine-community.

tr7zw avatar tr7zw commented on June 15, 2024 1

After some playing around I was able to get it running in NodeJs with teachablemachine/image by doing some workarounds with jsdom and canvas, still a "native" version would be nice.

from teachablemachine-community.

irealva avatar irealva commented on June 15, 2024 1

Just a note that the exporting to Tensorflow SavedModel is fixed in latest release.

from teachablemachine-community.

tr7zw avatar tr7zw commented on June 15, 2024

I tried that too, but it looks like "@teachablemachine/image" isn't made for NodeJs at all. It tries to use Canvases and the dom to work with the images. Hopefully, a Node compatible version gets released soon.

from teachablemachine-community.

 avatar commented on June 15, 2024

how does someone make something as useful as this... without thinking "hey someone might want to use this out-of-browser"

from teachablemachine-community.

tr7zw avatar tr7zw commented on June 15, 2024

Well, I'm stuck trying to get it running inside Java. The Savemodel export is broken, and the Keras model is incompatible with deeplearning4j's Keras import. Also a bit confusing that all examples are with a webcam, not showing how to get it running in NodeJS/Java/Browser/whatever to classify normal images via upload/post/filesystem.

from teachablemachine-community.

hapticdata avatar hapticdata commented on June 15, 2024

Hi,
Just to add clarification. The model you create with Teachable Machine will work with node.js + Tensorflow.js; however our library does not support node.js.
We absolutely did consider use outside the browser which is why we implemented converters for our models to tensorflow and tflite and have even released a video showing a tflite model working offline on a small coral board.

Having the library work as attempted above would not be possible because it would require including node's 'fs' module in the browser and other aspects such as converting an image to a tensor would be different than in browser.

We will add language to the readme to be more explicit these modules are meant for web users.
thanks

from teachablemachine-community.

 avatar commented on June 15, 2024

Thanks for clarifying!

from teachablemachine-community.

luke-foxed avatar luke-foxed commented on June 15, 2024

After some playing around I was able to get it running in NodeJs with teachablemachine/image by doing some workarounds with jsdom and canvas, still a "native" version would be nice.

Could you possibly share how you achieved that? I've been trying to do the same with canvas but have had no luck.

from teachablemachine-community.

tr7zw avatar tr7zw commented on June 15, 2024

After some playing around I was able to get it running in NodeJs with teachablemachine/image by doing some workarounds with jsdom and canvas, still a "native" version would be nice.

Could you possibly share how you achieved that? I've been trying to do the same with canvas but have had no luck.

Sure. I quickly threw together a git containing everything needed here.
Just keep in mind that I'm not a Javascript/node/web developer, this setup is enough to be able to expose multiple models as REST API for other projects(languages) to use, but probably has some horrible flaws if you want to have it facing the web^^.

from teachablemachine-community.

luke-foxed avatar luke-foxed commented on June 15, 2024

Thanks! I got something working too after a lot of trial and error, it's along the same idea as yours. Thanks for sharing!

from teachablemachine-community.

irealva avatar irealva commented on June 15, 2024

Added your repo to this section, thanks for that!

https://github.com/googlecreativelab/teachablemachine-community/tree/master/libraries

from teachablemachine-community.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.