New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add simple non-P5 example to Getting Started page #66
Conversation
…single HTML document that can b
great, thanks! What do you think? I can help write it! |
Sounds good. I can give it a first pass attempt, and then you can check my work, especially since I'm not 100% clear on the technical specifics and terminology around ImageNet. |
awesome! |
I added the following in 222de99:
|
This is awesome, thank you @dariusk! Should we consider hosting ml5 in a CDN and pointing to that? This way function onImageReady() {
// Get the image element from the page
let img = document.getElementById('image');
// Get a prediction for that image
imagenet.predict(img, 10, gotResult);
} |
So would the idea be to provide a small image to begin with, or to make |
I was thinking having |
I would be okay with that only if |
Maybe an aside, but this demo does not work offline because the KNN Classifier doesn't work offline. It relies on calls to to a Google API, which is fine, but maybe worth mentioning in the docs as it's not immediately evident from the design of the ML5 API (the function isn't |
Add simple non-P5 example to Getting Started page
I replaced
TODO
in the docs with an actual image classification example. I wrote this based on the Simple Image Classification example, but I removed all dependencies except for ml5 itself and am using completely browser/lib agnostic DOM calls.A user should be able to simply copy/paste this HTML file and open it in a browser and it will work, provided they're pointing it to ml5.js. It loads a public domain cat image cross-origin from Imgur. I'm open to pointing it to a different resource, this just seemed like the simplest way to make that happen.
Here is the application running:
Here is what it looks like in the rendered docs: