Afrikaans
Akan
Albanian
Amharic
Arabic
Armenian
Azerbaijani
Basque
Belarusian
Bemba
Bengali
Bihari
Bosnian
Breton
Bulgarian
Cambodian
Catalan
Cebuano
Cherokee
Chichewa
Chinese (Simplified)
Chinese (Traditional)
Corsican
Croatian
Czech
Danish
Dutch
English
Esperanto
Estonian
Ewe
Faroese
Filipino
Finnish
French
Frisian
Ga
Galician
Georgian
German
Greek
Guarani
Gujarati
Haitian Creole
Hausa
Hawaiian
Hebrew
Hindi
Hmong
Hungarian
Icelandic
Igbo
Indonesian
Interlingua
Irish
Italian
Japanese
Javanese
Kannada
Kazakh
Kinyarwanda
Kirundi
Kongo
Korean
Krio (Sierra Leone)
Kurdish
Kurdish (Soranรฎ)
Kyrgyz
Laothian
Latin
Latvian
Lingala
Lithuanian
Lozi
Luganda
Luo
Luxembourgish
Macedonian
Malagasy
Malay
Malayalam
Maltese
Maori
Marathi
Mauritian Creole
Moldavian
Mongolian
Myanmar (Burmese)
Montenegrin
Nepali
Nigerian Pidgin
Northern Sotho
Norwegian
Norwegian (Nynorsk)
Occitan
Oriya
Oromo
Pashto
Persian
Polish
Portuguese (Brazil)
Portuguese (Portugal)
Punjabi
Quechua
Romanian
Romansh
Runyakitara
Russian
Samoan
Scots Gaelic
Serbian
Serbo-Croatian
Sesotho
Setswana
Seychellois Creole
Shona
Sindhi
Sinhalese
Slovak
Slovenian
Somali
Spanish
Spanish (Latin American)
Sundanese
Swahili
Swedish
Tajik
Tamil
Tatar
Telugu
Thai
Tigrinya
Tonga
Tshiluba
Tumbuka
Turkish
Turkmen
Twi
Uighur
Ukrainian
Urdu
Uzbek
Welsh
Wolof
Xhosa
Yiddish
Yoruba
Zulu
In this video, I will explain the program called Use for the Squad counter.
First open the squad contact by using a text editor.
In this example, we are using Visual Studio Code.
First, some libraries and functions must be imported.
The library use is described below.
Up first.
It's used to press arguments to the Python code via the command line.
Finally, it's used to obtain the time, which is then used to calculate the detection time.
So if it is used to open images, display images draw bounding boxes on images and so on.
False is used because the model used is based on python's numpy is used to manipulate arrays.
Next is the function.
This function is imported from the utils and models from each of these seven repository.
Attempt blood is used to load all of these seven models.
Box is used to add pending to the image so that it becomes squared according to the image size.
Non max Suppressing CPT is used to perform non maximal suppression on the results of object detection
in order to reduce overlapping of the detection results.
Care costs capped is used to rescale bonding boxes.
Colors is used to give a color to the detection results.
Lot.
One box kept is used to draw bounding boxes, key points, class names and confidence scores.
Select devices used to choose a device based on the device argument.
After an explanation of import libraries and functions didn't go to the main function.
The arguments that can be used are first defined in the main function.
There are 14 arguments here.
First there is the weight argument.
This argument specifies the of these seven weights file to be used.
YOLO v7w6 Postscript is the default value.
The source argument comes next.
This argument is used to accept the source to be detected.
Only video and webcam are supported in this source code.
The default value is zero, which indicates webcam then the image size argument.
This argument is for inference size.
The default value is 640.
Next is the contract argument.
This argument is an object confidence threshold.
The detection results that will be displayed are those with a score greater than this threshold.
0.25 is the default value.
Makes the A02s argument.
This argument is the threshold for non suppression.
Next is the device argument.
This argument is cute.
A device.
If you want to use CPU, you replace zero with CPU.
The view image argument comes next.
This is an argument for displaying the detection results.
Next.
No safe argument.
This argument is used if you don't want to save the detection results.
Then there are the project and name arguments.
This argument specifies the location of the detection results folder.
Next is the line thickness argument.
This argument is used to set the thickness of the bonding box.
The default value is three.
Next is the height labels argument.
This argument is used to hide the confidence score.
Next is the capital level argument.
This argument is used to display the key points.
Finally, there is the argument angle.
This argument is used to set the angle that determines the squad position.
The default value is 80.
Following them.
This program code is used to check the sources extension because we only accept video and webcam if
the source extension is in the following array.
Image type would be true, otherwise it will be false.
Next, there is a condition.
If the source is an image, the following string will be displayed and the detection process will be
aborted.
If it is not an image, the detection process will be initiated by calling the detect function.
Let me call you Detective Thompson.
We used to have snow graft to prevent pilots from calculating the gradients, because completing gradients
would result in a GPU memory leak.
Next go to the detect function.
This program called is used to store several arguments in variables.
This program called is used to determine the folder where the detection results are safe.
This program called is responsible for selecting the device based on the device argument.
The problem code is used to determine whether the model can be run with half precision.
Half precision has the advantage of requiring less memory.
The condition for using half is that the device use has a GPU with a compute capability greater than
eight.
If it meets these criteria, the half variable will be true.
In this column.
The attempt not function with weights and device parameters is used to load all of these seven model.
This condition is used to use half precision in the model.
If the half variable is true.
Furthermore, this program called is used to check the source and open the video to open the video.
We use the video capture function from open cfy.
This function requires a parameter.
The video.
This program called determines whether or not the source is a webcam.
If it's a webcam, we must cast the source from string to integer in the video capture function parameter.
If not, leave it as it is.
Furthermore, this program code is to obtain class names.
Next, we initialize two variables.
The control variable is initialized with a value of zero.
This variable is used to calculate the squad movement.
The states variable is initialized with an empty string.
This variable is used to store more.
Then you looking to access all the frames in the video?
To retrieve a frame use kept up with function.
This function will return a frame value and whether or not the frame was successfully retrieved.
If it is not successfully retrieved, the program will automatically exit.
Next.
Copy the frame to the image variable.
Then resize the frame according to the image size argument and appending to the frame to make it square.
This program called is used to convert from BGR to RCB.
In addition, convert dimension from height with channels to channels height with.
This problem code is used to convert image to tensor.
This program called is used to normalize the pixel values from 0 to 255 becomes 0 to 1.
For the Texan, you have to add a better dimension to the image.
This program code will add a better dimension.
Furthermore, for detection, use the mode of function with one parameter, namely the image or video
frame detection results are stored in the prep variable.
After that.
This program called is used to perform non max suppression under detection results.
The t one and t two variables are used to calculate the detection time.
Next, we assess the detection results.
This variable is of type list, but the detection results are in the first list.
We start the detection results to the date variable.
This program called determines the safe path.
This safe path is a combination of the folder name and the file name that stores the detection results.
There are conditions that are used to check whether there is a detection result or not.
If there is, it will proceed to the next process.
This program called is used to rescaled the detection results to the original image of frame size.
Makes you slip into access.
All the tests and results, the detection results are bonding boxes, confidence scores and class ID.
In this section, we will calculate the squad and draw the detection results in the image or frame.
This program called is used to convert class ed integer.
This program code is for the label to be displayed.
If there is a Hide Labels argument, then this label will be empty.
If not, then this label is a confidence score.
This program code is used to get a list of key points.
Key points will be stored in the kept as variable.
So identify squad movements.
Three points are required to hit me and Hill.
We used to get calls from soon to find a point.
The course function accepts one parameter, namely this key points.
Following are the key points of the hip, knee and heal on the left leg.
And here are the key points.
The idea of the hit me and heel on the right leg.
Next, we take one of the key points that exists in the text and results we use to get hip knee function.
This function accepts two parameters, namely, list key points and list ID.
This looping is used to check whether the hit me and hill points are present in the detection results.
If there is, it will be added to the array.
This function will return an array containing the coordinates of the hit me and heal points.
First we take on the left leg.
If not, then take on the right leg.
If it's not on the left and right legs, then it's not a squat movement to determine the squat movement
or not.
We will store it in a squat post variable.
After that, we will return the array and the variable.
Return to this section.
If you have got an array that stores the coordinates of the hit me and he points, then we will calculate
the angle between these points.
This angle calculation is performed if the squat pulse variable is true.
To calculate the angle used to calculate angle function.
This function accepts one parameter, which is an array that stores the coordinates of the NI and hill
points.
This program code is used to calculate angles.
After that, we will return the angle that has been obtained.
We turn to this section.
After getting the anger used the squad from him to compute the squad movement.
This function requires three parameters angle, stage and counter.
What are counted when you stand squat and then stand again.
There are several conditions for this function.
The first condition is if the angle is greater than 160, it will enter this condition.
Was the previous movement down?
If yes, then the counter will be increased by one.
After that, the states will become a stand.
The second condition, which is used to change the stage to down if the angle is less than the angle
argument and the stage is equal to the stem.
This function will return the angle states and counter values.
We turn to this section.
After calculating the squad use this program called to draw bounding boxes and key points on the image
of frame.
This program called is used to display time of detection and non mock suppression.
Furthermore, this program called is used to display the counter and states in the upper left corner
of the image.
This program's called creates a black box using the cfy two rectangle function.
This program called the soda counter.
This program called is used to display the state.
If you are standing, the state's writing will be green.
If you are done squatting, it will be read.
Furthermore, the detection results will be displayed if the few IMC is true.
However, before displaying the image or frame, we will take its width and height.
If the width or height exceed 1500 pixels, the image will be resized by 70%.
The inmates of frame is then displayed using the cv2 dot himself function.
Next, if Chef Ramsay is set to throw, the detection results will be saved as a video using the program
code below.
This program called is used to stop detection by pressing the key.
Finally, this program called is used to display the time of the entire process.
That's all the explanation of this squad code.
Thank you.
And see you then.
Can't find what you're looking for?
Get subtitles in any language from opensubtitles.com, and translate them here.