-
Notifications
You must be signed in to change notification settings - Fork 450
Canvas and loadImage() examples #7
Comments
(This may need to wait for us to sort out ml5js/ml5-library#27 and how to send a |
All example use |
This one is using https://github.com/ml5js/ml5-examples/blob/master/p5js/ImageClassification/sketch.js Should we make a second version with canvas, |
I thought this meant loading all images with js instead of putting them directly in the DOM. What we had before was What the advantage of using |
Ah, ok, this probably is best to discuss during one of our work sessions but some quick thoughts on my reasoning:
All this said there are a lot of contexts when using an |
And of course we require a callback for the classification results, hah! |
ok, this makes sense. I do agree that we should leave DOM manipulation out if possible. |
Agreed! (removing from ml5 soft launch, we can tackle for June 15th target.) |
https://editor.p5js.org/ml5/sketches/EB4LMfd1h @NHibiki is working on let classifier;
let img;
function preload() {
img = loadImage('bird.jpg');
classifier = ml5.imageClassifier('MobileNet');
}
function setup() {
createCanvas(400, 400);
image(img, 0, 0);
classifier.predict(canvas, gotResult);
}
function gotResult(err, results) {
console.log(results);
} |
Noting work on this is in progress in #103! This issue can probably be closed and new individual ones can be opened for specific example issues? |
Closing this up now as this seems to be resolved. Thanks for all the feedback here! |
Most of our image classification, style transfer examples are using
<img>
elements. Would be nice to showloadImage()
and drawing image data to a canvas as well.The text was updated successfully, but these errors were encountered: