This package includes an example of using the ml5js machine learning library. It will detect human or person through the webcam.
The ml5js is a machine learning library for the web. It is built on top of the TensorFlow.js library. In this package, you can find the code example to detect human or person through the webcam.
The model using in this demo generated by Google's teachable machine tool. You can check out the online demo of this project and can play with this simple but amazing tool.
You can download it and check out the code. You can create your own model from Google's teachable machine image object tool. Just by making some changes in the code, you can use it to detect any other types of a particular object.
Below is the simple JavaScript code snippet of the package that is responsible to detect the human -
if (label=="person") { // Do something }
In our case, we are playing a sound with different text in this package. You can do anything you want, you can add your own sound and own text.
To teach this model, we have used almost 1000 images of human and many of them was my own photo, some of them taken by searching on Google image search. Also, there are almost 1000 other images where there was no person, some of the images with cat or dog or other types of animal to prevent my model from detecting other types of animals as human beings.
I hope you will love this little effort of mine.
Submitted by Faruque Ahamed Mollick (frkmollick)
Download packets of source code on Coders Packet
Comments