Closed corefox01 closed 3 years ago
Tried p5 image, a ImageData objects in both cases get
pixels passed to tf.browser.fromPixels() can not be null
at t.fromPixels (
As per document p5 Image is supposed to work. "input - Optional. An HTML image or video element or a p5 image or video element. If not input is provided, the video element provided in the method-type will be used."
Call works fine if canvas object is passed.
The only way to make this work is by adding the image to an HTML image element and then passing that image to the classifier. This is an error with the tensorflow backend and not of ml5.js Hope this helps
Thank you @Browny8161 for following up here! @corefox01, alternatively, something like Teachable Machine might be a useful tool for your goals.
Closing this issue for now, but please let me know if you have any questions!
I'm trying to make a custom image classifier on my own image dataset with transfer learning and featureExtractor, however its not working. I tried a lot of things as well based on @shiffman 's comment at ml5js/ml5-examples#142 I tried the following code with a lot of iterations:
However I'm getting the the error message of ml5js/ml5-examples#241 ml5js/ml5-examples#246 and #345 . the 'addImage' gives an error every time: tf-core.esm.js:17 Uncaught (in promise) Error: pixels passed to tf.browser.fromPixels() can not be null
Also in that case if I trying to use another method like 'knn.addExample(myImg, label)' Im getting the error: No input image.
I also tried the method in ml5js/ml5-library#861 but its really inaccurate.
If I'm using the 'createCapture(video)' as it shows in the video tutorial and in the examples, everyting is is working like a charm with the webcam, but if I'm trying to use still images from a folder its not.
Could you recommend a method which is working or at least give me a hint, what can be the problem? Thanks a lot!