So that is what you see over here. Using basically the draw connectors. This is a util that has been provided by media pipe, and we are using that. So very quickly, what we're doing is that we are rendering all the different landmarks. And we are finally returning our webcam, and also the canvas that is going to be put on top of the webcam.
Then finally, we are exporting this React component in our R.js. So very quickly, jumping into the demonstration. So I'll open up incognito mode, and I'll go very quickly to Localhost 3000, where it will open up the webcam. As you can see, Hi, everyone. That's the second me, and very soon I should be able to see the face mesh actually land up on top of the demo. As you can see, that's the face mesh, boom. Great. And as you can see that, as I move around, I open my mouth, I close my eye, you can see that how all the facial landmarks are, you know, happening. So I can close this, and very quickly change to, let's say, one another demonstration. Let's see if we can use this thing, the selfie segmentation. And in this, what I'll do is I'll basically comment out my face mesh, and I'll just comment this out, and I'll comment out this selfie segmentation, and I'll save it. And till then, like it's loading, you can see the selfie segmentation over here again. We have used it. And what we're doing over here is that we are going to be providing a custom background, right? So that background that we're going to be providing is going to be defined over here, when basically we are using the canvas.fill style. So it will basically not colorize your human body, but it will colorize all the other things. So that is like we're using the fill style to basically, let's say, add a virtual background.
So if I go again, if I quickly go back to my incognito mode, I can go and look at localhost 3000, and very soon, I should be able to, if it, I hope everything works fine. So as you can see, this is my camera and my frame is coming in. And very soon it should load the selfie segmentation model and let's just wait for it. So as you can see, like a blue background. So essentially again, how it's working is that it is taking in your body and it is segmenting out your human from the frame. And it's basically coloring the rest of the entire background with this blue color, because it is able to segment out your human body, you know, and just color the rest of the things. So similarly, you can try out various kinds of solutions that are, you know, there. Of course, for my demonstration, I showed you the face mesh and also I showed you the selfie segmentation, but you can also try out all the other ones that are shared inside of the NPM modules that are, you know, provided by the React code. So that essentially is what I wanted to particularly show with respect to the demonstration.
Comments