It can tell you that you are a snorkel, but it cannot tell you why. There are decisions, but no reasons. Dan Shifman is the best software teacher on UA-cam.
In case anyone wants to use MobileNet locally (offline), it is possible to download a local copy of the model json file and reference its path, see on GitHub a repository named "ml5-data-and-models-server"
I just got to the 4:41 where you were wondering if all the probabilities need to add up to 100%, and I'm not sure they always do. For example, if the model has an entry for both "Dog" and "Bloodhound", it could be 100% sure that the current image is a dog, but only 80% sure that it's a bloodhound, or something like that.
If you move outside of machine learning specifically that's the difference between bayesian probabilities, and fuzzy logic. In a bayesian system all the possible options have to add up to 100% But in fuzzy logic it's not really a percentage so much as it is a relative confidence level. So if it says 98% dog, 78% cat and 3% goldfish, well, really it shouldn't be using percentages for that, since it's misleading, but it actually tells you that it thinks it's about 1.25 times more likely to be a dog than a cat, and almost 33 times more likely to be a dog than a goldfish, but doesn't tell you in absolute terms how likely it really is that it's a dog. It tells you relative to everything it knows about how likely it thinks these particular classifications are. And that can add up to anything.
Indeed, and I've seen a fair few pictures where you might even be unclear as to whether you're looking at a cat or a dog! Myself I would quite like to have a system which could work like how you say: it could be really quite confident that an image falls into a certain broad class, but not so certain about which sub-class it falls into, and less certain as the class got more specific. So maybe it could be dead sure it's a Dog, pretty sure it's a Terrier…not sure at all which one of the many breeds of terrier but willing to make an educated guess ;-)
Good video, I want to make you some queries 1- the image that I want to classify jpg must have a special size or resolution so that MobileNet processes it in an optimal or more optimized way 2- you can introduce new classifications or jpg images or another format to MobileNet for example of bacteria since I tried with some images of bacteria and it does not classify them if possible how it can be done.
@@LittyXavier I had the same problem - couldn't get Dan's version to work. However if you use the examples on the ml5 main site - they are uptodate. But remember to use the Image-Classsifier for the p5.js WEB EDITOR :)
Great tutorial!! I made a Chatbot based on Eliza and incorporated MobileNet so the bot can see.. Fun stuff, I'm adding face recognition later this week. You can see it on github and at ioegg.com Also, maybe the reason for the different prediction confidence values for the Oystercatcher is the canvas size or image resize was different between the two tests.
Could you also explain how to retrain a preexisting model using newer images ? Also, I know you love pure javascript but maybe a couple video using tensorflow and ml5 on a framework like React or Angular would be really appreciated ! Thanks!
This tut is out of date (still love you Dan! ;) ) use the examples on the ml5 main site - they are uptodate. But remember to use the Image-Classsifier for the p5.js WEB EDITOR :)
Love your videos, been following for a while and learning tons. Thanks for putting this kind of stuff out there! Do you think the different probabilities in the puffin guess was because the puffin image aspect ratio might've been changed when you resized it to the canvas?
I don't know why, but I get "TypeError: Cannot read properties of undefined (reading 'shape')" when I classify my image. Even though it's already loaded.
I am really enjoying this ml5.js project. I'm not very good at all of this yet, so i was wondering if you would be able to point me out to a tutorial on how to load multiple models for image classification rather than one at a time. Thanks for the great tutorials
Hey I love you videos I have been a follower of your channel for quite a long time. Actually the scores for different labels don't add up 😬 They are independent Eg: Probability the image is cat :- 97% Probability the image is not a cat :-100-97%=3% Probability the image is dog:- 95% Probability the image is not a dog :-100-95%=5%
Thanks so much for the videos, these are all amazing! I was wondering if you/ someone would be able to help me alter the code for this so that it always accesses the rear camera instead of the front facing camera? Thanks again
Maybe js is the future for ML/classification cause it's closests to the internet than any other language..The database to handle with is enormous..maybe it's more a matter of copyright and privacy that's is not booming?.I was playing with google colab ,kaggle and tensorflow but the inputdata is always limited..So...Or i'm I wrong...I!m more an artist than a programmer so i don't see it that clearly..Keep up the good work ..It's great !!(and fun)
@4:33 This was the doubt I too was facing. In fact, with the limited trained data in MobileNet here, I found that the confidence scores did not add upto 1(contrary to what I felt like) for imaes like that of a valley of flowers maybe due to limited pre trained data. A total beginner here. Would like to be corrected.
I got this error "DOMException: Failed to execute 'texImage2D' on 'WebGL2RenderingContext': The image element contains cross-origin data, and may not be loaded."
@@filippo61 , I had the same issue when I just used chrome to open local html, solved it by running a local node server (I used the node-static npm package)
How do i get the Image Classification folder that you have in your project panel? i can't load images into the p5 editor. So, i don't have a puffin.jpg pre-loaded nor can i load an image. How do i get those folders? Other than that the code runs fine and i get a "Model is Ready" callback. This is my first time and so, i don't know how. Could you please help?
When I run the above code, I get the error "sketch.js:18 Error: Failed to link vertex and fragment shaders.". When I googled it and got a solution as "Same here, solved by disable gpu backend _tfengine.ENV.set('WEBGL_PACK', false) before you do anything with tensorflow. An other option would be upgrade your graphic card driver~" . But I do not know how to apply it. Anyone got this error and resolved it ?
This mobilenet is wildly inaccurate. So far it has only correctly (with 17% confidence) classified an elephant. As for squirrels and raccoons - it mistakes them for shower curtains. No joke - shower curtains! I was prepared to have my socks blown off. But this is very underwhelming. Perhaps more configuration is necessary - given that the video is 5 years old?? Anyone have similar experience?
Hi Daniel! I have been trying to get your attention unsuccessfully, you are a busy person , I know, I have a perhaps small request, and that is: Would you entertain the idea of developing a jigsaw puzzle algorithm to divide or cut a picture into the classic puzzle pieces pls.? Thanks
hy thanks very much for all your videos. I have a problem when the model try to classifie, i am using js code without p5 and the error is Uncaught (in promise) DOMException: The operation is insecure. If you can give me an idea. It doesn't work on chrome also. thank's
Hi there, I want to know, is there a way to use object or image recognition on internet or website like on Amazon or Walmart to product images recognition, etc, rather than using real-time object detection via webcam. please reply
@The Coding Train, Facing error like "CORS policy: Cross origin requests are only supported for protocol schemes: http, data, chrome, chrome-extension, https." How to resolve this? Have you run any server for this or is it just running the code??
Love these tutorials -thanks! Just a quick question: say you have a program/website where a user can upload their own photo to be classified by the MobileNet model (like on the ml5.js website) how ‘safe’ is that? Does MobileNet (or the website) store a record of the image in any way after using it, for example, are user-uploaded images encrypted etc?
This is a great question! This sketch is client-side only so the photo actually does not upload to a server, just gets evaluated by the browser on your local machine.
whenever i try to run the code i get an error in the console that says failed to execute 'texImage2D' on 'WebGL2RenderContext': The image element contains cross-origin dad , and may not be loaded. The issue is that i used the same code and i used the same picture so i dont know what is wrong
Hello sir, I love your energy I've been following your videos for a long time. I have a problem when I ran the final code that you show here I got this error "Error: Failed to link vertex and fragment shaders." could you help?
Hi! I am encountering some sort of error and cannot find any documentation to help me out. Using chrome or safari, I am getting the same result set every time a different image is loaded. This result set is : velvet, window screen and syringe, all with extremely low probabilities. I have not been able to fix this issue (I have even copy-pasted the html example from the ml5js page with no success). Please help!
Simon Robatto I'm by no means an expert at this sort of stuff, but try running it in incognito mode (private mode in Safari), from my understanding the browser will usually cache webpages and so instead of loading your updated code, it'll just reuse the same thing (this is what I've experienced at least)
Hi, thanks for the reply but unfortunately it did not work. The page behaves exactly in the same way it did before. I do not know enough about caching to figure out why but I 've tried both on safari and chrome in vain.
If you want to implement ml5.js MobileNet model with React.js, check this article: medium.com/@julienrioux/in-browser-ml-with-react-js-and-ml5-js-f3eeb5149404
I can't seem to get this to work with version 0.4.3... (with 0.1.1 yes) Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at tfhub.dev/google/imagenet/mobilenet_v2_100_224/classification/2/model.json?tfjs-format=file 2. (Reason: CORS request did not succeed). or GET tfhub.dev/google/imagenet/mobilenet_v2_100_224/classification/2/model.json?tfjs-format=file net::ERR_NAME_NOT_RESOLVED if i try to go to tfhub.dev/google/imagenet/mobilenet_v2_100_224/classification/2/model.json?tfjs-format=file i get “We’re having trouble finding that site.” does this mean the mobilenet server is down ? is anyone else having the same problem ?
I think you're getting different results 'cause if you're 100% sure it's a dog on a picture an 0% it's a cat it is indeed 100% a dog, but if you think that it has a 70% chance being an alligator and 30% being a crocodile you can say that (by just taking the average of results which is really bad statistically most of the times) it has a 50% chance of being an alligator (favorable to alligator for obviously having the highest rating between all the results)
I think this guy's energy is infectious I just wish I got this excited during class.
I am trying to upload the app on heroku but it is not working on the mobile, could you help me with that please!
I love his attitude.
I have great respect for the time and energy you put into sharing so many "chucks of knowledge" in such a wide range of domains. Thank you.
The way you talk makes everything fun to learn about, it just seems like you have so much energy.
It can tell you that you are a snorkel, but it cannot tell you why. There are decisions, but no reasons. Dan Shifman is the best software teacher on UA-cam.
More than a year ago, I found your channel and videos, I'm still learning from you. Thanks much
the sound of Dan's kitchen bell is one of the most fun things to hear in coding tutorial videos, ever.
3:25 I can't believe Dan was actually a snorkel in disguise.
Wow, you're so active lately! I wish I could put out videos that fast.
Dan! This gave me this. Why?
0: {label: "prairie chicken, prairie grouse, prairie fowl", confidence: 0.09353400021791458}
1: {label: "quail", confidence: 0.08970478922128677}
2: {label: "drake", confidence: 0.05440836399793625}
length: 3
In case anyone wants to use MobileNet locally (offline), it is possible to download a local copy of the model json file and reference its path, see on GitHub a repository named "ml5-data-and-models-server"
I love your videos and i am so glad and grateful that you are teaching ML
Dan you're so much fun! Thank you!
I just got to the 4:41 where you were wondering if all the probabilities need to add up to 100%, and I'm not sure they always do. For example, if the model has an entry for both "Dog" and "Bloodhound", it could be 100% sure that the current image is a dog, but only 80% sure that it's a bloodhound, or something like that.
If you move outside of machine learning specifically that's the difference between bayesian probabilities, and fuzzy logic.
In a bayesian system all the possible options have to add up to 100%
But in fuzzy logic it's not really a percentage so much as it is a relative confidence level.
So if it says 98% dog, 78% cat and 3% goldfish, well, really it shouldn't be using percentages for that, since it's misleading, but it actually tells you that it thinks it's about 1.25 times more likely to be a dog than a cat, and almost 33 times more likely to be a dog than a goldfish, but doesn't tell you in absolute terms how likely it really is that it's a dog.
It tells you relative to everything it knows about how likely it thinks these particular classifications are. And that can add up to anything.
Indeed, and I've seen a fair few pictures where you might even be unclear as to whether you're looking at a cat or a dog!
Myself I would quite like to have a system which could work like how you say: it could be really quite confident that an image falls into a certain broad class, but not so certain about which sub-class it falls into, and less certain as the class got more specific.
So maybe it could be dead sure it's a Dog, pretty sure it's a Terrier…not sure at all which one of the many breeds of terrier but willing to make an educated guess ;-)
Good video, I want to make you some queries 1- the image that I want to classify jpg must have a special size or resolution so that MobileNet processes it in an optimal or more optimized way 2- you can introduce new classifications or jpg images or another format to MobileNet for example of bacteria since I tried with some images of bacteria and it does not classify them if possible how it can be done.
With new versions: 1. No need for preload. 2. createIMG causes a problem, since it
takes another parameter now. loadImage works fine.
could you share your code please
@@LittyXavier I had the same problem - couldn't get Dan's version to work. However if you use the examples on the ml5 main site - they are uptodate. But remember to use the Image-Classsifier for the p5.js WEB EDITOR :)
well this was easier than I expected
Great tutorial!! I made a Chatbot based on Eliza and incorporated MobileNet so the bot can see.. Fun stuff, I'm adding face recognition later this week. You can see it on github and at ioegg.com
Also, maybe the reason for the different prediction confidence values for the Oystercatcher is the canvas size or image resize was different between the two tests.
i like this guy. i am watching just because it's entertaining. i don't even care about js.
Could you also explain how to retrain a preexisting model using newer images ? Also, I know you love pure javascript but maybe a couple video using tensorflow and ml5 on a framework like React or Angular would be really appreciated ! Thanks!
Sir your way of teaching is inspiring and fun!!!!
This tut is out of date (still love you Dan! ;) ) use the examples on the ml5 main site - they are uptodate. But remember to use the Image-Classsifier for the p5.js WEB EDITOR :)
my favorite teacher
btw i'm from the #Future
Thanks, now I understand what took so long for Agumented Reality to be wide spread.
You are amazing .your way of learning is sooo good .🙏
Thanks man for making the process so awesome!
Great video 'snorkel winkie'. Haha! Very well explained and easy to understand.Thanks!
getting this error : Uncaught TypeError: Cannot read property 'split' of undefined (: line 57)
May, 2019. In the p5js editor image is being loaded automatically, only with the image() command.
Fantastic! Would you make more machine learning video later?
You are awesome man! 😍😍😍
Can you a video on the raspberry pi :-)
Love your videos, been following for a while and learning tons. Thanks for putting this kind of stuff out there! Do you think the different probabilities in the puffin guess was because the puffin image aspect ratio might've been changed when you resized it to the canvas?
I don't know why, but I get "TypeError: Cannot read properties of undefined (reading 'shape')" when I classify my image. Even though it's already loaded.
My love for Code
That dwindled
This man
'Daniel Shiffman'
Has rekindled
We are very happy to learn with your tuto
For you who get error when try the code. Here is the code in lastest version of ml5
editor.p5js.org/ml5/sketches/ImageClassification
How does the online version know where your image file is? Do you need to upload it? Where is it loading from? img = loadImage('images/bird.jpg');
@@ebru1012 The image of the bird is on the p5js server, which is not how to upload other images to carry out tests with the online editor
thanks appreciate it
Every image I try with that code says: Label: window screen
Confidence: 0.18
I am really enjoying this ml5.js project. I'm not very good at all of this yet, so i was wondering if you would be able to point me out to a tutorial on how to load multiple models for image classification rather than one at a time. Thanks for the great tutorials
21:06 Maybe because you resized the image so it fits the canvas.
The p5.dom.js is now included in the p5.js / p5.min.js
inspiration for chrome extension that detect what is on the screen :P
Hey I love you videos I have been a follower of your channel for quite a long time.
Actually the scores for different labels don't add up 😬
They are independent
Eg:
Probability the image is cat :- 97%
Probability the image is not a cat :-100-97%=3%
Probability the image is dog:- 95%
Probability the image is not a dog :-100-95%=5%
Super simple! Thanks
Its all cool and stuff.. but I wanna learn how it got trained... how do I learn that?
Thanks so much for the videos, these are all amazing! I was wondering if you/ someone would be able to help me alter the code for this so that it always accesses the rear camera instead of the front facing camera? Thanks again
Maybe js is the future for ML/classification cause it's closests to the internet than any other language..The database to handle with is enormous..maybe it's more a matter of copyright and privacy that's is not booming?.I was playing with google colab ,kaggle and tensorflow but the inputdata is always limited..So...Or i'm I wrong...I!m more an artist than a programmer so i don't see it that clearly..Keep up the good work ..It's great !!(and fun)
My cat looks nothing like a sweatshirt. It really doesn't. But Dan, he does kinda resemble a snorkel.
@4:33 This was the doubt I too was facing. In fact, with the limited trained data in MobileNet here, I found that the confidence scores did not add upto 1(contrary to what I felt like) for imaes like that of a valley of flowers maybe due to limited pre trained data. A total beginner here. Would like to be corrected.
This guy is the professor in "La casa de papel" :)
This is amazing... so cool!
1 year anniversary! For this anniversary, I'm going to actually learn this xD
I got this error "DOMException: Failed to execute 'texImage2D' on 'WebGL2RenderingContext': The image element contains cross-origin data, and may not be loaded."
What code editor are you using? Are you running a local server? Or is it an online editor?
@@TheCodingTrain local server (my PC) with Visual Studio Code
@@filippo61 , I had the same issue when I just used chrome to open local html, solved it by running a local node server (I used the node-static npm package)
@@TheCodingTrain so wont it work with the p5 web editor?
let label = results[0].label;
let conf = results[0].confidence;
Why I can't run them on my web browser when I code them on sublime text?
Wow! Just Wow!
Anyone trying to use this now? I can't even seem to load an image of the puffin onto my web browser with identical code (I'm using Mozilla Firefox)
slight change in ml5 - This code gets puffin below canvas and you should be able to go forward from there. editor.p5js.org/jasonvee/sketches/i4QEXPyMu
here is another one with puffin on canvas if you get stuck with the last one - editor.p5js.org/jasonvee/sketches/PPuvA87r9
How do i get the Image Classification folder that you have in your project panel? i can't load images into the p5 editor. So, i don't have a puffin.jpg pre-loaded nor can i load an image. How do i get those folders? Other than that the code runs fine and i get a "Model is Ready" callback. This is my first time and so, i don't know how. Could you please help?
Awesome video. thank you.
thx i love you
When I run the above code, I get the error "sketch.js:18 Error: Failed to link vertex and fragment shaders.". When I googled it and got a solution as "Same here, solved by disable gpu backend _tfengine.ENV.set('WEBGL_PACK', false) before you do anything with tensorflow. An other option would be upgrade your graphic card driver~" . But I do not know how to apply it. Anyone got this error and resolved it ?
Hi and thank you for the video, I have image dataset and and I already done the annotation for it, how can I use it to classify it to two classes?
This mobilenet is wildly inaccurate. So far it has only correctly (with 17% confidence) classified an elephant. As for squirrels and raccoons - it mistakes them for shower curtains. No joke - shower curtains! I was prepared to have my socks blown off. But this is very underwhelming. Perhaps more configuration is necessary - given that the video is 5 years old?? Anyone have similar experience?
my workspace doesnt recognize the ml5 library.
followed all your videos and couldnt find the solution. what can it be?
Can we draw a rectangle around the puffin and get the x, y
Hi Daniel!
I have been trying to get your attention unsuccessfully, you are a busy person , I know, I have a perhaps small request, and that is: Would you entertain the idea of developing a jigsaw puzzle algorithm to divide or cut a picture into the classic puzzle pieces pls.?
Thanks
Please suggest here! github.com/CodingTrain/Rainbow-Topics/issues
wow, Thats good idea
my console says:
Use of the orientation sensor is deprecated. p5.js:48187:6
Use of the motion sensor is deprecated. p5.js:48187:6
me too. But it can show image be other browser
hy thanks very much for all your videos. I have a problem when the model try to classifie, i am using js code without p5 and the error is Uncaught (in promise) DOMException: The operation is insecure. If you can give me an idea. It doesn't work on chrome also. thank's
Im using a node server but the images are not even updating
i got d3d error while loading ml5 model on windows but then i tried that on ubuntu and it ran fine. Don't know how.
Beautiful drake.
Did the probabilty change because of the resize of the pic?
watching you, i like "really ? we dont need split train and test,".
I’m learning this in 2021 and mobilenet says that the puffin is actually drake😂
Can ml5 running as server maybe mix with node js ?
when you are using the new firefox developer browser you wont need a server to run p5 or any other js library :)
oh i just realised chrome can also display p5 without a server. havent tested other libraries yet
Hi Love your video. They are very helpful. Which editor do you use? Atom and sublime does not suit me
Hi there,
I want to know, is there a way to use object or image recognition on internet or website like on Amazon or Walmart to product images recognition, etc, rather than using real-time object detection via webcam. please reply
Can you do a simple named entity recognition?
thank you
It isn't working on brackets.
when i run the example of github, github.com/Edmonton-School-of-AI/ml5-Simple-Image-Classification, it doesn't work also.
How do i intergate P5.js within a React js project?
@The Coding Train, Facing error like "CORS policy: Cross origin requests are only supported for protocol schemes: http, data, chrome, chrome-extension, https."
How to resolve this? Have you run any server for this or is it just running the code??
Love these tutorials -thanks! Just a quick question: say you have a program/website where a user can upload their own photo to be classified by the MobileNet model (like on the ml5.js website) how ‘safe’ is that? Does MobileNet (or the website) store a record of the image in any way after using it, for example, are user-uploaded images encrypted etc?
This is a great question! This sketch is client-side only so the photo actually does not upload to a server, just gets evaluated by the browser on your local machine.
whenever i try to run the code i get an error in the console that says failed to execute 'texImage2D' on 'WebGL2RenderContext': The image element contains cross-origin dad , and may not be loaded.
The issue is that i used the same code and i used the same picture so i dont know what is wrong
Are you running a local server?
@@TheCodingTrainNo, I use the the web editor
I think you are running into this issue!
github.com/ml5js/ml5-library/issues/217
github.com/ml5js/ml5-examples/issues/6
@@TheCodingTrain Thank you!
@@TheCodingTrain also i tried to set up a server and it was blank and it didnt show what i was coding. could you please help me?
Hello sir, I love your energy I've been following your videos for a long time.
I have a problem when I ran the final code that you show here I got this error
"Error: Failed to link vertex and fragment shaders."
could you help?
Hi! I am encountering some sort of error and cannot find any documentation to help me out. Using chrome or safari, I am getting the same result set every time a different image is loaded. This result set is : velvet, window screen and syringe, all with extremely low probabilities.
I have not been able to fix this issue (I have even copy-pasted the html example from the ml5js page with no success). Please help!
Simon Robatto I'm by no means an expert at this sort of stuff, but try running it in incognito mode (private mode in Safari), from my understanding the browser will usually cache webpages and so instead of loading your updated code, it'll just reuse the same thing (this is what I've experienced at least)
Hi, thanks for the reply but unfortunately it did not work. The page behaves exactly in the same way it did before. I do not know enough about caching to figure out why but I 've tried both on safari and chrome in vain.
That is rather sad and I hope they fix it soon! Thanks for the update!
If you want to implement ml5.js MobileNet model with React.js, check this article:
medium.com/@julienrioux/in-browser-ml-with-react-js-and-ml5-js-f3eeb5149404
How does i to run the program ?
Woo-hooooooo!!
So he is a snorkel!!! Finally the secret is revealed!
hotdog, not hotdog
exactly same thought XD
But he didn't imported the data set
Hi Great tutorial, is it possible to use the training with ml5 library or use the custom trained model in it?
This is a feature coming in the future!
I can't seem to get this to work with version 0.4.3... (with 0.1.1 yes)
Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at tfhub.dev/google/imagenet/mobilenet_v2_100_224/classification/2/model.json?tfjs-format=file 2. (Reason: CORS request did not succeed).
or
GET tfhub.dev/google/imagenet/mobilenet_v2_100_224/classification/2/model.json?tfjs-format=file net::ERR_NAME_NOT_RESOLVED
if i try to go to
tfhub.dev/google/imagenet/mobilenet_v2_100_224/classification/2/model.json?tfjs-format=file
i get “We’re having trouble finding that site.”
does this mean the mobilenet server is down ?
is anyone else having the same problem ?
Hi Jeff! Can you file this at github.com/ml5js/ml5-library/issues?
how to run the code in server mode..???
bcz while I'm opening with index.html in browser its not opening with classification work??>
This workflow video series might help! ua-cam.com/play/PLRqwX-V7Uu6Zu_uqEA6NqhLzKLACwU74X.html
It thinks my kitty is a sweatshirt.
The notification creeeew
I think you're getting different results 'cause if you're 100% sure it's a dog on a picture an 0% it's a cat it is indeed 100% a dog, but if you think that it has a 70% chance being an alligator and 30% being a crocodile you can say that (by just taking the average of results which is really bad statistically most of the times) it has a 50% chance of being an alligator (favorable to alligator for obviously having the highest rating between all the results)
Thank you so much!!
This is the first video i watched and it's so cool. i'm newbie so can you tell me how do you build this in 127.0.0.1 server??
This workflow video series will help! ua-cam.com/play/PLRqwX-V7Uu6Zu_uqEA6NqhLzKLACwU74X.html (look for the node video)