All language subtitles for 002 Squat Counter Code Explanation

af Afrikaans
sq Albanian
am Amharic
ar Arabic
hy Armenian
az Azerbaijani
eu Basque
be Belarusian
bn Bengali
bs Bosnian
bg Bulgarian
ca Catalan
ceb Cebuano
ny Chichewa
zh-CN Chinese (Simplified)
zh-TW Chinese (Traditional)
co Corsican
hr Croatian
cs Czech
da Danish
nl Dutch
en English
eo Esperanto
et Estonian
tl Filipino
fi Finnish
fr French
fy Frisian
gl Galician
ka Georgian
de German
el Greek
gu Gujarati
ht Haitian Creole
ha Hausa
haw Hawaiian
iw Hebrew
hi Hindi
hmn Hmong
hu Hungarian
is Icelandic
ig Igbo
id Indonesian
ga Irish
it Italian
ja Japanese
jw Javanese
kn Kannada
kk Kazakh
km Khmer
ko Korean
ku Kurdish (Kurmanji)
ky Kyrgyz
lo Lao
la Latin
lv Latvian
lt Lithuanian
lb Luxembourgish
mk Macedonian
mg Malagasy
ms Malay
ml Malayalam
mt Maltese
mi Maori
mr Marathi
mn Mongolian
my Myanmar (Burmese)
ne Nepali
no Norwegian
ps Pashto
fa Persian
pl Polish
pt Portuguese
pa Punjabi
ro Romanian
ru Russian
sm Samoan
gd Scots Gaelic
sr Serbian
st Sesotho
sn Shona
sd Sindhi
si Sinhala
sk Slovak
sl Slovenian
so Somali
es Spanish
su Sundanese
sw Swahili
sv Swedish
tg Tajik
ta Tamil
te Telugu
th Thai
tr Turkish
uk Ukrainian
ur Urdu
uz Uzbek
vi Vietnamese Download
cy Welsh
xh Xhosa
yi Yiddish
yo Yoruba
zu Zulu
or Odia (Oriya)
rw Kinyarwanda
tk Turkmen
tt Tatar
ug Uyghur
Would you like to inspect the original subtitles? These are the user uploaded subtitles that are being translated: 1 00:00:00,150 --> 00:00:03,790 In this video, I will explain the program called Use for the Squad counter. 2 00:00:05,190 --> 00:00:08,460 First open the squad contact by using a text editor. 3 00:00:08,910 --> 00:00:11,610 In this example, we are using Visual Studio Code. 4 00:00:13,250 --> 00:00:16,190 First, some libraries and functions must be imported. 5 00:00:16,700 --> 00:00:18,740 The library use is described below. 6 00:00:19,800 --> 00:00:20,330 Up first. 7 00:00:20,340 --> 00:00:23,640 It's used to press arguments to the Python code via the command line. 8 00:00:24,150 --> 00:00:28,290 Finally, it's used to obtain the time, which is then used to calculate the detection time. 9 00:00:28,900 --> 00:00:34,140 So if it is used to open images, display images draw bounding boxes on images and so on. 10 00:00:34,650 --> 00:00:40,170 False is used because the model used is based on python's numpy is used to manipulate arrays. 11 00:00:41,470 --> 00:00:42,540 Next is the function. 12 00:00:42,550 --> 00:00:46,990 This function is imported from the utils and models from each of these seven repository. 13 00:00:47,970 --> 00:00:50,810 Attempt blood is used to load all of these seven models. 14 00:00:51,840 --> 00:00:56,610 Box is used to add pending to the image so that it becomes squared according to the image size. 15 00:00:57,180 --> 00:01:02,760 Non max Suppressing CPT is used to perform non maximal suppression on the results of object detection 16 00:01:02,760 --> 00:01:05,730 in order to reduce overlapping of the detection results. 17 00:01:06,640 --> 00:01:10,060 Care costs capped is used to rescale bonding boxes. 18 00:01:10,720 --> 00:01:13,510 Colors is used to give a color to the detection results. 19 00:01:14,450 --> 00:01:14,660 Lot. 20 00:01:14,660 --> 00:01:20,450 One box kept is used to draw bounding boxes, key points, class names and confidence scores. 21 00:01:21,110 --> 00:01:24,620 Select devices used to choose a device based on the device argument. 22 00:01:25,970 --> 00:01:30,200 After an explanation of import libraries and functions didn't go to the main function. 23 00:01:32,030 --> 00:01:35,300 The arguments that can be used are first defined in the main function. 24 00:01:35,750 --> 00:01:37,430 There are 14 arguments here. 25 00:01:38,240 --> 00:01:40,070 First there is the weight argument. 26 00:01:40,340 --> 00:01:44,030 This argument specifies the of these seven weights file to be used. 27 00:01:44,360 --> 00:01:48,020 YOLO v7w6 Postscript is the default value. 28 00:01:48,740 --> 00:01:50,510 The source argument comes next. 29 00:01:50,900 --> 00:01:53,720 This argument is used to accept the source to be detected. 30 00:01:54,080 --> 00:01:56,930 Only video and webcam are supported in this source code. 31 00:01:57,440 --> 00:02:02,720 The default value is zero, which indicates webcam then the image size argument. 32 00:02:03,110 --> 00:02:05,360 This argument is for inference size. 33 00:02:06,050 --> 00:02:08,240 The default value is 640. 34 00:02:09,020 --> 00:02:10,729 Next is the contract argument. 35 00:02:11,090 --> 00:02:13,760 This argument is an object confidence threshold. 36 00:02:14,240 --> 00:02:18,170 The detection results that will be displayed are those with a score greater than this threshold. 37 00:02:18,980 --> 00:02:21,200 0.25 is the default value. 38 00:02:21,920 --> 00:02:23,840 Makes the A02s argument. 39 00:02:24,230 --> 00:02:27,380 This argument is the threshold for non suppression. 40 00:02:28,120 --> 00:02:29,680 Next is the device argument. 41 00:02:30,070 --> 00:02:31,200 This argument is cute. 42 00:02:31,200 --> 00:02:31,960 A device. 43 00:02:32,350 --> 00:02:35,680 If you want to use CPU, you replace zero with CPU. 44 00:02:36,400 --> 00:02:38,320 The view image argument comes next. 45 00:02:38,740 --> 00:02:41,680 This is an argument for displaying the detection results. 46 00:02:42,460 --> 00:02:42,990 Next. 47 00:02:43,000 --> 00:02:44,110 No safe argument. 48 00:02:44,470 --> 00:02:48,100 This argument is used if you don't want to save the detection results. 49 00:02:48,920 --> 00:02:51,200 Then there are the project and name arguments. 50 00:02:51,620 --> 00:02:55,280 This argument specifies the location of the detection results folder. 51 00:02:56,130 --> 00:02:57,960 Next is the line thickness argument. 52 00:02:58,440 --> 00:03:01,560 This argument is used to set the thickness of the bonding box. 53 00:03:02,010 --> 00:03:03,600 The default value is three. 54 00:03:04,290 --> 00:03:06,390 Next is the height labels argument. 55 00:03:06,780 --> 00:03:09,420 This argument is used to hide the confidence score. 56 00:03:10,200 --> 00:03:12,450 Next is the capital level argument. 57 00:03:12,870 --> 00:03:15,450 This argument is used to display the key points. 58 00:03:16,350 --> 00:03:18,240 Finally, there is the argument angle. 59 00:03:18,690 --> 00:03:22,350 This argument is used to set the angle that determines the squad position. 60 00:03:22,710 --> 00:03:24,330 The default value is 80. 61 00:03:25,970 --> 00:03:26,690 Following them. 62 00:03:26,690 --> 00:03:33,140 This program code is used to check the sources extension because we only accept video and webcam if 63 00:03:33,140 --> 00:03:35,200 the source extension is in the following array. 64 00:03:35,240 --> 00:03:38,600 Image type would be true, otherwise it will be false. 65 00:03:39,170 --> 00:03:40,610 Next, there is a condition. 66 00:03:40,910 --> 00:03:45,350 If the source is an image, the following string will be displayed and the detection process will be 67 00:03:45,350 --> 00:03:45,830 aborted. 68 00:03:46,640 --> 00:03:51,380 If it is not an image, the detection process will be initiated by calling the detect function. 69 00:03:52,110 --> 00:03:53,580 Let me call you Detective Thompson. 70 00:03:53,610 --> 00:03:59,520 We used to have snow graft to prevent pilots from calculating the gradients, because completing gradients 71 00:03:59,520 --> 00:04:01,590 would result in a GPU memory leak. 72 00:04:02,320 --> 00:04:04,270 Next go to the detect function. 73 00:04:06,020 --> 00:04:09,620 This program called is used to store several arguments in variables. 74 00:04:10,460 --> 00:04:14,510 This program called is used to determine the folder where the detection results are safe. 75 00:04:15,280 --> 00:04:19,660 This program called is responsible for selecting the device based on the device argument. 76 00:04:20,690 --> 00:04:24,620 The problem code is used to determine whether the model can be run with half precision. 77 00:04:25,040 --> 00:04:28,310 Half precision has the advantage of requiring less memory. 78 00:04:28,700 --> 00:04:33,590 The condition for using half is that the device use has a GPU with a compute capability greater than 79 00:04:33,590 --> 00:04:33,890 eight. 80 00:04:34,310 --> 00:04:37,460 If it meets these criteria, the half variable will be true. 81 00:04:38,380 --> 00:04:39,160 In this column. 82 00:04:39,160 --> 00:04:43,900 The attempt not function with weights and device parameters is used to load all of these seven model. 83 00:04:44,650 --> 00:04:47,330 This condition is used to use half precision in the model. 84 00:04:47,350 --> 00:04:49,090 If the half variable is true. 85 00:04:49,960 --> 00:04:54,970 Furthermore, this program called is used to check the source and open the video to open the video. 86 00:04:55,000 --> 00:04:57,640 We use the video capture function from open cfy. 87 00:04:58,090 --> 00:04:59,960 This function requires a parameter. 88 00:04:59,980 --> 00:05:00,460 The video. 89 00:05:01,700 --> 00:05:04,940 This program called determines whether or not the source is a webcam. 90 00:05:05,240 --> 00:05:10,340 If it's a webcam, we must cast the source from string to integer in the video capture function parameter. 91 00:05:10,880 --> 00:05:12,710 If not, leave it as it is. 92 00:05:13,790 --> 00:05:16,850 Furthermore, this program code is to obtain class names. 93 00:05:17,680 --> 00:05:20,020 Next, we initialize two variables. 94 00:05:20,710 --> 00:05:23,410 The control variable is initialized with a value of zero. 95 00:05:23,440 --> 00:05:26,140 This variable is used to calculate the squad movement. 96 00:05:26,650 --> 00:05:29,300 The states variable is initialized with an empty string. 97 00:05:29,320 --> 00:05:31,240 This variable is used to store more. 98 00:05:31,980 --> 00:05:34,830 Then you looking to access all the frames in the video? 99 00:05:35,660 --> 00:05:38,210 To retrieve a frame use kept up with function. 100 00:05:38,600 --> 00:05:42,980 This function will return a frame value and whether or not the frame was successfully retrieved. 101 00:05:43,340 --> 00:05:47,150 If it is not successfully retrieved, the program will automatically exit. 102 00:05:47,920 --> 00:05:48,410 Next. 103 00:05:48,430 --> 00:05:50,380 Copy the frame to the image variable. 104 00:05:50,890 --> 00:05:56,110 Then resize the frame according to the image size argument and appending to the frame to make it square. 105 00:05:57,340 --> 00:06:00,820 This program called is used to convert from BGR to RCB. 106 00:06:01,210 --> 00:06:06,070 In addition, convert dimension from height with channels to channels height with. 107 00:06:07,000 --> 00:06:09,790 This problem code is used to convert image to tensor. 108 00:06:11,030 --> 00:06:17,150 This program called is used to normalize the pixel values from 0 to 255 becomes 0 to 1. 109 00:06:18,190 --> 00:06:21,310 For the Texan, you have to add a better dimension to the image. 110 00:06:21,850 --> 00:06:24,190 This program code will add a better dimension. 111 00:06:25,140 --> 00:06:29,850 Furthermore, for detection, use the mode of function with one parameter, namely the image or video 112 00:06:29,850 --> 00:06:33,450 frame detection results are stored in the prep variable. 113 00:06:34,250 --> 00:06:34,880 After that. 114 00:06:34,880 --> 00:06:39,140 This program called is used to perform non max suppression under detection results. 115 00:06:39,990 --> 00:06:43,590 The t one and t two variables are used to calculate the detection time. 116 00:06:44,490 --> 00:06:47,040 Next, we assess the detection results. 117 00:06:47,490 --> 00:06:51,360 This variable is of type list, but the detection results are in the first list. 118 00:06:51,750 --> 00:06:54,390 We start the detection results to the date variable. 119 00:06:55,400 --> 00:06:57,650 This program called determines the safe path. 120 00:06:58,070 --> 00:07:03,200 This safe path is a combination of the folder name and the file name that stores the detection results. 121 00:07:04,280 --> 00:07:07,820 There are conditions that are used to check whether there is a detection result or not. 122 00:07:08,420 --> 00:07:11,120 If there is, it will proceed to the next process. 123 00:07:12,410 --> 00:07:17,390 This program called is used to rescaled the detection results to the original image of frame size. 124 00:07:18,180 --> 00:07:19,830 Makes you slip into access. 125 00:07:19,830 --> 00:07:26,160 All the tests and results, the detection results are bonding boxes, confidence scores and class ID. 126 00:07:27,050 --> 00:07:31,640 In this section, we will calculate the squad and draw the detection results in the image or frame. 127 00:07:32,790 --> 00:07:35,820 This program called is used to convert class ed integer. 128 00:07:36,570 --> 00:07:38,970 This program code is for the label to be displayed. 129 00:07:39,360 --> 00:07:42,660 If there is a Hide Labels argument, then this label will be empty. 130 00:07:43,050 --> 00:07:45,720 If not, then this label is a confidence score. 131 00:07:46,470 --> 00:07:49,290 This program code is used to get a list of key points. 132 00:07:50,040 --> 00:07:52,770 Key points will be stored in the kept as variable. 133 00:07:53,580 --> 00:07:55,310 So identify squad movements. 134 00:07:55,320 --> 00:07:58,020 Three points are required to hit me and Hill. 135 00:07:58,590 --> 00:08:01,020 We used to get calls from soon to find a point. 136 00:08:02,830 --> 00:08:06,670 The course function accepts one parameter, namely this key points. 137 00:08:07,770 --> 00:08:11,250 Following are the key points of the hip, knee and heal on the left leg. 138 00:08:11,640 --> 00:08:12,830 And here are the key points. 139 00:08:12,830 --> 00:08:15,000 The idea of the hit me and heel on the right leg. 140 00:08:15,660 --> 00:08:21,780 Next, we take one of the key points that exists in the text and results we use to get hip knee function. 141 00:08:22,720 --> 00:08:26,680 This function accepts two parameters, namely, list key points and list ID. 142 00:08:27,480 --> 00:08:32,130 This looping is used to check whether the hit me and hill points are present in the detection results. 143 00:08:32,919 --> 00:08:35,110 If there is, it will be added to the array. 144 00:08:36,030 --> 00:08:40,470 This function will return an array containing the coordinates of the hit me and heal points. 145 00:08:41,860 --> 00:08:43,390 First we take on the left leg. 146 00:08:43,900 --> 00:08:45,820 If not, then take on the right leg. 147 00:08:46,240 --> 00:08:51,070 If it's not on the left and right legs, then it's not a squat movement to determine the squat movement 148 00:08:51,070 --> 00:08:51,520 or not. 149 00:08:51,550 --> 00:08:53,680 We will store it in a squat post variable. 150 00:08:54,490 --> 00:08:57,010 After that, we will return the array and the variable. 151 00:08:58,850 --> 00:09:00,200 Return to this section. 152 00:09:00,910 --> 00:09:05,590 If you have got an array that stores the coordinates of the hit me and he points, then we will calculate 153 00:09:05,590 --> 00:09:07,270 the angle between these points. 154 00:09:08,100 --> 00:09:11,820 This angle calculation is performed if the squat pulse variable is true. 155 00:09:12,600 --> 00:09:15,780 To calculate the angle used to calculate angle function. 156 00:09:17,550 --> 00:09:22,470 This function accepts one parameter, which is an array that stores the coordinates of the NI and hill 157 00:09:22,470 --> 00:09:23,160 points. 158 00:09:23,940 --> 00:09:26,640 This program code is used to calculate angles. 159 00:09:27,420 --> 00:09:30,090 After that, we will return the angle that has been obtained. 160 00:09:31,850 --> 00:09:33,260 We turn to this section. 161 00:09:34,210 --> 00:09:38,170 After getting the anger used the squad from him to compute the squad movement. 162 00:09:39,920 --> 00:09:43,970 This function requires three parameters angle, stage and counter. 163 00:09:45,310 --> 00:09:48,340 What are counted when you stand squat and then stand again. 164 00:09:49,090 --> 00:09:51,310 There are several conditions for this function. 165 00:09:52,030 --> 00:09:56,620 The first condition is if the angle is greater than 160, it will enter this condition. 166 00:09:57,500 --> 00:09:59,150 Was the previous movement down? 167 00:09:59,150 --> 00:10:01,700 If yes, then the counter will be increased by one. 168 00:10:02,030 --> 00:10:04,160 After that, the states will become a stand. 169 00:10:05,070 --> 00:10:09,810 The second condition, which is used to change the stage to down if the angle is less than the angle 170 00:10:09,810 --> 00:10:12,000 argument and the stage is equal to the stem. 171 00:10:12,690 --> 00:10:16,320 This function will return the angle states and counter values. 172 00:10:18,150 --> 00:10:19,500 We turn to this section. 173 00:10:20,300 --> 00:10:25,430 After calculating the squad use this program called to draw bounding boxes and key points on the image 174 00:10:25,430 --> 00:10:26,000 of frame. 175 00:10:27,340 --> 00:10:31,570 This program called is used to display time of detection and non mock suppression. 176 00:10:32,810 --> 00:10:37,070 Furthermore, this program called is used to display the counter and states in the upper left corner 177 00:10:37,070 --> 00:10:37,970 of the image. 178 00:10:38,540 --> 00:10:42,800 This program's called creates a black box using the cfy two rectangle function. 179 00:10:43,520 --> 00:10:45,500 This program called the soda counter. 180 00:10:46,280 --> 00:10:48,800 This program called is used to display the state. 181 00:10:49,250 --> 00:10:51,710 If you are standing, the state's writing will be green. 182 00:10:52,250 --> 00:10:54,350 If you are done squatting, it will be read. 183 00:10:55,850 --> 00:10:59,690 Furthermore, the detection results will be displayed if the few IMC is true. 184 00:11:00,680 --> 00:11:04,460 However, before displaying the image or frame, we will take its width and height. 185 00:11:04,970 --> 00:11:10,430 If the width or height exceed 1500 pixels, the image will be resized by 70%. 186 00:11:11,650 --> 00:11:15,490 The inmates of frame is then displayed using the cv2 dot himself function. 187 00:11:16,740 --> 00:11:21,960 Next, if Chef Ramsay is set to throw, the detection results will be saved as a video using the program 188 00:11:21,960 --> 00:11:22,710 code below. 189 00:11:24,090 --> 00:11:27,720 This program called is used to stop detection by pressing the key. 190 00:11:28,560 --> 00:11:32,520 Finally, this program called is used to display the time of the entire process. 191 00:11:33,840 --> 00:11:36,390 That's all the explanation of this squad code. 192 00:11:36,600 --> 00:11:37,170 Thank you. 193 00:11:37,170 --> 00:11:38,010 And see you then. 18382

Can't find what you're looking for?
Get subtitles in any language from opensubtitles.com, and translate them here.