ZIDDI TRICK
Unlimited toman Vpn - Create selfie automatic using python code
Unimited toman vpn. Zong free internet how to get? .
Hello brothers!
In this post i will tell you about two tech. One is how to use python to take automatic photos many time and how to get zong free.
If you are a selfie lover, and you take hundreds of selfies every single day, then this fun project is just for you, you will be able to take hundreds of selfies without using external tools or even touching your phone. And that's the crazy part of this project. So let's get started.
To start with this project, you will definitely need Python installed in your computer. And we will be using a Python code editor called pi charm. Once the PI gem is ready, all we need to do is to punch this new project button and give some fancy name for our project. Here I will tell it like a selfie, start something like this and press enter.
While the PI charm is getting ready, we will go back to our favorite Google uncle and ask the Google uncle. Hey, Google uncle, give us some open scipy country Python and Google uncle will generously take us to this website where we have this big install, all we need to do is to just poke this tiny button and this text would be copied and then we will come back to the PI charm. And if the PI charm is ready, all we need to do is to press Ctrl A and then backspace.
And this way we will have a clean slate for our project. So I close this dude as well and then click on this terminal, and then press Ctrl V to paste the pip install Open CV country Python and press enter. So Python will install Open CV for your project. And always whenever you install something new, you need to import that dirt. So we installed open CV, that's why we need to import that dude. And in our case, it will be CV two. And in the first step, our goal is to open our webcam and then we can see ourselves and then gradually we will take selfies without even touching anything and that will be the fun part.
So first part, I imported the CV and now I need to capture the camera fee. And for that purpose, you will call CB two and then video capture. And in your case, most of you will use zero, that means your first video capturing device would be your webcam of your laptop. But if this zero doesn't work, in that case, you will use one. In my case I did little bit tweaking. So that's why I have to put one. But in the next step, all you need to do is to video is kind of like a continuous feed, right. That's why you will need to run a loop. And we will be using the while loop and this will be running forever. That's why our loop condition is true. And inside there we will capturing the frame of the video. And that's why we declare a variable something like this. And on the right side, we'll be reading the video capture. Once you have that, you just need to show the frame that's it. And you will call once again say we do and I am sure it's not like extreme yourself rather image show. And here you will give a name of your pop up.
And this could be your like a camera star something like this, and you want to display the frame. The next thing you need to write to see whether you want to close the pop up window or the video feed just by pressing the keyboard key q. So you'd be typing CV two, and then you'd be waiting for like 10 milliseconds. And after that on the right side, you will just type O r d and inside this you will pass skill. That is whenever somebody presses the Q key, your video would be shut down. And the last thing is to just to break the loop. That's it, you just wrote seven lines, just seven lines of Python, and you'd be able to open your webcam. So let's see whether this works or not. So I'm a little bit nervous. Let's see whether it works or not. So I'm pressing on this button. And let's see, you see this webcam is opening up. So this is a good sign for us that we are able to at least open the webcam this second part we need to lay out our plan that how we will be taking the selfie without even touching anything. And to solve this problem. All we need to do is to put a smile in our face. So our objective is to detect a smile on your face. And if you are smiling, then we'll be taking the selfie and that will be saved in your computer. So to detect the smile on your face, you will definitely need to detect the face and then detect the face Mind for this purpose, he will need a trigger scan files. And don't worry, I will put a link in the description so that you can go to our GitHub, give us a star over there, and then get all these files. And once you copy all these files, all you need to do is to open the folder where you have this project. So I will just right click on it, and then here you will see open in Explorer. And once this is opened in Explorer, in that case, we will be able to copy all this cascade file, so you will have just three four files. And the first thing we will be using this frontal face our cascade XML file, and for that purpose, we will import something here. So we will give it a name like a face cascade. And once you have this, you will call like CB two, and then you will call this cascade classifier and give the name of the file.
If you look into the name of the file, you will see we have heart cascade frontal face default, so we'll just type it here, it would be like a heart cascade, and then frontal face and then default. And after that XML. So once you have this gasket file, the next part is very, very simple. You need to detect it. And to detect it usually we will have like this colorful image right. But to detect a face or anything that great image is much more easier. So we will convert our actual frame to a gray frame. And to do so you will just call like a CB two and then you will convert color and the first one would be the source and the source will be the frame. And the second one will be whatever the color you want. So in our case, it would be CV two color, and then bzr to gray. And once you have done this, you can actually show that gray, so I will change it to gray, and then stop this dude. And if I run it Now you will see a black and white version of me. So this is just a 1930 version of me.
But you got the idea that you can convert a colorful life to a black and white life. Just for the purpose of detecting face. Once you have the grayscale image, it's super, super easy for you to detect the face, all you need to do is to declare a variable called face. And since you have the face cascade and unique to detect multi scale, here, you'll be passing the image that would be your grayscale image.
And after that, you can declare the scale factor. So for example, it could be 1.3. If you want, you can do some trial and error. And if you want to give some minimum neighborhood or how bigger it has to be to detect the face, you can just put a number like five after that if you want to display a border or a rectangle around the face, if you detect a face, that's super easy, all you need to do is to run a for loop so and for this purpose, you will have four variable which is like x, the SEC, topmost position x and y and x y and then you will get the width and the height. So that will be your width and that will be height in face. And after that you will call the CV to to draw some rectangle. And this rectangle would be on top of the frame because you want to display the frame. And after that you need to define the first frame, that would be your top and the left point. So which would be your x and y. And the second point would be in the corner and that corner is x plus width. So this would be like your x plus week. And then y plus height. So this would be y plus height. After that you need to declare the color and the color will be 02 55 and then 255. And finally Optionally, you can provide the thickness of the border. So if this code so for what and finally you need to change this the grade to like a friend so that you see the colorful image of yourself. So I'm closing this dude. And if this works, it should be able to detect my face. So I'm clicking on this dude, and let's see whether it works or not. So I'm clicking on this guy, and it opened you see my face is detected. And even if I have like some other image if you have like some other bodies image, you can put it there and this should detect the face. So we got our second step done, we are able to detect a face in our screen. Our next part is even more interesting because we will be able to detect a smile on the face in the next part of this post. So to do so we'll definitely need a casket file. But the good part is that you already copied this casket file. This is the hard cascade smile. So to import it All you need to do is to click on.
Download Tomman VPN here.
Also download zong files from here, up to 7 Nov.
After downloading enable these both option as mentioned below.
This was the all post. I hope you have enjoyed.
Sharing is caring.
No comments:
Post a Comment
if you have any doubts, please let me know