ml5js/ml5-library

[devops] Refactor ml5 library & support ml5 in node.js

Open

#672 opened on Oct 31, 2019

View on GitHub
 (7 comments) (12 reactions) (0 assignees)JavaScript (6,136 stars) (905 forks)batch import
devopsfeature requesthelp wanted

Description

Dear ml5 community,

I'm submitting a new issue. Please see the details below.

→ Step 1: Describe the issue 📝

Did you find a bug? Want to suggest an idea for feature?

This is a stretch goal, but I'd like to suggest doing the following:

  1. Refactor the ml5 library to more module based system:

    • Refactor ml5-library to sub-modules like what we see here in tfjs-models or turfjs . This will allow people to get the entire ml5 library or just get the features of interest.
  2. Support ml5 in a nodejs environment:

    • In the refactoring and restructuring of the library, I think we could gain a lot from supporting ml5 in the node.js environment. @oveddan has shown some really amazing examples -- e.g. https://github.com/oveddan/ml-text -- of how easy tensorflow-node has made it to use tfjs in the node environment so it would be really wonderful if we could bring the same ml5 friendliness to this environment as well. This will take some more planning and a better understanding of how all these pieces can fit together, but I think this would complete the "package" of ml5 in a really nice way.

This is ambitious, but I think it would be great to try to chip away at this over the next months with a goal of having something up and running by June/July.

Any suggestions for structure, devops best practices, etc would be awesome! Thanks!

Possible ways forward

  1. change everything to require tfjs-core rather than tfjs
  2. separate out the dependencies to the browser window e.g. fetch and p5 functions
  3. centralize the fetch functions to handle the model fetching etc
  4. allow ml5 at the very least to be imported to a nodejs environment, and then fix broken models incrementally.

Contributor guide