Comments (5)
Seems like it's all TensorFlow? Screenshot of the webpack-bundle-analyzer
. It does seem like we have both the webgl and cpu backends in the bundle. We may want to include only 1 backend, so that it works out of the box, and tell the user to include an additional <script>
tag to register any other backends.
Edit: now I'm looking at the bundle and we're including source maps. We don't want those in a production build because they are huge.
We also have a comment block with the Google License that appears over 1,000 times even in the .min.js
file. Seems excessive.
from ml5-next-gen.
So it looks like #111 may have increased the filesize, @ziyuan-linn will take a look.
from ml5-next-gen.
@lindapaiste Thank you for looking into this. I set extractComments
to true and it reduced the file size from 4.18 Mib to 3.43 Mib!
Though I am pretty sure the source map is built to a different file named ml5.min.js.map
. I tried changing devtool
to false
and the bundle size did not change.
from ml5-next-gen.
This is probably a longer term discussion, but just thinking through some ideas for the future:
- What if we don't include tensorflow.js at all in the bundle? What would be required for ml5.js end users, is it as simple as just including the tf.js script tag as well? Maybe this has no real benefit since the overall size of the webpage wouldn't change.
- The
cpu
back-end is needed for the neuroevolution examples, but is otherwise rarely used. We could consider a build process that creates separate versionsml5.min.js
,ml5.webgl.min.js
,ml5.cpu.min.js
? Or even build ml5.js in a modular way so that beginners can use the entire library, but if someone is building a project that uses only, say, facemesh, they could loadml5-facemesh.min.js
?
This discussion may become a higher priority if/when we consider bundling other backends for supporting new models, like transformers.js
.
3.48Mb feels "ok" to me for now so maybe we revisit this after 1.0?
from ml5-next-gen.
I agree with the idea of organizing the library in a modular way! During a workshop I recently offered at Tongji University in Shanghai, China, I found it challenging to demonstrate examples with multiple iterations because the library's large file size had to be downloaded via a VPN connection.
We can emphasize it on the website and consider adding a friendly error message like: "To use facemesh, please import ml5-facemesh.min.js
. Visit the website for detailed information."
from ml5-next-gen.
Related Issues (20)
- Another alpha release? HOT 6
- Testing new p5 mirror function HOT 5
- `faceMesh` lips missing `keypoint` 291 HOT 3
- Discussion: `NeuralNetwork`
- README references and examples page? HOT 1
- setBackend() required for ml5.neuralNetwork() bug HOT 4
- make api compatible with code using legacy library HOT 1
- why pose keypoints x and y positions will misalign the video stream whenever the video size is not (640, 480) HOT 1
- `confidence` vs `score` across all models HOT 2
- Minor errors in documentation.md HOT 1
- Incorporating "flipped" property HOT 2
- Memory leak in PoseNet's video processing pattern HOT 5
- Making `tfjs` runtime the default HOT 2
- faceMesh custom shape
- add smoothing to BlazePose under `tfjs` HOT 2
- Question about `maskType` HOT 6
- Google search for reference leads to a non existing page HOT 2
- Question about Neural Network normalization HOT 2
- Error installing dependencies HOT 7
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ml5-next-gen.