/continues_hand_recognize

Continues hand recognize scripts

Primary LanguagePython

Script detect_key_points_from_video.py generates output csv file from video using openpose. It is assumed that openpose build is placed in neighborhood directory, ex.:

$ ls -l
total 0
drwxrwxrwx 1 tsypia tsypia 4096 Mar 28 03:11 ./
drwxrwxrwx 1 tsypia tsypia 4096 Mar 28 02:34 ../
drwxrwxrwx 1 tsypia tsypia 4096 Mar 11 22:31 build/
drwxrwxrwx 1 tsypia tsypia 4096 Mar 29 10:14 continues_hand_recognize/

Example of using:

$ ./continues_hand_recognize/detect_key_points_from_video.py -v ./examples/my_example1.mp4 -o output.csv
Starting OpenPose Python Wrapper...
---------------------------------- WARNING ----------------------------------
We have introduced an additional boost in accuracy of about 0.5% with respect to the official OpenPose 1.4.0 (using default settings). Currently, this increase is only applicable to CUDA version, but will eventually be ported to CPU and OpenCL versions. Therefore, CPU and OpenCL results might vary. Nevertheless, this accuracy boost is almost insignificant so CPU and OpenCL versions can be safely used, they will simply provide the exact same accuracy than OpenPose 1.4.0.
-------------------------------- END WARNING --------------------------------

it should generate output.csv file in the following format:

time,x0,y0,c0,x1,y1,c1,x2,y2,c2,x3,y3,c3,x4,y4,c4,x5,y5,c5,x6,y6,c6,x7,y7,c7,x8,y8,c8,x9,y9,c9,x10,y10,c10,x11,y11,c11,x12,y12,c12,x13,y13,c13,x14,y14,c14,x15,y15,c15,x16,y16,c16,x17,y17,c17,x18,y18,c18,x19,y19,c19,x20,y20,c20
99.4562091503268,651.8043823242188,173.44564819335938,0.41953015327453613,716.6630249023438,243.29348754882812,0.23153993487358093,766.5543823242188,311.478271484375,0.23195379972457886,796.4891357421875,371.34783935546875,0.60550457239151,789.8369750976562,444.521728515625,0.6472079753875732,711.6738891601562,251.60870361328125,0.31094539165496826,723.3152465820312,309.8152160644531,0.7845603227615356,726.6412963867188,402.9456481933594,0.8841410875320435,721.6521606445312,479.4456481933594,0.8254374861717224,633.5108642578125,254.93478393554688,0.6054155826568604,623.5325927734375,331.4347839355469,0.6998189687728882,621.8695678710938,432.88043212890625,0.6275839805603027,630.184814453125,511.0434875488281,0.7666336297988892,565.3261108398438,284.86956787109375,0.568031907081604,548.6956787109375,336.4239196777344,0.8374754190444946,553.684814453125,422.9021911621094,0.8509167432785034,566.9891357421875,496.0760803222656,0.8310249447822571,512.1087036132812,314.8043518066406,0.4507640600204468,490.4891357421875,349.728271484375,0.7358506917953491,493.8152160644531,407.9347839355469,0.9168828725814819,503.7934875488281,456.1630554199219,0.854999840259552
198.9124183006536,650.1412963867188,173.44564819335938,0.4344905912876129,718.3261108398438,241.63043212890625,0.27308568358421326,769.8804321289062,311.478271484375,0.24179121851921082,794.8261108398438,369.6847839355469,0.6200095415115356,789.8369750976562,446.1847839355469,0.693640410900116,715.0,256.59783935546875,0.3225293755531311,723.3152465820312,314.8043518066406,0.7993773221969604,726.6412963867188,404.60870361328125,0.8978201746940613,719.9891357421875,479.4456481933594,0.8358649015426636,635.1738891601562,258.2608642578125,0.599833071231842,623.5325927734375,324.7826232910156,0.6981512308120728,621.8695678710938,434.5434875488281,0.6839118599891663,628.521728515625,512.70654296875,0.7905764579772949,566.9891357421875,283.2065124511719,0.5895068645477295,548.6956787109375,339.75,0.8417994976043701,553.684814453125,427.89129638671875,0.8793706297874451,566.9891357421875,497.7391357421875,0.8544654250144958,515.434814453125,309.8152160644531,0.454616904258728,488.8260803222656,348.0652160644531,0.7592359781265259,492.1521911621094,406.271728515625,0.9010255932807922,502.13043212890625,456.1630554199219,0.8616763949394226
298.3686274509804,651.8043823242188,170.11956787109375,0.43015944957733154,718.3261108398438,236.6413116455078,0.2708898186683655,766.5543823242188,309.8152160644531,0.2224617600440979,794.8261108398438,369.6847839355469,0.6134658455848694,791.5,446.1847839355469,0.6561025977134705,708.3478393554688,239.96739196777344,0.3218364119529724,724.978271484375,311.478271484375,0.8314180970191956,726.6412963867188,402.9456481933594,0.9156132936477661,721.6521606445312,479.4456481933594,0.8503943085670471,633.5108642578125,254.93478393554688,0.6164977550506592,623.5325927734375,328.10870361328125,0.6627569198608398,623.5325927734375,432.88043212890625,0.7324085235595703,630.184814453125,512.70654296875,0.790227472782135,565.3261108398438,281.5434875488281,0.599470853805542,548.6956787109375,341.4130554199219,0.8234063982963562,553.684814453125,426.228271484375,0.8383234739303589,566.9891357421875,497.7391357421875,0.821668803691864,515.434814453125,309.8152160644531,0.4469892978668213,490.4891357421875,348.0652160644531,0.7736935615539551,492.1521911621094,406.271728515625,0.9193570017814636,502.13043212890625,457.8260803222656,0.8702622652053833
397.8248366013072,651.8043823242188,173.44564819335938,0.43722230195999146,716.6630249023438,244.95652770996094,0.27451202273368835,768.2174072265625,309.8152160644531,0.2543758153915405,796.4891357421875,371.34783935546875,0.621263861656189,791.5,447.84783935546875,0.6869367361068726,711.6738891601562,248.28260803222656,0.3256876468658447,724.978271484375,314.8043518066406,0.815759003162384,724.978271484375,402.9456481933594,0.8942824602127075,721.6521606445312,479.4456481933594,0.8423820734024048,633.5108642578125,256.59783935546875,0.5912520885467529,623.5325927734375,328.10870361328125,0.7132056951522827,623.5325927734375,434.5434875488281,0.6622881889343262,631.8478393554688,511.0434875488281,0.7816781997680664,565.3261108398438,284.86956787109375,0.5858557224273682,548.6956787109375,343.0760803222656,0.8104619383811951,553.684814453125,426.228271484375,0.8253639340400696,566.9891357421875,497.7391357421875,0.835711658000946,515.434814453125,311.478271484375,0.4504711627960205,490.4891357421875,349.728271484375,0.7558479309082031,493.8152160644531,407.9347839355469,0.8969587683677673,502.13043212890625,457.8260803222656,0.865835428237915
497.281045751634,651.8043823242188,171.78260803222656,0.4241170287132263,718.3261108398438,239.96739196777344,0.309853732585907,773.20654296875,308.1521911621094,0.29775330424308777,798.1521606445312,371.34783935546875,0.6557706594467163,788.1739501953125,447.84783935546875,0.6625056266784668,713.3369750976562,248.28260803222656,0.2895873486995697,726.6412963867188,314.8043518066406,0.8373485207557678,726.6412963867188,402.9456481933594,0.899715781211853,721.6521606445312,479.4456481933594,0.8468592762947083,633.5108642578125,254.93478393554688,0.5859489440917969,623.5325927734375,328.10870361328125,0.6419438123703003,623.5325927734375,436.2065124511719,0.7414354085922241,631.8478393554688,512.70654296875,0.7803606986999512,566.9891357421875,281.5434875488281,0.5772096514701843,548.6956787109375,344.7391357421875,0.8047733306884766,553.684814453125,426.228271484375,0.8131657242774963,566.9891357421875,497.7391357421875,0.8380856513977051,518.7608642578125,309.8152160644531,0.44003209471702576,490.4891357421875,348.0652160644531,0.7798488140106201,493.8152160644531,406.271728515625,0.8948155641555786,503.7934875488281,459.4891357421875,0.8649471998214722
596.7372549019608,651.8043823242188,170.11956787109375,0.4097788333892822,716.6630249023438,241.63043212890625,0.26878225803375244,769.8804321289062,311.478271484375,0.265851765871048,796.4891357421875,371.34783935546875,0.6359608173370361,791.5,447.84783935546875,0.7054443359375,711.6738891601562,244.95652770996094,0.35538116097450256,724.978271484375,314.8043518066406,0.855182409286499,726.6412963867188,402.9456481933594,0.9071869850158691,721.6521606445312,479.4456481933594,0.849163830280304,635.1738891601562,254.93478393554688,0.6100005507469177,623.5325927734375,323.11956787109375,0.6924021244049072,623.5325927734375,434.5434875488281,0.665529191493988,631.8478393554688,512.70654296875,0.7811295390129089,566.9891357421875,283.2065124511719,0.5612697005271912,548.6956787109375,341.4130554199219,0.8426321744918823,553.684814453125,427.89129638671875,0.8456772565841675,566.9891357421875,501.0652160644531,0.8520945310592651,517.0978393554688,313.14129638671875,0.43213802576065063,490.4891357421875,349.728271484375,0.7659240365028381,493.8152160644531,407.9347839355469,0.9135904908180237,502.13043212890625,459.4891357421875,0.8650811910629272

time in milliseconds from beginning of video. corresponding points on video xi,yi,ci for i keypoints_hand.png