5
5
"colab" : {
6
6
"provenance" : [],
7
7
"mount_file_id" : " 1YJfEK8zha4PfUk2yP9y-XbO4vtmn83gE" ,
8
- "authorship_tag" : " ABX9TyPqC8aZOBxrn5vwvNxHoub4 " ,
8
+ "authorship_tag" : " ABX9TyPf94t3YgjtLkVRDYA222aU " ,
9
9
"include_colab_link" : true
10
10
},
11
11
"kernelspec" : {
107
107
" import os\n " ,
108
108
" import glob\n " ,
109
109
" import csv\n " ,
110
- " import warnings"
110
+ " import warnings\n " ,
111
+ " from statistics import mode"
111
112
],
112
113
"metadata" : {
113
114
"id" : " whZwvEdKIksm"
278
279
"metadata" : {
279
280
"id" : " RHyJwan8acCz"
280
281
},
281
- "execution_count" : null ,
282
+ "execution_count" : 17 ,
282
283
"outputs" : []
283
284
},
284
285
{
297
298
],
298
299
"metadata" : {
299
300
"id" : " Zng2DvUJcJjc" ,
300
- "outputId" : " 5e773745-adb7-45d0-fbf6-dc47ad96e633 " ,
301
+ "outputId" : " 06119dd8-3a96-4a01-ef98-a102e9126ca7 " ,
301
302
"colab" : {
302
303
"base_uri" : " https://localhost:8080/"
303
304
}
304
305
},
305
- "execution_count" : null ,
306
+ "execution_count" : 18 ,
306
307
"outputs" : [
307
308
{
308
309
"name" : " stdout" ,
309
310
"output_type" : " stream" ,
310
311
"text" : [
311
- " What model to use? heavy\n "
312
+ " What model to use? (lite/heavy) heavy\n "
312
313
]
313
314
}
314
315
]
332
333
" vid_path = root_path + '/Fit Form AI Resources/Videos/'"
333
334
],
334
335
"metadata" : {
335
- "id" : " brFyKQV5aEuK"
336
+ "id" : " brFyKQV5aEuK" ,
337
+ "outputId" : " 29211e6f-c1d4-4e2c-dffe-618c5ebbab0e" ,
338
+ "colab" : {
339
+ "base_uri" : " https://localhost:8080/"
340
+ }
336
341
},
337
- "execution_count" : null ,
338
- "outputs" : []
342
+ "execution_count" : 19 ,
343
+ "outputs" : [
344
+ {
345
+ "name" : " stdout" ,
346
+ "output_type" : " stream" ,
347
+ "text" : [
348
+ " Would you like to record and save the video you create below? (Y / N)\n " ,
349
+ " Y\n "
350
+ ]
351
+ }
352
+ ]
339
353
},
340
354
{
341
355
"cell_type" : " code" ,
349
363
" if record:\n " ,
350
364
" out_video = cv.VideoWriter(vid_path + time.asctime(time.localtime()) + '.mp4',cv.VideoWriter_fourcc(*'DIVX'), 24, (640, 480))\n " ,
351
365
" landmarks_list = []\n " ,
352
- " feedback_list = [\"\" ]\n " ,
366
+ " feedback_list = []\n " ,
353
367
" selected_exercise = input(\" What exercise are you tracking?\\ n\" )\n " ,
354
368
" \n " ,
355
369
" \n " ,
371
385
" # print(\" Frame\" , timestamp_ms)\n " ,
372
386
" working_dstruct = lm_dstruct(landmarks_list[-1])\n " ,
373
387
" feedback_temp = working_dstruct.feedback(selected_exercise)\n " ,
374
- " if feedback_list[-1] != feedback_temp:\n " ,
375
- " print(feedback_temp)\n " ,
376
388
" feedback_list.append(feedback_temp)\n " ,
389
+ " print(mode(feedback_list[-1:-4:-1]) if len(feedback_list) > 2 else feedback_temp)\n " ,
377
390
" if record:\n " ,
378
391
" out_video.write(annotated_image)\n " ,
379
392
" \n " ,
535
548
"outputs" : []
536
549
}
537
550
]
538
- }
551
+ }
0 commit comments