Free Motion Capture for Everyone πβ¨
TypeScript
i honestly can't even remember what I've been working recently lol
jon matthisa05aa649b13f
diff --git a/freemocap/analysis/skel_analisys.ipynb b/freemocap/analysis/skel_analisys.ipynbnew file mode 100644index 00000000..de77733d--- /dev/null+++ b/freemocap/analysis/skel_analisys.ipynb@@ -0,0 +1 @@+{"cells":[{"cell_type":"code","execution_count":1,"source":["%matplotlib WX\r\n"],"outputs":[{"output_type":"error","ename":"ValueError","evalue":"Key backend: Unrecognized backend string 'gtkagg': valid strings are ['GTK3Agg', 'GTK3Cairo', 'MacOSX', 'nbAgg', 'Qt4Agg', 'Qt4Cairo', 'Qt5Agg', 'Qt5Cairo', 'TkAgg', 'TkCairo', 'WebAgg', 'WX', 'WXAgg', 'WXCairo', 'agg', 'cairo', 'pdf', 'pgf', 'ps', 'svg', 'template']","traceback":["\u001b[1;31m---------------------------------------------------------------------------\u001b[0m","\u001b[1;31mValueError\u001b[0m Traceback (most recent call last)","\u001b[1;32m~\\anaconda3\\envs\\freemocap-env\\lib\\site-packages\\matplotlib\\__init__.py\u001b[0m in \u001b[0;36m__setitem__\u001b[1;34m(self, key, val)\u001b[0m\n\u001b[0;32m 801\u001b[0m \u001b[1;32mtry\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m--> 802\u001b[1;33m \u001b[0mcval\u001b[0m \u001b[1;33m=\u001b[0m \u001b[0mself\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mvalidate\u001b[0m\u001b[1;33m[\u001b[0m\u001b[0mkey\u001b[0m\u001b[1;33m]\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mval\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m 803\u001b[0m \u001b[1;32mexcept\u001b[0m \u001b[0mValueError\u001b[0m \u001b[1;32mas\u001b[0m \u001b[0mve\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n","\u001b[1;32m~\\anaconda3\\envs\\freemocap-env\\lib\\site-packages\\matplotlib\\rcsetup.py\u001b[0m in \u001b[0;36mvalidate_backend\u001b[1;34m(s)\u001b[0m\n\u001b[0;32m 265\u001b[0m \u001b[0ms\u001b[0m \u001b[1;32mif\u001b[0m \u001b[0ms\u001b[0m \u001b[1;32mis\u001b[0m \u001b[0m_auto_backend_sentinel\u001b[0m \u001b[1;32mor\u001b[0m \u001b[0ms\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mstartswith\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;34m\"module://\"\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m--> 266\u001b[1;33m else _validate_standard_backends(s))\n\u001b[0m\u001b[0;32m 267\u001b[0m \u001b[1;32mreturn\u001b[0m \u001b[0mbackend\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n","\u001b[1;32m~\\anaconda3\\envs\\freemocap-env\\lib\\site-packages\\matplotlib\\rcsetup.py\u001b[0m in \u001b[0;36m__call__\u001b[1;34m(self, s)\u001b[0m\n\u001b[0;32m 63\u001b[0m raise ValueError('Unrecognized %s string %r: valid strings are %s'\n\u001b[1;32m---> 64\u001b[1;33m % (self.key, s, list(self.valid.values())))\n\u001b[0m\u001b[0;32m 65\u001b[0m \u001b[1;33m\u001b[0m\u001b[0m\n","\u001b[1;31mValueError\u001b[0m: Unrecognized backend string 'gtkagg': valid strings are ['GTK3Agg', 'GTK3Cairo', 'MacOSX', 'nbAgg', 'Qt4Agg', 'Qt4Cairo', 'Qt5Agg', 'Qt5Cairo', 'TkAgg', 'TkCairo', 'WebAgg', 'WX', 'WXAgg', 'WXCairo', 'agg', 'cairo', 'pdf', 'pgf', 'ps', 'svg', 'template']","\nDuring handling of the above exception, another exception occurred:\n","\u001b[1;31mValueError\u001b[0m Traceback (most recent call last)","\u001b[1;32m~\\AppData\\Local\\Temp/ipykernel_2252/2305839510.py\u001b[0m in \u001b[0;36m<module>\u001b[1;34m\u001b[0m\n\u001b[1;32m----> 1\u001b[1;33m \u001b[0mget_ipython\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mrun_line_magic\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;34m'matplotlib'\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;34m'gtk'\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m","\u001b[1;32m~\\anaconda3\\envs\\freemocap-env\\lib\\site-packages\\IPython\\core\\interactiveshell.py\u001b[0m in \u001b[0;36mrun_line_magic\u001b[1;34m(self, magic_name, line, _stack_depth)\u001b[0m\n\u001b[0;32m 2346\u001b[0m \u001b[0mkwargs\u001b[0m\u001b[1;33m[\u001b[0m\u001b[1;34m'local_ns'\u001b[0m\u001b[1;33m]\u001b[0m \u001b[1;33m=\u001b[0m \u001b[0mself\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mget_local_scope\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mstack_depth\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 2347\u001b[0m \u001b[1;32mwith\u001b[0m \u001b[0mself\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mbuiltin_trap\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m-> 2348\u001b[1;33m \u001b[0mresult\u001b[0m \u001b[1;33m=\u001b[0m \u001b[0mfn\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;33m*\u001b[0m\u001b[0margs\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;33m**\u001b[0m\u001b[0mkwargs\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m 2349\u001b[0m \u001b[1;32mreturn\u001b[0m \u001b[0mresult\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 2350\u001b[0m \u001b[1;33m\u001b[0m\u001b[0m\n","\u001b[1;32m~\\anaconda3\\envs\\freemocap-env\\lib\\site-packages\\decorator.py\u001b[0m in \u001b[0;36mfun\u001b[1;34m(*args, **kw)\u001b[0m\n\u001b[0;32m 230\u001b[0m \u001b[1;32mif\u001b[0m \u001b[1;32mnot\u001b[0m \u001b[0mkwsyntax\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 231\u001b[0m \u001b[0margs\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mkw\u001b[0m \u001b[1;33m=\u001b[0m \u001b[0mfix\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0margs\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mkw\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0msig\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m--> 232\u001b[1;33m \u001b[1;32mreturn\u001b[0m \u001b[0mcaller\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mfunc\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;33m*\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mextras\u001b[0m \u001b[1;33m+\u001b[0m \u001b[0margs\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;33m**\u001b[0m\u001b[0mkw\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m 233\u001b[0m \u001b[0mfun\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0m__name__\u001b[0m \u001b[1;33m=\u001b[0m \u001b[0mfunc\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0m__name__\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 234\u001b[0m \u001b[0mfun\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0m__doc__\u001b[0m \u001b[1;33m=\u001b[0m \u001b[0mfunc\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0m__doc__\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n","\u001b[1;32m~\\anaconda3\\envs\\freemocap-env\\lib\\site-packages\\IPython\\core\\magic.py\u001b[0m in \u001b[0;36m<lambda>\u001b[1;34m(f, *a, **k)\u001b[0m\n\u001b[0;32m 185\u001b[0m \u001b[1;31m# but it's overkill for just that one bit of state.\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 186\u001b[0m \u001b[1;32mdef\u001b[0m \u001b[0mmagic_deco\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0marg\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m--> 187\u001b[1;33m \u001b[0mcall\u001b[0m \u001b[1;33m=\u001b[0m \u001b[1;32mlambda\u001b[0m \u001b[0mf\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;33m*\u001b[0m\u001b[0ma\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;33m**\u001b[0m\u001b[0mk\u001b[0m\u001b[1;33m:\u001b[0m \u001b[0mf\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;33m*\u001b[0m\u001b[0ma\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;33m**\u001b[0m\u001b[0mk\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m 188\u001b[0m \u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 189\u001b[0m \u001b[1;32mif\u001b[0m \u001b[0mcallable\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0marg\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n","\u001b[1;32m~\\anaconda3\\envs\\freemocap-env\\lib\\site-packages\\IPython\\core\\magics\\pylab.py\u001b[0m in \u001b[0;36mmatplotlib\u001b[1;34m(self, line)\u001b[0m\n\u001b[0;32m 97\u001b[0m \u001b[0mprint\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;34m\"Available matplotlib backends: %s\"\u001b[0m \u001b[1;33m%\u001b[0m \u001b[0mbackends_list\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 98\u001b[0m \u001b[1;32melse\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m---> 99\u001b[1;33m \u001b[0mgui\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mbackend\u001b[0m \u001b[1;33m=\u001b[0m \u001b[0mself\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mshell\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0menable_matplotlib\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0margs\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mgui\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mlower\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;33m)\u001b[0m \u001b[1;32mif\u001b[0m \u001b[0misinstance\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0margs\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mgui\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mstr\u001b[0m\u001b[1;33m)\u001b[0m \u001b[1;32melse\u001b[0m \u001b[0margs\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mgui\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m 100\u001b[0m \u001b[0mself\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0m_show_matplotlib_backend\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0margs\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mgui\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mbackend\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 101\u001b[0m \u001b[1;33m\u001b[0m\u001b[0m\n","\u001b[1;32m~\\anaconda3\\envs\\freemocap-env\\lib\\site-packages\\IPython\\core\\interactiveshell.py\u001b[0m in \u001b[0;36menable_matplotlib\u001b[1;34m(self, gui)\u001b[0m\n\u001b[0;32m 3528\u001b[0m \u001b[0mgui\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mbackend\u001b[0m \u001b[1;33m=\u001b[0m \u001b[0mpt\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mfind_gui_and_backend\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mself\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mpylab_gui_select\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 3529\u001b[0m \u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m-> 3530\u001b[1;33m \u001b[0mpt\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mactivate_matplotlib\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mbackend\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m 3531\u001b[0m \u001b[0mconfigure_inline_support\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mself\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mbackend\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 3532\u001b[0m \u001b[1;33m\u001b[0m\u001b[0m\n","\u001b[1;32m~\\anaconda3\\envs\\freemocap-env\\lib\\site-packages\\IPython\\core\\pylabtools.py\u001b[0m in \u001b[0;36mactivate_matplotlib\u001b[1;34m(backend)\u001b[0m\n\u001b[0;32m 315\u001b[0m \u001b[1;31m# the rcParam to update. This needs to be set *before* the module\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 316\u001b[0m \u001b[1;31m# magic of switch_backend().\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m--> 317\u001b[1;33m \u001b[0mmatplotlib\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mrcParams\u001b[0m\u001b[1;33m[\u001b[0m\u001b[1;34m'backend'\u001b[0m\u001b[1;33m]\u001b[0m \u001b[1;33m=\u001b[0m \u001b[0mbackend\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m 318\u001b[0m \u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 319\u001b[0m \u001b[1;31m# Due to circular imports, pyplot may be only partially initialised\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n","\u001b[1;32m~\\anaconda3\\envs\\freemocap-env\\lib\\site-packages\\matplotlib\\__init__.py\u001b[0m in \u001b[0;36m__setitem__\u001b[1;34m(self, key, val)\u001b[0m\n\u001b[0;32m 802\u001b[0m \u001b[0mcval\u001b[0m \u001b[1;33m=\u001b[0m \u001b[0mself\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mvalidate\u001b[0m\u001b[1;33m[\u001b[0m\u001b[0mkey\u001b[0m\u001b[1;33m]\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mval\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 803\u001b[0m \u001b[1;32mexcept\u001b[0m \u001b[0mValueError\u001b[0m \u001b[1;32mas\u001b[0m \u001b[0mve\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m--> 804\u001b[1;33m \u001b[1;32mraise\u001b[0m \u001b[0mValueError\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;34m\"Key %s: %s\"\u001b[0m \u001b[1;33m%\u001b[0m \u001b[1;33m(\u001b[0m\u001b[0mkey\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mstr\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mve\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m 805\u001b[0m \u001b[0mdict\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0m__setitem__\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mself\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mkey\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mcval\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 806\u001b[0m \u001b[1;32mexcept\u001b[0m \u001b[0mKeyError\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n","\u001b[1;31mValueError\u001b[0m: Key backend: Unrecognized backend string 'gtkagg': valid strings are ['GTK3Agg', 'GTK3Cairo', 'MacOSX', 'nbAgg', 'Qt4Agg', 'Qt4Cairo', 'Qt5Agg', 'Qt5Cairo', 'TkAgg', 'TkCairo', 'WebAgg', 'WX', 'WXAgg', 'WXCairo', 'agg', 'cairo', 'pdf', 'pgf', 'ps', 'svg', 'template']"]}],"metadata":{}},{"cell_type":"code","execution_count":null,"source":["\r\n","\r\n","import numpy as np\r\n","\r\n","import matplotlib.pyplot as plt\r\n","import mpl_toolkits.mplot3d.axes3d as p3\r\n","import matplotlib.animation as animation\r\n","from matplotlib.widgets import Slider\r\n","import cv2 \r\n","\r\n","import copy\r\n","from pathlib import Path\r\n","\r\n","#RICH CONSOLE STUFF\r\n","from rich import pretty\r\n","pretty.install() #makes all print statement output pretty\r\n","from rich import inspect\r\n","from rich.console import Console\r\n","console = Console() \r\n","from rich.traceback import install as rich_traceback_install\r\n","from rich.markdown import Markdown\r\n"],"outputs":[],"metadata":{}},{"cell_type":"code","execution_count":null,"source":["\r\n","openPose3dDataPath = Path(r\"C:\\Users\\jonma\\Dropbox\\FreeMoCapProject\\FreeMocap_Data\\sesh_2021-09-07_09_09_56\\DataArrays\\openPoseSkel_3d.npy\")\r\n","openPose3dReprojPath = Path(r\"C:\\Users\\jonma\\Dropbox\\FreeMoCapProject\\FreeMocap_Data\\sesh_2021-09-07_09_09_56\\DataArrays\\openPoseSkel_reprojErr.npy\")\r\n","\r\n","mediaPipe3dDataPath = Path(r\"C:\\Users\\jonma\\Dropbox\\FreeMoCapProject\\FreeMocap_Data\\sesh_2021-09-07_09_09_56\\DataArrays\\mediaPipeSkel_3d.npy\")\r\n","mediaPipe3dReprojPath = Path(r\"C:\\Users\\jonma\\Dropbox\\FreeMoCapProject\\FreeMocap_Data\\sesh_2021-09-07_09_09_56\\DataArrays\\mediaPipeSkel_reprojErr.npy\")\r\n","\r\n","openPose2dDataPath = Path(r\"C:\\Users\\jonma\\Dropbox\\FreeMoCapProject\\FreeMocap_Data\\sesh_2021-09-07_09_09_56\\DataArrays\\openPoseData_2d.npy\")\r\n","\r\n","mediaPipe2dDataPath = Path(r\"C:\\Users\\jonma\\Dropbox\\FreeMoCapProject\\FreeMocap_Data\\sesh_2021-09-07_09_09_56\\DataArrays\\mediaPipe_2d.npy\")\r\n"],"outputs":[],"metadata":{}},{"cell_type":"code","execution_count":null,"source":["mediaPipe_nCams_nFrames_nImgPts_XYC = np.load(mediaPipe2dDataPath)\r\n","\r\n","mp_rToe_conf = mediaPipe_nCams_nFrames_nImgPts_XYC[:,:,32,2].transpose()\r\n","mp_nose_conf = mediaPipe_nCams_nFrames_nImgPts_XYC[:,:,0,2].transpose()\r\n","mediaPipe_ReProjErr= np.load(mediaPipe3dReprojPath)\r\n","\r\n","mediaPipe_meanReproj_fr = np.nanmean(mediaPipe_ReProjErr,0)"],"outputs":[],"metadata":{}},{"cell_type":"code","execution_count":null,"source":["openPose_nCams_nFrames_nImgPts_XYC = np.load(openPose2dDataPath)\r\n","\r\n","openPose_rToe_conf = openPose_nCams_nFrames_nImgPts_XYC[:,:,32,2].transpose()\r\n","openPose_nose_conf = openPose_nCams_nFrames_nImgPts_XYC[:,:,0,2].transpose()\r\n","\r\n","openPose_ReProjErr= np.load(openPose3dReprojPath)\r\n","openPose_meanReproj_fr = np.nanmean(openPose_ReProjErr,0)\r\n"],"outputs":[],"metadata":{}},{"cell_type":"code","execution_count":null,"source":["\r\n","camLabels = [\"Cam#{}\".format(str(camNum)) for camNum in range(mediaPipe_nCams_nFrames_nImgPts_XYC.shape[0])]\r\n","\r\n","fig1 = plt.figure()\r\n","axToe = fig1.add_subplot(1,3,1)\r\n","\r\n","axToe.plot(mp_rToe_conf, label='rToe')\r\n","axToe.set_xlabel('Time (frames)')\r\n","axToe.set_ylabel('Nose Confidence')\r\n","axToe.legend()\r\n","\r\n","axNose = fig1.add_subplot(1,3,2)\r\n","\r\n","axNose.plot(mp_nose_conf, label='Nose')\r\n","axNose.set_xlabel('Time (frames)')\r\n","axNose.set_ylabel('Nose Confidence')\r\n","axNose.legend()\r\n","\r\n","axSkelReProj = fig1.add_subplot(1,3,3)\r\n","\r\n","axSkelReProj.plot(mediaPipe_meanReproj_fr, label='ReprojErr')\r\n","axSkelReProj.set_xlabel('Time (frames)')\r\n","axSkelReProj.set_ylabel('Mean ReprojErr')\r\n","axSkelReProj.legend()\r\n","\r\n","plt.show()\r\n","plt.pause(.1)\r\n"],"outputs":[],"metadata":{}},{"cell_type":"code","execution_count":null,"source":["\r\n","\r\n","fig2 = plt.figure()\r\n","axToe = fig2.add_subplot(1,3,1)\r\n","\r\n","axToe.plot(openPose_rToe_conf, label='rToe')\r\n","axToe.set_xlabel('Time (frames)')\r\n","axToe.set_ylabel('Nose Confidence')\r\n","axToe.legend()\r\n","\r\n","axNose = fig2.add_subplot(1,3,2)\r\n","\r\n","axNose.plot(openPose_nose_conf, label='Nose')\r\n","axNose.set_xlabel('Time (frames)')\r\n","axNose.set_ylabel('Nose Confidence')\r\n","axNose.legend()\r\n","\r\n","axSkelReProj = fig2.add_subplot(1,3,3)\r\n","\r\n","axSkelReProj.plot(openPose_meanReproj_fr, label='ReprojErr')\r\n","axSkelReProj.set_xlabel('Time (frames)')\r\n","axSkelReProj.set_ylabel('Mean ReprojErr')\r\n","axSkelReProj.legend()\r\n","\r\n","plt.show()\r\n","plt.pause(.1)\r\n"],"outputs":[],"metadata":{}},{"cell_type":"code","execution_count":null,"source":[],"outputs":[],"metadata":{}},{"cell_type":"code","execution_count":null,"source":[],"outputs":[],"metadata":{}}],"nbformat":4,"nbformat_minor":2,"metadata":{"language_info":{"codemirror_mode":{"name":"ipython","version":3},"file_extension":".py","mimetype":"text/x-python","name":"python","nbconvert_exporter":"python","pygments_lexer":"ipython3","version":"3.7.10"},"orig_nbformat":4,"kernelspec":{"name":"python3","display_name":"Python 3.7.10 64-bit ('freemocap-env': conda)"},"interpreter":{"hash":"14003e192b7068b5c6f3e01a75a7e2fbf9024b2608b3367651f2fa04e27b22a0"}}}\ No newline at end of filediff --git a/freemocap/analysis/skel_analisys.py b/freemocap/analysis/skel_analisys.pyindex a8f80401..a55bac7d 100644--- a/freemocap/analysis/skel_analisys.py+++ b/freemocap/analysis/skel_analisys.py@@ -1,4 +1,6 @@#%%+%matplotlib+import numpy as npimport matplotlib.pyplot as plt@@ -21,37 +23,53 @@ from rich.markdown import Markdown# %% load dlc data-openPose3dDataPath = Path(r"C:\Users\jonma\Dropbox\FreeMoCapProject\FreeMocap_Data\sesh_2021-08-27_17_31_30\DataArrays\openPoseSkel_3d.npy")+openPose3dDataPath = Path(r"C:\Users\jonma\Dropbox\FreeMoCapProject\FreeMocap_Data\sesh_2021-09-07_09_09_56\DataArrays\openPoseSkel_3d.npy")-mediaPipe3dDataPath = Path(r"C:\Users\jonma\Dropbox\FreeMoCapProject\FreeMocap_Data\sesh_2021-08-27_17_31_30\DataArrays\mediaPipeSkel_3d.npy")+mediaPipe3dDataPath = Path(r"C:\Users\jonma\Dropbox\FreeMoCapProject\FreeMocap_Data\sesh_2021-09-07_09_09_56\DataArrays\mediaPipeSkel_3d.npy")+mediaPipe3dReprojPath = Path(r"C:\Users\jonma\Dropbox\FreeMoCapProject\FreeMocap_Data\sesh_2021-09-07_09_09_56\DataArrays\mediaPipeSkel_reprojErr.npy")-openPose2dDataPath = Path(r"C:\Users\jonma\Dropbox\FreeMoCapProject\FreeMocap_Data\sesh_2021-08-27_17_31_30\DataArrays\openPoseData_2d.npy")+openPose2dDataPath = Path(r"C:\Users\jonma\Dropbox\FreeMoCapProject\FreeMocap_Data\sesh_2021-09-07_09_09_56\DataArrays\openPoseData_2d.npy")-mediaPipe2dDataPath = Path(r"C:\Users\jonma\Dropbox\FreeMoCapProject\FreeMocap_Data\sesh_2021-08-27_17_31_30\DataArrays\mediaPipe_2d.npy")+mediaPipe2dDataPath = Path(r"C:\Users\jonma\Dropbox\FreeMoCapProject\FreeMocap_Data\sesh_2021-09-07_09_09_56\DataArrays\mediaPipe_2d.npy")-#%%+#%% pull out 2d datamediaPipe_nCams_nFrames_nImgPts_XYC = np.load(mediaPipe2dDataPath)mp_rToe_conf = mediaPipe_nCams_nFrames_nImgPts_XYC[:,:,32,2].transpose()mp_nose_conf = mediaPipe_nCams_nFrames_nImgPts_XYC[:,:,0,2].transpose()+#%% pull out 3d reproj error++mediaPipe_ReProjErr= np.load(mediaPipe3dReprojPath)++mediaPipe_meanReproj_fr = np.nanmean(mediaPipe_ReProjErr,0)+# %% hand/ball vs time++camLabels = ["Cam#{}".format(str(camNum)) for camNum in range(mediaPipe_nCams_nFrames_nImgPts_XYC.shape[0])]+fig1 = plt.figure()-axToe = fig1.add_subplot(1,2,1)+axToe = fig1.add_subplot(1,3,1)-axToe.plot(mp_rToe_conf, label='Right Toe')+axToe.plot(mp_rToe_conf, label='rToe')axToe.set_xlabel('Time (frames)')-axToe.set_ylabel('Confidence')+axToe.set_ylabel('Nose Confidence')axToe.legend()-axNose = fig1.add_subplot(1,2,2)+axNose = fig1.add_subplot(1,3,2)axNose.plot(mp_nose_conf, label='Nose')axNose.set_xlabel('Time (frames)')-axNose.set_ylabel('Confidence')+axNose.set_ylabel('Nose Confidence')axNose.legend()+axSkelReProj = fig1.add_subplot(1,3,3)++axSkelReProj.plot(mediaPipe_meanReproj_fr, label='ReprojErr')+axSkelReProj.set_xlabel('Time (frames)')+axSkelReProj.set_ylabel('Mean ReprojErr')+axSkelReProj.legend()# %%diff --git a/freemocap/fmc_anipose.py b/freemocap/fmc_anipose.pyindex 481a2501..34734800 100644--- a/freemocap/fmc_anipose.py+++ b/freemocap/fmc_anipose.py@@ -1691,15 +1691,7 @@ class CameraGroup:if init_extrinsics:rtvecs = extract_rtvecs(merged)if verbose:- pprint(get_connections(rtvecs, self.get_names()))--- for camNum in range(rtvecs.shape[0]):- if np.sum(np.isnan(rtvecs[camNum,:,:])) == rtvecs[camNum,:,:].size:- rtvecsOG = rtvecs.copy() #for posterity- rtvecs = np.delete(rtvecs, 0,0)- print('REMOVING CAM# {} BECAUSE ANIPOSE HAD IT AS NaNs FOR SOME UNKNOWN REASON'.format(camNum))-+ pprint(get_connections(rtvecs, self.get_names()))rvecs, tvecs = get_initial_extrinsics(rtvecs)self.set_rotations(rvecs)self.set_translations(tvecs)diff --git a/freemocap/fmc_mediapipe.py b/freemocap/fmc_mediapipe.pyindex 8df6fc37..6ef08446 100644--- a/freemocap/fmc_mediapipe.py+++ b/freemocap/fmc_mediapipe.py@@ -98,7 +98,7 @@ def runMediaPipe(session, dummyRun=False):results) # Append data to mediapipe data list- saveImages = True+ saveImages = Falseif saveImages:# Draw pose, left and right hands, and face landmarks on the image.annotated_image = image.copy()diff --git a/freemocap/play_skeleton_animation.py b/freemocap/play_skeleton_animation.pyindex 9f97ab5f..4e9a9f51 100644--- a/freemocap/play_skeleton_animation.py+++ b/freemocap/play_skeleton_animation.py@@ -863,13 +863,18 @@ def formatOpenPoseStickIndices():dict_of_openPoseSegmentIdx_dicts['op_body'] = openPoseBodySegmentIds+ #make colors dictionary+ openPoseBodyColor = np.array([50, 89, 0])/255+ openPoseRightColor = np.array([230, 50, 0])/255+ openPoseLeftColor = np.array([0, 50, 230])/255+dict_of_op_skel_lineColor = dict()- dict_of_op_skel_lineColor['op_head'] = np.append(humon_dark, 0.5)- dict_of_op_skel_lineColor['op_spine'] = np.append(humon_dark, 1)- dict_of_op_skel_lineColor['op_rArm'] = np.append(humon_red, 1)- dict_of_op_skel_lineColor['op_lArm'] = np.append(humon_blue, 1)- dict_of_op_skel_lineColor['op_rLeg'] = np.append(humon_red, 1)- dict_of_op_skel_lineColor['op_lLeg'] = np.append(humon_blue, 1)+ dict_of_op_skel_lineColor['op_head'] = np.append(openPoseBodyColor, 0.5)+ dict_of_op_skel_lineColor['op_spine'] = np.append(openPoseBodyColor, 1)+ dict_of_op_skel_lineColor['op_rArm'] = np.append(openPoseRightColor, 1)+ dict_of_op_skel_lineColor['op_lArm'] = np.append(openPoseLeftColor, 1)+ dict_of_op_skel_lineColor['op_rLeg'] = np.append(openPoseRightColor, 1)+ dict_of_op_skel_lineColor['op_lLeg'] = np.append(openPoseLeftColor, 1)# Make some handy maps ;D@@ -946,15 +951,18 @@ def formatMediaPipeStickIndices():mediaPipeBodySegmentIds['mp_lLeg'] = [23, 25, 27, 29, 31, 27, ]dict_of_mediaPipeSegmentIdx_dicts['mp_body'] = mediaPipeBodySegmentIds-+ #make colors dictionary+ mediaPipeBodyColor = np.array([125,106,0])/255+ mediaPipeRightColor = np.array([230, 0, 169])/255+ mediaPipeLeftColor = np.array([0, 176, 176])/255dict_of_mp_skel_lineColor = dict()- greenshift = [0, .2, 0]- dict_of_mp_skel_lineColor['mp_head'] = np.append(humon_dark+greenshift, 1)- dict_of_mp_skel_lineColor['mp_tors'] = np.append(humon_dark+greenshift, 1)- dict_of_mp_skel_lineColor['mp_rArm'] = np.append(humon_red+greenshift, 1)- dict_of_mp_skel_lineColor['mp_lArm'] = np.append([humon_blue+greenshift], 1)- dict_of_mp_skel_lineColor['mp_rLeg'] = np.append(humon_red+greenshift, 1)- dict_of_mp_skel_lineColor['mp_lLeg'] = np.append(humon_blue+greenshift, 1)++ dict_of_mp_skel_lineColor['mp_head'] = np.append(mediaPipeBodyColor, .5)+ dict_of_mp_skel_lineColor['mp_tors'] = np.append(mediaPipeBodyColor, 1)+ dict_of_mp_skel_lineColor['mp_rArm'] = np.append(mediaPipeRightColor, 1)+ dict_of_mp_skel_lineColor['mp_lArm'] = np.append(mediaPipeLeftColor, 1)+ dict_of_mp_skel_lineColor['mp_rLeg'] = np.append(mediaPipeRightColor, 1)+ dict_of_mp_skel_lineColor['mp_lLeg'] = np.append(mediaPipeLeftColor, 1)# Make some handy maps ;Ddiff --git a/freemocap/setup.py b/freemocap/setup.pynew file mode 100644index 00000000..d58b4acb--- /dev/null+++ b/freemocap/setup.py@@ -0,0 +1,72 @@+from os import path+from setuptools import setup, find_packages+import sys+import versioneer+++# NOTE: This file must remain Python 2 compatible for the foreseeable future,+# to ensure that we error out properly for people with outdated setuptools+# and/or pip.+min_version = (3, 7)+if sys.version_info < min_version:+ error = """+freemocap does not support Python {0}.{1}.+Python {2}.{3} and above is required. Check your Python version like so:++python3 --version++This may be due to an out-of-date pip. Make sure you have pip >= 9.0.1.+Upgrade pip like so:++pip install --upgrade pip+""".format(+ *(sys.version_info[:2] + min_version)+ )+ sys.exit(error)++here = path.abspath(path.dirname(__file__))++with open(path.join(here, "README.rst"), encoding="utf-8") as readme_file:+ readme = readme_file.read()++with open(path.join(here, "requirements.txt")) as requirements_file:+ # Parse requirements.txt, ignoring any commented-out lines.+ requirements = [+ line+ for line in requirements_file.read().splitlines()+ if not line.startswith("#")+ ]+++setup(+ name="freemocap",+ version=versioneer.get_version(),+ cmdclass=versioneer.get_cmdclass(),+ description="The FreeMoCap Project: A free-and-open-source, hardware-and-software-agnostic, research-grade, minimal-cost motion capture system and platform for decentralized scientific research, education, and training",+ long_description=readme,+ author="Jonathan Samir Matthis",+ author_email="[email protected]",+ url="https://github.com/jonmatthis/freemocap",+ python_requires=">={}".format(".".join(str(n) for n in min_version)),+ packages=find_packages(exclude=["docs", "tests"]),+ entry_points={+ "console_scripts": [+ # 'command = some.module:some_function',+ ],+ },+ include_package_data=True,+ package_data={+ "freemocap": [+ # When adding files here, remember to update MANIFEST.in as well,+ # or else they will not be included in the distribution on PyPI!+ # 'path/to/data_file',+ ]+ },+ install_requires=requirements,+ license="AGPLv3",+ classifiers=[+ "Development Status :: 2 - Pre-Alpha",+ "Natural Language :: English",+ "Programming Language :: Python :: 3",+ ],+)diff --git a/freemocap/user_preferences.yaml b/freemocap/user_preferences.yamlindex 3f21f371..0b348102 100644--- a/freemocap/user_preferences.yaml+++ b/freemocap/user_preferences.yaml@@ -12,11 +12,13 @@ saved:path_to_save: C:/Users/jonma/Dropbox/FreeMoCapProjectrotations:0: 0+ 1: 02: 03: 0+ 4: 0parameters:exposure: -7- resWidth: 960- resHeight: 720+ resWidth: 640+ resHeight: 480framerate: 30codec: DIVXdiff --git a/freemocap_runme_script.py b/freemocap_runme_script.pyindex 166fe369..ec3deb8d 100644--- a/freemocap_runme_script.py+++ b/freemocap_runme_script.py@@ -3,16 +3,16 @@ import freemocap as fmcfrom pathlib import Pathimport sys-fmc.RunMe(- sessionID = 'sesh_2021-08-29_15_26_34',- stage = 4,+ # sessionID = 'sesh_2021-08-29_17_55_45',+ sessionID=None,+ stage = 5,useOpenPose=True,runOpenPose=True,- useMediaPipe=True,+ useMediaPipe=False,runMediaPipe = True,useDLC=False,- recordVid = True,- reconstructionConfidenceThreshold = 0.5,- calVideoFrameLength = -1,+ recordVid = True ,+ reconstructionConfidenceThreshold = 0.0,+ calVideoFrameLength = 60,)