We need to create an AI. How? Thanks to ml5.js which is a JavaScript library. This library is a beginner-friendly one which aims at teaching everyone the very basics of Artifical Intelligence. MobilNets are a class of convolutional neural network which are trained to recognize images. Then, we are going to use a specifical tool named imageClassifier and MobilNets (the tool that will help to recognize the pictures).
You need to create a glitch file with HTML, Javascript and CSS.
Then, you need to include the library into the code in the HTML file by writing :
Then, you have to create a js.file to include the code for ml5. First, you need to create a variable that will hold the image and create an ImageClassifer. These functions will enable you to hold the image.
Now, you need to create a function that will give the result with the highest probability.
If you prefer the user to drop directly his own image, then you need to use another function
That is what you will have to write on the js.file:
You will also have to write this in the index.html: