├── .gitignore ├── COLAB_Primer_MotionCapture_Fig3.ipynb ├── CorruptionFigure.py ├── Illustrating-Augmentations-FigurePipelineMontBlancBirds.py ├── Illustrating-Augmentations-FigurePipelineMouse.py ├── LICENSE ├── Primer_AugmentationComparison-Figures.py ├── Primer_RobustnessEvaluation-Figures.py ├── README.md ├── ResultsComparison ├── DLC_resnet50_openfieldOct30shuffle1_100000-results.csv ├── DLC_resnet50_openfieldOct30shuffle2_100000-results.csv ├── DLC_resnet50_openfieldOct30shuffle3_100000-results.csv ├── ErrorCurves.png ├── Errors_shuffle1.h5 ├── Errors_shuffle2.h5 ├── Errors_shuffle3.h5 ├── ErrorsafterAugmentation_shuffle1.h5 ├── ErrorsafterAugmentation_shuffle2.h5 ├── ErrorsafterAugmentation_shuffle3.h5 ├── ErrorsafterAugmentationpcutoff_shuffle1.h5 ├── ErrorsafterAugmentationpcutoff_shuffle2.h5 ├── ErrorsafterAugmentationpcutoff_shuffle3.h5 ├── Errorspcutoff_shuffle1.h5 ├── Errorspcutoff_shuffle2.h5 ├── Errorspcutoff_shuffle3.h5 ├── LearningCurves.png ├── PCKresults.png ├── PCKresultsafterAugmentation.png ├── Stickfigures.png ├── Stickfiguresfirst500.png ├── learning_stats_shuffle1.csv ├── learning_stats_shuffle2.csv ├── learning_stats_shuffle3.csv ├── m3v1mp4.mp4 ├── m3v1mp4DLC_resnet50_openfieldOct30shuffle1_100000.h5 ├── m3v1mp4DLC_resnet50_openfieldOct30shuffle2_100000.h5 └── m3v1mp4DLC_resnet50_openfieldOct30shuffle3_100000.h5 ├── ResultsComparisonFrames ├── frame0115imgaugstartframe.png ├── frame0115imgaugstopframe.png ├── frame0115scalecropstartframe.png ├── frame0115scalecropstopframe.png ├── frame0115tensorpackstartframe.png └── frame0115tensorpackstopframe.png ├── ResultsCorruption ├── LabelingCorruptionimpact_10Percent.png ├── LabelingCorruptionimpact_20Percent.png ├── LabelingCorruptionimpact_50Percent.png ├── LabelingCorruptionimpact_5Percent.png ├── LabelingCorruptionimpact_80Percent.png ├── LabelingCorruptionimpact_90Percent.png └── data_corruption_experiments.pickle ├── augmentationexamples ├── montblanc_images_img0071_joint.jpg ├── montblanc_images_img0071_joint.png ├── montblanc_images_img0155_joint.jpg ├── montblanc_images_img0293_joint.jpg ├── montblanc_images_img0293_joint.png ├── montblanc_images_img0382_joint.jpg ├── montblanc_images_img0719_joint.jpg ├── montblanc_images_img1164_joint.jpg ├── mouse_m7s3_img0019_joint.jpg ├── mouse_m7s3_img0019_joint.png ├── mouse_m7s3_img0039_joint.jpg └── mouse_m7s3_img0039_joint.png ├── montblanc_images ├── CollectedData_Daniel.h5 ├── img0071.png ├── img0155.png ├── img0293.png ├── img0382.png ├── img0719.png └── img1164.png └── mouse_m7s3 ├── CollectedData_Pranav.h5 ├── img0019.png └── img0039.png /.gitignore: -------------------------------------------------------------------------------- 1 | # Byte-compiled / optimized / DLL files 2 | __pycache__/ 3 | *.py[cod] 4 | *$py.class 5 | 6 | 7 | # C extensions 8 | *.so 9 | 10 | # Distribution / packaging 11 | .Python 12 | build/ 13 | develop-eggs/ 14 | dist/ 15 | downloads/ 16 | eggs/ 17 | .eggs/ 18 | lib/ 19 | lib64/ 20 | parts/ 21 | sdist/ 22 | var/ 23 | wheels/ 24 | pip-wheel-metadata/ 25 | share/python-wheels/ 26 | *.egg-info/ 27 | .installed.cfg 28 | *.egg 29 | MANIFEST 30 | 31 | # PyInstaller 32 | # Usually these files are written by a python script from a template 33 | # before PyInstaller builds the exe, so as to inject date/other infos into it. 34 | *.manifest 35 | *.spec 36 | 37 | # Installer logs 38 | pip-log.txt 39 | pip-delete-this-directory.txt 40 | 41 | # Unit test / coverage reports 42 | htmlcov/ 43 | .tox/ 44 | .nox/ 45 | .coverage 46 | .coverage.* 47 | .cache 48 | nosetests.xml 49 | coverage.xml 50 | *.cover 51 | *.py,cover 52 | .hypothesis/ 53 | .pytest_cache/ 54 | 55 | # Translations 56 | *.mo 57 | *.pot 58 | 59 | # Django stuff: 60 | *.log 61 | local_settings.py 62 | db.sqlite3 63 | db.sqlite3-journal 64 | 65 | # Flask stuff: 66 | instance/ 67 | .webassets-cache 68 | 69 | # Scrapy stuff: 70 | .scrapy 71 | 72 | # Sphinx documentation 73 | docs/_build/ 74 | 75 | # PyBuilder 76 | target/ 77 | 78 | # Jupyter Notebook 79 | .ipynb_checkpoints 80 | 81 | # IPython 82 | profile_default/ 83 | ipython_config.py 84 | 85 | # pyenv 86 | .python-version 87 | 88 | # pipenv 89 | # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control. 90 | # However, in case of collaboration, if having platform-specific dependencies or dependencies 91 | # having no cross-platform support, pipenv may install dependencies that don't work, or not 92 | # install all needed dependencies. 93 | #Pipfile.lock 94 | 95 | # PEP 582; used by e.g. github.com/David-OConnor/pyflow 96 | __pypackages__/ 97 | 98 | # Celery stuff 99 | celerybeat-schedule 100 | celerybeat.pid 101 | 102 | # SageMath parsed files 103 | *.sage.py 104 | 105 | # Environments 106 | .env 107 | .venv 108 | env/ 109 | venv/ 110 | ENV/ 111 | env.bak/ 112 | venv.bak/ 113 | 114 | # IDE project settings 115 | .spyderproject 116 | .spyproject 117 | *.vscode 118 | 119 | # Rope project settings 120 | .ropeproject 121 | 122 | # mkdocs documentation 123 | /site 124 | 125 | # mypy 126 | .mypy_cache/ 127 | .dmypy.json 128 | dmypy.json 129 | 130 | # Pyre type checker 131 | .pyre/ 132 | -------------------------------------------------------------------------------- /COLAB_Primer_MotionCapture_Fig3.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "nbformat": 4, 3 | "nbformat_minor": 0, 4 | "metadata": { 5 | "colab": { 6 | "name": "Primer-MotionCapture_fig3.ipynb", 7 | "provenance": [], 8 | "collapsed_sections": [], 9 | "toc_visible": true, 10 | "include_colab_link": true 11 | }, 12 | "kernelspec": { 13 | "name": "python3", 14 | "display_name": "Python 3" 15 | } 16 | }, 17 | "cells": [ 18 | { 19 | "cell_type": "markdown", 20 | "metadata": { 21 | "id": "view-in-github", 22 | "colab_type": "text" 23 | }, 24 | "source": [ 25 | "\"Open" 26 | ] 27 | }, 28 | { 29 | "cell_type": "markdown", 30 | "metadata": { 31 | "id": "RK255E7YoEIt", 32 | "colab_type": "text" 33 | }, 34 | "source": [ 35 | "# Motion Capture with Deep Learning: \n", 36 | "A Primer on Motion Capture with Deep Learning: Principles, Pitfalls and Perspectives\n", 37 | "\n", 38 | "[Alexander Mathis](https://github.com/AlexEMG) | [Steffen Schneider](https://github.com/stes) | [Jessy Lauer](https://github.com/jeylau) | [Mackenzie Mathis](https://github.com/MMathisLab)\n", 39 | "\n", 40 | "\n", 41 | "- https://github.com/DeepLabCut/Primer-MotionCapture\n", 42 | "\n", 43 | "- How you can use data augmentation to train neural networks:\n", 44 | "![alt text](https://images.squarespace-cdn.com/content/v1/57f6d51c9f74566f55ecf271/1593721822684-DJJIOEEC4YHRO2ZRW6Z3/ke17ZwdGBToddI8pDm48kMqyqP2xgoLMxs8NG4McAT9Zw-zPPgdn4jUwVcJE1ZvWQUxwkmyExglNqGp0IvTJZamWLI2zvYWH8K3-s_4yszcp2ryTI0HqTOaaUohrI8PIT5G0e3JcWjRHcSN0vw_Zk3UAC_JV7w-s1xTX3wfPLu0/augs.png?format=1000w)\n", 45 | "\n", 46 | "This script uses Imgaug to display various augmentation methods \n", 47 | "for a few labeled images of birds (Data recorded with Alex' iphone \n", 48 | "at Aiguille du Midi near Mont Blanc)\n", 49 | "\n", 50 | "Uses Imgaug:\n", 51 | "Code: https://github.com/aleju/imgaug\n", 52 | "Docs: https://imgaug.readthedocs.io/en/latest/index.html\n", 53 | "\n", 54 | "\n" 55 | ] 56 | }, 57 | { 58 | "cell_type": "markdown", 59 | "metadata": { 60 | "id": "txoddlM8hLKm", 61 | "colab_type": "text" 62 | }, 63 | "source": [ 64 | "Please click on the \"play' button to run the code in each cell.\n" 65 | ] 66 | }, 67 | { 68 | "cell_type": "code", 69 | "metadata": { 70 | "id": "q23BzhA6CXxu", 71 | "colab_type": "code", 72 | "colab": {} 73 | }, 74 | "source": [ 75 | "#(this will take a few minutes to install all the dependences!)\n", 76 | "!pip install deeplabcut\n", 77 | "%reload_ext numpy\n", 78 | "%reload_ext scipy\n", 79 | "%reload_ext matplotlib\n", 80 | "%reload_ext mpl_toolkits" 81 | ], 82 | "execution_count": null, 83 | "outputs": [] 84 | }, 85 | { 86 | "cell_type": "markdown", 87 | "metadata": { 88 | "id": "5WGHc0IiYkoL", 89 | "colab_type": "text" 90 | }, 91 | "source": [ 92 | "Import the dependencies:" 93 | ] 94 | }, 95 | { 96 | "cell_type": "code", 97 | "metadata": { 98 | "id": "Y36K4Eux3h-X", 99 | "colab_type": "code", 100 | "colab": { 101 | "base_uri": "https://localhost:8080/", 102 | "height": 241 103 | }, 104 | "outputId": "3088b6c0-ebf3-46e2-fa39-513a8470b3f2" 105 | }, 106 | "source": [ 107 | "# Use TensorFlow 1.x:\n", 108 | "%tensorflow_version 1.x\n", 109 | "import os\n", 110 | "os.environ[\"DLClight\"]=\"True\"\n", 111 | "import deeplabcut\n", 112 | "import tensorflow as tf\n", 113 | "vers = (tf.__version__).split(\".\")\n", 114 | "if int(vers[0]) == 1 and int(vers[1]) > 12:\n", 115 | " TF = tf.compat.v1 # behaves differently before 1.13\n", 116 | "else:\n", 117 | " TF = tf\n", 118 | "\n", 119 | "TF.logging.set_verbosity(TF.logging.ERROR)\n", 120 | "DEBUG = True and \"DEBUG\" in os.environ and os.environ[\"DEBUG\"]\n", 121 | "from deeplabcut import DEBUG\n", 122 | "\n", 123 | "import pandas as pd\n", 124 | "import os\n", 125 | "import numpy as np\n", 126 | "\n", 127 | "import imgaug as ia\n", 128 | "import imgaug.augmenters as iaa\n", 129 | "from imgaug.augmentables import Keypoint, KeypointsOnImage\n", 130 | "from deeplabcut.utils.auxfun_videos import imread, imresize\n", 131 | "import imageio " 132 | ], 133 | "execution_count": null, 134 | "outputs": [ 135 | { 136 | "output_type": "stream", 137 | "text": [ 138 | "TensorFlow 1.x selected.\n", 139 | "DLC loaded in light mode; you cannot use any GUI (labeling, relabeling and standalone GUI)\n", 140 | "WARNING:tensorflow:\n", 141 | "The TensorFlow contrib module will not be included in TensorFlow 2.0.\n", 142 | "For more information, please see:\n", 143 | " * https://github.com/tensorflow/community/blob/master/rfcs/20180907-contrib-sunset.md\n", 144 | " * https://github.com/tensorflow/addons\n", 145 | " * https://github.com/tensorflow/io (for I/O related ops)\n", 146 | "If you depend on functionality not listed there, please file an issue.\n", 147 | "\n" 148 | ], 149 | "name": "stdout" 150 | }, 151 | { 152 | "output_type": "stream", 153 | "text": [ 154 | "/usr/local/lib/python3.6/dist-packages/statsmodels/tools/_testing.py:19: FutureWarning: pandas.util.testing is deprecated. Use the functions in the public API at pandas.testing instead.\n", 155 | " import pandas.util.testing as tm\n" 156 | ], 157 | "name": "stderr" 158 | } 159 | ] 160 | }, 161 | { 162 | "cell_type": "markdown", 163 | "metadata": { 164 | "id": "RGRsUQL2aPeI", 165 | "colab_type": "text" 166 | }, 167 | "source": [ 168 | "Let's grab some demo data!" 169 | ] 170 | }, 171 | { 172 | "cell_type": "code", 173 | "metadata": { 174 | "id": "KS4Q4UkR9rgG", 175 | "colab_type": "code", 176 | "colab": {} 177 | }, 178 | "source": [ 179 | "# Clone the Primer repo so we can use the demo data:\n", 180 | "!git clone -l -s git://github.com/DeepLabCut/Primer-MotionCapture.git cloned-DLC-Primer\n", 181 | "\n", 182 | "%cd cloned-DLC-Primer\n", 183 | "!ls" 184 | ], 185 | "execution_count": null, 186 | "outputs": [] 187 | }, 188 | { 189 | "cell_type": "markdown", 190 | "metadata": { 191 | "id": "8LNx3z_ybv7P", 192 | "colab_type": "text" 193 | }, 194 | "source": [ 195 | "Setting up some variables:" 196 | ] 197 | }, 198 | { 199 | "cell_type": "code", 200 | "metadata": { 201 | "id": "bfSPyAx9bwEy", 202 | "colab_type": "code", 203 | "colab": {} 204 | }, 205 | "source": [ 206 | "scale=.2\n", 207 | "ia.seed(1)\n", 208 | "#parameters for plotting:\n", 209 | "color=(400,0,0)\n", 210 | "size=7\n", 211 | "alpha=.01" 212 | ], 213 | "execution_count": null, 214 | "outputs": [] 215 | }, 216 | { 217 | "cell_type": "markdown", 218 | "metadata": { 219 | "id": "Frnj1RVDyEqs", 220 | "colab_type": "text" 221 | }, 222 | "source": [ 223 | "\n", 224 | "## Loading data:\n", 225 | "\n" 226 | ] 227 | }, 228 | { 229 | "cell_type": "code", 230 | "metadata": { 231 | "id": "vhENAlQnFENJ", 232 | "colab_type": "code", 233 | "colab": { 234 | "base_uri": "https://localhost:8080/", 235 | "height": 317 236 | }, 237 | "outputId": "cfd18a5f-7809-4b20-8290-60af7dddbaff" 238 | }, 239 | "source": [ 240 | "imfolder='montblanc_images'\n", 241 | "Dataframe = pd.read_hdf(os.path.join(imfolder,\"CollectedData_Daniel.h5\"))\n", 242 | "\n", 243 | "scorer=Dataframe.columns.get_level_values(0)[0]\n", 244 | "individuals=Dataframe.columns.get_level_values(1)\n", 245 | "bodyparts=Dataframe.columns.get_level_values(2)\n", 246 | "Dataframe.head()" 247 | ], 248 | "execution_count": null, 249 | "outputs": [ 250 | { 251 | "output_type": "execute_result", 252 | "data": { 253 | "text/html": [ 254 | "
\n", 255 | "\n", 268 | "\n", 269 | " \n", 270 | " \n", 271 | " \n", 272 | " \n", 273 | " \n", 274 | " \n", 275 | " \n", 276 | " \n", 277 | " \n", 278 | " \n", 279 | " \n", 280 | " \n", 281 | " \n", 282 | " \n", 283 | " \n", 284 | " \n", 285 | " \n", 286 | " \n", 287 | " \n", 288 | " \n", 289 | " \n", 290 | " \n", 291 | " \n", 292 | " \n", 293 | " \n", 294 | " \n", 295 | " \n", 296 | " \n", 297 | " \n", 298 | " \n", 299 | " \n", 300 | " \n", 301 | " \n", 302 | " \n", 303 | " \n", 304 | " \n", 305 | " \n", 306 | " \n", 307 | " \n", 308 | " \n", 309 | " \n", 310 | " \n", 311 | " \n", 312 | " \n", 313 | " \n", 314 | " \n", 315 | " \n", 316 | " \n", 317 | " \n", 318 | " \n", 319 | " \n", 320 | " \n", 321 | " \n", 322 | " \n", 323 | " \n", 324 | " \n", 325 | " \n", 326 | " \n", 327 | " \n", 328 | " \n", 329 | " \n", 330 | " \n", 331 | " \n", 332 | " \n", 333 | " \n", 334 | " \n", 335 | " \n", 336 | " \n", 337 | " \n", 338 | " \n", 339 | " \n", 340 | " \n", 341 | " \n", 342 | " \n", 343 | " \n", 344 | " \n", 345 | " \n", 346 | " \n", 347 | " \n", 348 | " \n", 349 | " \n", 350 | " \n", 351 | " \n", 352 | " \n", 353 | " \n", 354 | " \n", 355 | " \n", 356 | " \n", 357 | " \n", 358 | " \n", 359 | " \n", 360 | " \n", 361 | " \n", 362 | " \n", 363 | " \n", 364 | " \n", 365 | " \n", 366 | " \n", 367 | " \n", 368 | " \n", 369 | " \n", 370 | " \n", 371 | " \n", 372 | " \n", 373 | " \n", 374 | " \n", 375 | " \n", 376 | " \n", 377 | " \n", 378 | " \n", 379 | " \n", 380 | " \n", 381 | " \n", 382 | " \n", 383 | " \n", 384 | " \n", 385 | " \n", 386 | " \n", 387 | " \n", 388 | " \n", 389 | " \n", 390 | " \n", 391 | " \n", 392 | " \n", 393 | " \n", 394 | " \n", 395 | " \n", 396 | " \n", 397 | " \n", 398 | " \n", 399 | " \n", 400 | " \n", 401 | " \n", 402 | " \n", 403 | " \n", 404 | " \n", 405 | " \n", 406 | " \n", 407 | " \n", 408 | " \n", 409 | " \n", 410 | " \n", 411 | " \n", 412 | " \n", 413 | " \n", 414 | " \n", 415 | " \n", 416 | " \n", 417 | " \n", 418 | " \n", 419 | " \n", 420 | " \n", 421 | " \n", 422 | " \n", 423 | " \n", 424 | " \n", 425 | " \n", 426 | " \n", 427 | " \n", 428 | " \n", 429 | " \n", 430 | " \n", 431 | " \n", 432 | " \n", 433 | " \n", 434 | " \n", 435 | " \n", 436 | " \n", 437 | " \n", 438 | " \n", 439 | " \n", 440 | " \n", 441 | " \n", 442 | " \n", 443 | " \n", 444 | " \n", 445 | " \n", 446 | " \n", 447 | " \n", 448 | " \n", 449 | " \n", 450 | " \n", 451 | " \n", 452 | " \n", 453 | " \n", 454 | " \n", 455 | " \n", 456 | " \n", 457 | " \n", 458 | " \n", 459 | " \n", 460 | " \n", 461 | " \n", 462 | " \n", 463 | " \n", 464 | " \n", 465 | " \n", 466 | " \n", 467 | " \n", 468 | " \n", 469 | " \n", 470 | " \n", 471 | " \n", 472 | " \n", 473 | " \n", 474 | " \n", 475 | " \n", 476 | " \n", 477 | " \n", 478 | " \n", 479 | " \n", 480 | " \n", 481 | " \n", 482 | " \n", 483 | " \n", 484 | " \n", 485 | " \n", 486 | " \n", 487 | " \n", 488 | " \n", 489 | " \n", 490 | " \n", 491 | " \n", 492 | " \n", 493 | " \n", 494 | " \n", 495 | " \n", 496 | " \n", 497 | " \n", 498 | " \n", 499 | " \n", 500 | " \n", 501 | " \n", 502 | " \n", 503 | " \n", 504 | " \n", 505 | " \n", 506 | " \n", 507 | " \n", 508 | " \n", 509 | " \n", 510 | " \n", 511 | " \n", 512 | " \n", 513 | " \n", 514 | " \n", 515 | " \n", 516 | " \n", 517 | " \n", 518 | " \n", 519 | " \n", 520 | " \n", 521 | " \n", 522 | " \n", 523 | " \n", 524 | " \n", 525 | " \n", 526 | " \n", 527 | " \n", 528 | " \n", 529 | " \n", 530 | " \n", 531 | " \n", 532 | " \n", 533 | " \n", 534 | " \n", 535 | " \n", 536 | " \n", 537 | " \n", 538 | " \n", 539 | " \n", 540 | " \n", 541 | " \n", 542 | " \n", 543 | " \n", 544 | " \n", 545 | " \n", 546 | " \n", 547 | " \n", 548 | " \n", 549 | " \n", 550 | " \n", 551 | " \n", 552 | " \n", 553 | " \n", 554 | " \n", 555 | " \n", 556 | " \n", 557 | " \n", 558 | " \n", 559 | " \n", 560 | " \n", 561 | " \n", 562 | " \n", 563 | " \n", 564 | " \n", 565 | " \n", 566 | " \n", 567 | " \n", 568 | " \n", 569 | " \n", 570 | " \n", 571 | " \n", 572 | " \n", 573 | " \n", 574 | " \n", 575 | " \n", 576 | " \n", 577 | " \n", 578 | " \n", 579 | " \n", 580 | " \n", 581 | " \n", 582 | " \n", 583 | " \n", 584 | " \n", 585 | " \n", 586 | " \n", 587 | " \n", 588 | " \n", 589 | " \n", 590 | " \n", 591 | " \n", 592 | " \n", 593 | " \n", 594 | " \n", 595 | " \n", 596 | " \n", 597 | " \n", 598 | " \n", 599 | " \n", 600 | " \n", 601 | " \n", 602 | " \n", 603 | " \n", 604 | " \n", 605 | " \n", 606 | " \n", 607 | " \n", 608 | " \n", 609 | " \n", 610 | " \n", 611 | " \n", 612 | " \n", 613 | " \n", 614 | " \n", 615 | " \n", 616 | " \n", 617 | " \n", 618 | " \n", 619 | " \n", 620 | " \n", 621 | " \n", 622 | " \n", 623 | " \n", 624 | " \n", 625 | " \n", 626 | " \n", 627 | " \n", 628 | " \n", 629 | " \n", 630 | " \n", 631 | " \n", 632 | " \n", 633 | " \n", 634 | " \n", 635 | " \n", 636 | " \n", 637 | " \n", 638 | " \n", 639 | " \n", 640 | " \n", 641 | " \n", 642 | " \n", 643 | " \n", 644 | " \n", 645 | " \n", 646 | " \n", 647 | " \n", 648 | " \n", 649 | " \n", 650 | " \n", 651 | " \n", 652 | " \n", 653 | " \n", 654 | " \n", 655 | " \n", 656 | " \n", 657 | " \n", 658 | " \n", 659 | " \n", 660 | " \n", 661 | " \n", 662 | " \n", 663 | " \n", 664 | " \n", 665 | " \n", 666 | " \n", 667 | " \n", 668 | " \n", 669 | " \n", 670 | " \n", 671 | " \n", 672 | " \n", 673 | " \n", 674 | " \n", 675 | " \n", 676 | " \n", 677 | " \n", 678 | " \n", 679 | " \n", 680 | " \n", 681 | " \n", 682 | " \n", 683 | " \n", 684 | " \n", 685 | " \n", 686 | " \n", 687 | " \n", 688 | " \n", 689 | " \n", 690 | " \n", 691 | " \n", 692 | " \n", 693 | " \n", 694 | " \n", 695 | " \n", 696 | " \n", 697 | " \n", 698 | " \n", 699 | " \n", 700 | " \n", 701 | " \n", 702 | " \n", 703 | " \n", 704 | " \n", 705 | " \n", 706 | " \n", 707 | " \n", 708 | " \n", 709 | " \n", 710 | " \n", 711 | " \n", 712 | " \n", 713 | " \n", 714 | " \n", 715 | " \n", 716 | " \n", 717 | " \n", 718 | " \n", 719 | " \n", 720 | " \n", 721 | " \n", 722 | " \n", 723 | " \n", 724 | " \n", 725 | "
scorerDaniel
individualsbird1bird2bird3bird4bird5bird6bird7bird8
bodypartsheadtailleftwingrightwingheadtailleftwingrightwingheadtailleftwingrightwingheadtailleftwingrightwingheadtailleftwingrightwingheadtailleftwingrightwingheadtailleftwingrightwingheadtailleftwingrightwing
coordsxyxyxyxyxyxyxyxyxyxyxyxyxyxyxyxyxyxyxyxyxyxyxyxyxyxyxyxyxyxyxyxy
img0155.png76.8443181068.72238991.8852941073.29613683.1786981068.89049285.3404051066.281536NaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaN633.723407265.969784664.802644278.419669650.006421262.713181646.421219282.682029687.180030254.177500701.044000257.237000692.507979265.632591692.507979252.579116NaNNaNNaNNaNNaNNaNNaNNaN270.767000441.059000291.042197445.404245279.605967445.585773265.960000439.351000NaNNaNNaNNaNNaNNaNNaNNaN
img0719.png527.883814798.424352527.883814819.592270555.564938813.079065493.689484798.424352866.570511166.643397848.659196235.032057921.932760207.350933785.155440173.156603NaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaN
img0382.png1002.648118448.0814091016.503454441.475958974.937444439.0593291035.192048444.5370211345.764721430.3550341373.472296425.9586291323.271486432.6043571373.370054420.3353201208.005774423.8750681223.472197412.9196851183.839489422.4250911241.516356416.302965NaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaN465.149323910.426436472.586078922.821027462.895761920.680143473.149468915.609629NaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaN
img1164.pngNaNNaNNaNNaNNaNNaNNaNNaN967.102545772.4981311052.904833829.5883691030.202282825.915898963.430073818.570955NaNNaNNaNNaNNaNNaNNaNNaN1481.748136780.1828611551.512575873.4052111476.569117831.9730551520.438458812.780218NaNNaNNaNNaNNaNNaNNaNNaN1281.219881586.1520061281.703207597.9129311277.353275595.0129771283.314293593.563000NaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaN
img0071.png322.057817350.433043338.709137352.916134337.832751346.343245318.990469357.298061704.509962368.336837713.463880373.814528717.361468368.336837695.872064375.605312792.096812335.109416801.484484339.477937808.734370332.692788781.500825342.545197NaNNaNNaNNaNNaNNaNNaNNaN476.196105851.187857497.623544859.565502480.626590860.934925485.057076855.3766791636.168946717.0761361656.772253724.6110601643.821603722.9627951645.587601716.605203338.311787886.759027350.230626894.471217343.419861891.766942336.709254893.469634NaNNaNNaNNaNNaNNaNNaNNaN
\n", 726 | "
" 727 | ], 728 | "text/plain": [ 729 | "scorer Daniel ... \n", 730 | "individuals bird1 ... bird8 \n", 731 | "bodyparts head tail ... leftwing rightwing \n", 732 | "coords x y x ... y x y\n", 733 | "img0155.png 76.844318 1068.722389 91.885294 ... NaN NaN NaN\n", 734 | "img0719.png 527.883814 798.424352 527.883814 ... NaN NaN NaN\n", 735 | "img0382.png 1002.648118 448.081409 1016.503454 ... NaN NaN NaN\n", 736 | "img1164.png NaN NaN NaN ... NaN NaN NaN\n", 737 | "img0071.png 322.057817 350.433043 338.709137 ... NaN NaN NaN\n", 738 | "\n", 739 | "[5 rows x 64 columns]" 740 | ] 741 | }, 742 | "metadata": { 743 | "tags": [] 744 | }, 745 | "execution_count": 6 746 | } 747 | ] 748 | }, 749 | { 750 | "cell_type": "markdown", 751 | "metadata": { 752 | "id": "xNi9s1dboEJN", 753 | "colab_type": "text" 754 | }, 755 | "source": [ 756 | "# Let's look at some Augmentations! \n", 757 | "\n", 758 | "*this takes a few minutes: please check the \"augmentation examples\" folder for the completed files!" 759 | ] 760 | }, 761 | { 762 | "cell_type": "code", 763 | "metadata": { 764 | "scrolled": true, 765 | "id": "eMeUwgxPoEJP", 766 | "colab_type": "code", 767 | "colab": {} 768 | }, 769 | "source": [ 770 | "#setting up augmentations\n", 771 | "Augmentations=[]\n", 772 | "\n", 773 | "augtype='rotateandscale'\n", 774 | "#rotate & scale \n", 775 | "seq = iaa.Sequential([\n", 776 | " iaa.Multiply((1.2, 1.5)), # change brightness, doesn't affect keypoints\n", 777 | " iaa.Affine(\n", 778 | " rotate=23,\n", 779 | " scale=(0.9, 1.1)\n", 780 | " ) # rotate by exactly 23 deg and scale to 90-10%, affects keypoints\n", 781 | "])\n", 782 | "Augmentations.append([augtype, seq])\n", 783 | "\n", 784 | "augtype='fog'\n", 785 | "seq = iaa.Sequential([iaa.Fog()])\n", 786 | "Augmentations.append([augtype,seq])\n", 787 | "\n", 788 | "augtype='snow'\n", 789 | "seq = iaa.Sequential([iaa.Snowflakes(flake_size=(.2,.5),density=(0.005, 0.07), speed=(0.01, 0.05))])\n", 790 | "Augmentations.append([augtype,seq]) \n", 791 | "\n", 792 | "augtype='GuassianBlur'\n", 793 | "seq = iaa.Sequential([iaa.GaussianBlur(sigma=(0, 3.0))])\n", 794 | "Augmentations.append([augtype,seq]) \n", 795 | "\n", 796 | "for ind, imname in enumerate(Dataframe.index):\n", 797 | " image=imresize(imread(os.path.join('montblanc_images',imname)),size=scale)\n", 798 | " ny,nx,nc=np.shape(image)\n", 799 | "\n", 800 | " kpts=[]\n", 801 | " for i in individuals:\n", 802 | " for b in bodyparts:\n", 803 | " x, y=Dataframe.iloc[ind][scorer][i][b]['x'], Dataframe.iloc[ind][scorer][i][b]['y']\n", 804 | " if np.isfinite(x) and np.isfinite(y):\n", 805 | " kpts.append(Keypoint(x=x*scale,y=y*scale))\n", 806 | "\n", 807 | " kps=KeypointsOnImage(kpts, shape=image.shape)\n", 808 | " \n", 809 | " cells=[]\n", 810 | "\n", 811 | " # image with keypoints before augmentation \n", 812 | " image_before = kps.draw_on_image(image, color=color,size=size,alpha=alpha)\n", 813 | " cells.append(image_before)\n", 814 | " \n", 815 | " for name, seq in Augmentations:\n", 816 | " image_aug, kps_aug = seq(image=image, keypoints=kps)\n", 817 | " image_after = kps_aug.draw_on_image(image_aug, color=color,size=size,alpha=alpha)\n", 818 | " cells.append(image_after)\n", 819 | " \n", 820 | " grid_image = np.hstack(cells) # Horizontally stack the images\n", 821 | " imageio.imwrite('augmentationexamples/'+str(imfolder)+'_'+imname.split('.png')[0]+'_joint.png', grid_image)" 822 | ], 823 | "execution_count": null, 824 | "outputs": [] 825 | }, 826 | { 827 | "cell_type": "markdown", 828 | "metadata": { 829 | "id": "K-B_e9qdwMj5", 830 | "colab_type": "text" 831 | }, 832 | "source": [ 833 | "After (or while) the code above runs, you can go look into the \"augmentationexamples folder to see the images. In Colab, you can double click and they will open on the right side of this screen!" 834 | ] 835 | }, 836 | { 837 | "cell_type": "markdown", 838 | "metadata": { 839 | "id": "C4B5fN2Twhl2", 840 | "colab_type": "text" 841 | }, 842 | "source": [ 843 | "# Play around! What happens if you set the `augtype` to something else/or add more?\n", 844 | "\n", 845 | "Check out the options in imgaug: https://imgaug.readthedocs.io/en/latest/index.html\n", 846 | "\n" 847 | ] 848 | }, 849 | { 850 | "cell_type": "code", 851 | "metadata": { 852 | "id": "y0077RSlxPoL", 853 | "colab_type": "code", 854 | "colab": {} 855 | }, 856 | "source": [ 857 | "#For example, try adding this in the cell above, at line 23:\n", 858 | "augtype='GuassianBlur'\n", 859 | "seq = iaa.Sequential([iaa.GaussianBlur(sigma=(0, 3.0))])\n", 860 | "Augmentations.append([augtype,seq]) " 861 | ], 862 | "execution_count": null, 863 | "outputs": [] 864 | }, 865 | { 866 | "cell_type": "markdown", 867 | "metadata": { 868 | "id": "f_jwicl3ywI2", 869 | "colab_type": "text" 870 | }, 871 | "source": [ 872 | "\n", 873 | "![alt text](https://images.squarespace-cdn.com/content/v1/57f6d51c9f74566f55ecf271/1593748127529-O7LN1VK99YAKL6EU6MHY/ke17ZwdGBToddI8pDm48kDXDnTgl1slZNt80fPstB8hZw-zPPgdn4jUwVcJE1ZvWQUxwkmyExglNqGp0IvTJZamWLI2zvYWH8K3-s_4yszcp2ryTI0HqTOaaUohrI8PI7YJEkB-NQMg7QT3XqyKhWHKvgVbDU7y_mPhOqssYa08/montblanc_images_img0155_joint.png?format=1000w)\n", 874 | "\n", 875 | "\n", 876 | "- Can you find out all the augmentations used in the main Figure?\n", 877 | "\n", 878 | "- Want to use this in DLC, check out these suggestions: https://github.com/DeepLabCut/DeepLabCut/wiki/Data-Augmentation\n" 879 | ] 880 | } 881 | ] 882 | } 883 | -------------------------------------------------------------------------------- /CorruptionFigure.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # -*- coding: utf-8 -*- 3 | """ 4 | Script for creating Figure 7B 5 | JL, June 27 2020 6 | 7 | For "A Primer on Motion Capture with Deep Learning: Principles, Pitfalls and Perspectives" 8 | by Alexander Mathis, Steffen Schneider, Jessy Lauer, and Mackenzie Weygandt Mathis 9 | 10 | """ 11 | 12 | import matplotlib.pyplot as plt 13 | import numpy as np 14 | import pickle 15 | 16 | 17 | with open('ResultsCorruption/data_corruption_experiments.pickle', 'rb') as file: 18 | data = pickle.load(file) 19 | 20 | bpts = ['snout', 'leftear', 'rightear', 'tailbase'] 21 | n_bpts = len(bpts) 22 | mags = sorted(data['Magnitude'].unique()) 23 | test_error = data[~data['Training set']] 24 | 25 | cmap = plt.cm.get_cmap('Blues', 7) 26 | colors = cmap(range(2, 7)) 27 | 28 | for frac in sorted(test_error['Training size'].unique()): 29 | 30 | fig, axes = plt.subplots(2, 4, figsize=(5.32, 3.14), dpi=100) 31 | for i, mag in enumerate(mags): 32 | d = test_error[((test_error['Training size'] == frac) & 33 | (test_error['Magnitude'] == mag))] 34 | for (bpt, corrupt), temp in d.groupby(['Bodyparts', 'Corruption']): 35 | n = bpts.index(bpt) 36 | if corrupt == 'swap': 37 | n += 4 38 | sorted_errors = np.sort(temp['Error']) 39 | frac_invalid = (sorted_errors == 0).sum() / len(sorted_errors) 40 | sorted_errors = sorted_errors[sorted_errors != 0] 41 | x = np.concatenate([sorted_errors, sorted_errors[[-1]]]) 42 | y = np.linspace(0, 1 - frac_invalid, len(x)) 43 | axes.flat[n].step(x, y, label=mag, color=colors[i], lw=2, where='mid') 44 | if corrupt!='swap': 45 | axes.flat[n].set_title(bpt) 46 | 47 | if corrupt == 'default': 48 | axes.flat[n + 4].step(x, y, label=mag, color=colors[i], lw=2) 49 | for n, ax in enumerate(axes.flat): 50 | ax.tick_params(axis='both', direction='in') 51 | 52 | # ax.set_box_aspect(1) 53 | # For matplotlib < 3.3.0, uncomment the line below: 54 | #ax.set_aspect(20, adjustable='datalim') 55 | ax.set_xlim(0, 20) 56 | ax.set_ylim(0, 1) 57 | ax.spines['left'].set_position(('outward', 10)) 58 | ax.spines['bottom'].set_position(('outward', 10)) 59 | ax.spines['right'].set_visible(False) 60 | ax.spines['top'].set_visible(False) 61 | if n < 4: 62 | ax.set_xticks([]) 63 | ax.set_xticklabels([]) 64 | ax.spines['bottom'].set_visible(False) 65 | if n % 4 != 0: 66 | ax.spines['left'].set_visible(False) 67 | ax.set_yticks([]) 68 | ax.set_yticklabels([]) 69 | patches = [plt.plot([0, 0], [0, 0], color=color, label=f'{label}%', lw=2)[0] 70 | for color, label in zip(colors, mags)] 71 | 72 | fig.legend(handles=patches, loc='center', frameon=False, 73 | bbox_to_anchor=(0, 0.45, 1, 0.1), 74 | ncol=5, borderaxespad=0.) 75 | plt.savefig('ResultsCorruption/LabelingCorruptionimpact_'+str(frac)+'Percent.png') 76 | -------------------------------------------------------------------------------- /Illustrating-Augmentations-FigurePipelineMontBlancBirds.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # -*- coding: utf-8 -*- 3 | """ 4 | This script uses Imgaug to display various augmentation methods for a few labeled images of a mouse 5 | (Data recorded with Alex' iphone at Aiguille du Midi near Mont Blanc) 6 | 7 | For "A Primer on Motion Capture with Deep Learning: Principles, Pitfalls and Perspectives" 8 | by Alexander Mathis, Steffen Schneider, Jessy Lauer, and Mackenzie Weygandt Mathis 9 | 10 | Uses Imgaug: 11 | Code: https://github.com/aleju/imgaug 12 | Docs: https://imgaug.readthedocs.io/en/latest/index.html 13 | """ 14 | 15 | import pandas as pd 16 | import os 17 | import numpy as np 18 | 19 | import imgaug as ia 20 | import imgaug.augmenters as iaa 21 | from imgaug.augmentables import Keypoint, KeypointsOnImage 22 | 23 | import imageio 24 | from deeplabcut.utils.auxfun_videos import imread, imresize 25 | 26 | scale=.4 27 | ########################## 28 | ## Loading data 29 | ########################## 30 | imfolder='montblanc_images' 31 | Dataframe = pd.read_hdf(os.path.join(imfolder,"CollectedData_Daniel.h5")) 32 | 33 | scorer=Dataframe.columns.get_level_values(0)[0] 34 | individuals=Dataframe.columns.get_level_values(1) 35 | bodyparts=Dataframe.columns.get_level_values(2) 36 | 37 | ia.seed(1) 38 | 39 | #parameters for plotting: 40 | color=(200,0,0) 41 | size=13 42 | alpha=.15 43 | 44 | #setting up augmentations 45 | Augmentations=[] 46 | 47 | augtype='rotateandscale' 48 | #rotate & scale 49 | seq = iaa.Sequential([ 50 | iaa.Multiply((1.2, 1.5)), # change brightness, doesn't affect keypoints 51 | iaa.Affine( 52 | rotate=23, 53 | scale=(0.9, 1.1) 54 | ) # rotate by exactly 23 deg and scale to 90-10%, affects keypoints 55 | ]) 56 | Augmentations.append([augtype, seq]) 57 | 58 | augtype='fog' 59 | seq = iaa.Sequential([iaa.Fog()]) 60 | Augmentations.append([augtype,seq]) 61 | 62 | augtype='snow' 63 | seq = iaa.Sequential([iaa.Snowflakes(flake_size=(.2,.5),density=(0.005, 0.07), speed=(0.01, 0.05))]) 64 | Augmentations.append([augtype,seq]) 65 | 66 | 67 | for ind, imname in enumerate(Dataframe.index): 68 | image=imresize(imread(os.path.join('montblanc_images',imname)),size=scale) 69 | ny,nx,nc=np.shape(image) 70 | 71 | kpts=[] 72 | for i in individuals: 73 | for b in bodyparts: 74 | x, y=Dataframe.iloc[ind][scorer][i][b]['x'], Dataframe.iloc[ind][scorer][i][b]['y'] 75 | if np.isfinite(x) and np.isfinite(y): 76 | kpts.append(Keypoint(x=x*scale,y=y*scale)) 77 | 78 | kps=KeypointsOnImage(kpts, shape=image.shape) 79 | 80 | cells=[] 81 | 82 | # image with keypoints before augmentation 83 | image_before = kps.draw_on_image(image, color=color,size=size,alpha=alpha) 84 | cells.append(image_before) 85 | 86 | for name, seq in Augmentations: 87 | image_aug, kps_aug = seq(image=image, keypoints=kps) 88 | image_after = kps_aug.draw_on_image(image_aug, color=color,size=size,alpha=alpha) 89 | cells.append(image_after) 90 | 91 | grid_image = np.hstack(cells) # Horizontally stack the images 92 | imageio.imwrite('augmentationexamples/'+str(imfolder)+'_'+imname.split('.png')[0]+'_joint.jpg', grid_image) 93 | -------------------------------------------------------------------------------- /Illustrating-Augmentations-FigurePipelineMouse.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # -*- coding: utf-8 -*- 3 | """ 4 | This script uses Imgaug to display various augmentation methods 5 | for a few labeled images of a mouse (Data in folder mouse_m7s3 6 | from Mathis, A., et al. DeepLabCut: markerless pose estimation of user-defined body parts with deep learning. 7 | Nat Neurosci 21, 1281–1289 (2018). https://doi.org/10.1038/s41593-018-0209-y) 8 | 9 | For "A Primer on Motion Capture with Deep Learning: Principles, Pitfalls and Perspectives" 10 | by Alexander Mathis, Steffen Schneider, Jessy Lauer, and Mackenzie Weygandt Mathis 11 | 12 | 13 | Uses Imgaug: 14 | Code: https://github.com/aleju/imgaug 15 | Docs: https://imgaug.readthedocs.io/en/latest/index.html 16 | """ 17 | 18 | 19 | import pandas as pd 20 | import os 21 | import numpy as np 22 | 23 | import imgaug as ia 24 | import imgaug.augmenters as iaa 25 | from imgaug.augmentables import Keypoint, KeypointsOnImage 26 | 27 | import imageio 28 | from deeplabcut.utils.auxfun_videos import imread, imresize 29 | 30 | scale=.4 31 | ########################## 32 | ## Loading data 33 | ########################## 34 | 35 | imfolder='mouse_m7s3' 36 | Dataframe = pd.read_hdf(os.path.join(imfolder,"CollectedData_Pranav.h5")) 37 | 38 | scorer=Dataframe.columns.get_level_values(0)[0] 39 | bodyparts=Dataframe.columns.get_level_values(1) 40 | 41 | ia.seed(1) 42 | 43 | #parameters for plotting: 44 | color=(200,0,0) 45 | size=17 46 | alpha=.4 47 | 48 | #setting up augmentations 49 | Augmentations=[] 50 | 51 | augtype='invert' 52 | seq = iaa.Sequential([iaa.Invert(1, per_channel=0.5)]) 53 | Augmentations.append([augtype,seq]) 54 | 55 | augtype='coarsedropout' 56 | seq = iaa.Sequential([iaa.CoarseDropout(0.02, size_percent=0.15, per_channel=0.5)]) 57 | Augmentations.append([augtype,seq]) 58 | 59 | augtype='jpegcompression' 60 | seq = iaa.Sequential([iaa.JpegCompression(compression=(70, 99))]) 61 | Augmentations.append([augtype,seq]) 62 | 63 | augtype='motionblur' 64 | seq = iaa.Sequential([iaa.MotionBlur(k=30)]) 65 | Augmentations.append([augtype,seq]) 66 | 67 | augtype='edgedetect' 68 | seq = iaa.Sequential([iaa.EdgeDetect(alpha=(0.8, 1.0))]) 69 | Augmentations.append([augtype,seq]) 70 | 71 | augtype='flipud' 72 | seq = iaa.Sequential([iaa.Flipud(1)]) 73 | Augmentations.append([augtype,seq]) 74 | 75 | augtype='fliplr' 76 | seq = iaa.Sequential([iaa.Fliplr(1)]) 77 | Augmentations.append([augtype,seq]) 78 | 79 | 80 | for ind, imname in enumerate(Dataframe.index): 81 | image=imresize(imread(os.path.join(imfolder,imname)),size=scale) 82 | ny,nx,nc=np.shape(image) 83 | 84 | kpts=[] 85 | for b in bodyparts: 86 | x, y=Dataframe.iloc[ind][scorer][b]['x'], Dataframe.iloc[ind][scorer][b]['y'] 87 | if np.isfinite(x) and np.isfinite(y): 88 | kpts.append(Keypoint(x=x*scale,y=y*scale)) 89 | 90 | kps=KeypointsOnImage(kpts, shape=image.shape) 91 | 92 | cells=[] 93 | 94 | # image with keypoints before augmentation 95 | image_before = kps.draw_on_image(image, color=color,size=size,alpha=alpha) 96 | cells.append(image_before) 97 | 98 | for name, seq in Augmentations: 99 | image_aug, kps_aug = seq(image=image, keypoints=kps) 100 | image_after = kps_aug.draw_on_image(image_aug, color=color,size=size,alpha=alpha) 101 | 102 | cells.append(image_after[:ny,:nx,:nc]) 103 | 104 | grid_image = np.hstack(cells) # Horizontally stack the images 105 | imageio.imwrite('augmentationexamples/'+str(imfolder)+'_'+imname.split('.png')[0]+'_joint.jpg', grid_image) 106 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2020 DeepLabCut 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /Primer_AugmentationComparison-Figures.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # -*- coding: utf-8 -*- 3 | """ 4 | 5 | Script used plotting Fig 8 a-e without c. 6 | 7 | AM, May 29th 2020 8 | 9 | For "A Primer on Motion Capture with Deep Learning: Principles, Pitfalls and Perspectives" 10 | by Alexander Mathis, Steffen Schneider, Jessy Lauer, and Mackenzie Weygandt Mathis 11 | 12 | """ 13 | 14 | import os 15 | import pandas as pd 16 | from pathlib import Path 17 | import deeplabcut 18 | from tqdm import tqdm 19 | import cv2 20 | import numpy as np 21 | import matplotlib.pyplot as plt 22 | 23 | params = { 24 | 'axes.labelsize': 22, 25 | 'legend.fontsize': 12, 26 | 'xtick.labelsize': 18, 27 | 'ytick.labelsize': 18, 28 | 'text.usetex': False, 29 | 'figure.figsize': [5,5], 30 | 'font.size': 22, 31 | 'axes.linewidth': 2, 32 | 'xtick.major.size': 5, 33 | 'xtick.major.width': 2, 34 | 'ytick.major.size': 5, 35 | 'ytick.major.width': 2 36 | } 37 | 38 | plt.rcParams.update(params) 39 | def figurchen(): 40 | fig = plt.figure() 41 | ax = fig.add_subplot(111,position=[0.2,.14, .77,.82]) 42 | ax.spines['top'].set_visible(False) 43 | ax.spines['right'].set_visible(False) 44 | ax.get_xaxis().tick_bottom() 45 | ax.get_yaxis().tick_left() 46 | ax.tick_params(axis='x', direction='in') 47 | ax.tick_params(axis='y', direction='in') 48 | 49 | method=['imgaug','scalecrop','tensorpack'] 50 | 51 | cmap = plt.cm.get_cmap('viridis', 4) 52 | colors = cmap(range(4)) 53 | 54 | ########################################## 55 | ############# Load the loss & pixel errors 56 | ########################################## 57 | 58 | figurchen() 59 | for shuffle in [1,2,3]: 60 | #fn=os.path.join(basepath,'openfield-Pranav-2018-10-30/dlc-models/iteration-0/openfieldOct30-trainset95shuffle'+str(shuffle)+'/train/learning_stats.csv') 61 | fn='ResultsComparison/learning_stats_shuffle'+str(shuffle)+'.csv' 62 | 63 | lossdata=pd.read_csv(fn) 64 | iterations,loss,learninrate=np.array(lossdata).T 65 | 66 | plt.plot(iterations,loss,'-',label=method[shuffle-1],alpha=.9,color=colors[shuffle-1]) 67 | 68 | plt.xticks([0,25000,50000,75000,100000],["0","25k","50k","75k","100k"]) 69 | plt.yticks([0, 0.010],["0","0.01"]) 70 | plt.xlabel("Training iterations") 71 | plt.ylabel("Training loss") 72 | 73 | plt.legend() 74 | plt.savefig('ResultsComparison/LearningCurves.png') 75 | 76 | figurchen() 77 | for shuffle in [1,2,3]: 78 | fn='ResultsComparison/DLC_resnet50_openfieldOct30shuffle'+str(shuffle)+'_100000-results.csv' 79 | resultsdata = pd.read_csv(fn) 80 | iterations=resultsdata['Training iterations:'] 81 | trainerror=resultsdata[' Train error(px)'] 82 | testerror=resultsdata[' Test error(px)'] 83 | 84 | plt.plot(iterations,trainerror.values,'-',alpha=.2,color=colors[shuffle-1]) 85 | plt.plot(iterations,testerror.values,'.--',alpha=.9,color=colors[shuffle-1],label=method[shuffle-1],) 86 | 87 | plt.xlabel("Training iterations") 88 | plt.ylabel("Train/Test error in pixels") 89 | plt.legend() 90 | plt.xticks([0,25000,50000,75000,100000],["0","25k","50k","75k","100k"]) 91 | plt.yticks([0,2,4,6],["0","2","4","6"]) 92 | plt.ylim(0,7) 93 | plt.savefig('ResultsComparison/ErrorCurves.png') 94 | 95 | 96 | plt.close("all") 97 | 98 | 99 | ################################################################################# 100 | ############# Comparing video predictions (aligned stick figures) 101 | ################################################################################# 102 | 103 | plt.figure(figsize=(10,5),dpi=600) 104 | 105 | N=500 106 | for shuffle in [1,2,3]: 107 | fn='ResultsComparison/m3v1mp4DLC_resnet50_openfieldOct30shuffle'+str(shuffle)+'_100000.h5' 108 | Dataframe = pd.read_hdf(fn) 109 | plt.subplot(3,1,shuffle) 110 | alphavalue=0.1 111 | scorer=Dataframe.columns.get_level_values(0)[0] 112 | bodyparts=set(Dataframe.columns.get_level_values(1)) 113 | 114 | 115 | Delta=10*np.arange(2330)[:N] 116 | for bpindex, bp in enumerate(bodyparts): 117 | DeltaX=-Dataframe[scorer]['tailbase']['x'].values[:N]+Delta 118 | DeltaY=-Dataframe[scorer]['tailbase']['y'].values[:N] 119 | 120 | for (bp1,bp2) in [('snout','tailbase'),('leftear','rightear')]: 121 | plt.plot([Dataframe[scorer][bp1]['x'].values[:N]+DeltaX,Dataframe[scorer][bp2]['x'].values[:N]+DeltaX], 122 | [Dataframe[scorer][bp1]['y'].values[:N]+DeltaY,Dataframe[scorer][bp2]['y'].values[:N]+DeltaY],color=colors[shuffle-1],alpha=.1) 123 | 124 | plt.axis('off') 125 | plt.savefig('ResultsComparison/Stickfiguresfirst'+str(N)+'.png') 126 | 127 | plt.figure(figsize=(10,5),dpi=1200) 128 | 129 | for shuffle in [1,2,3]: 130 | fn='ResultsComparison/m3v1mp4DLC_resnet50_openfieldOct30shuffle'+str(shuffle)+'_100000.h5' 131 | Dataframe = pd.read_hdf(fn) 132 | plt.subplot(3,1,shuffle) 133 | alphavalue=0.1 134 | scorer=Dataframe.columns.get_level_values(0)[0] 135 | bodyparts=set(Dataframe.columns.get_level_values(1)) 136 | 137 | 138 | Delta=10*np.arange(2330) 139 | for bpindex, bp in enumerate(bodyparts): 140 | DeltaX=-Dataframe[scorer]['tailbase']['x'].values+Delta 141 | DeltaY=-Dataframe[scorer]['tailbase']['y'].values 142 | 143 | for (bp1,bp2) in [('snout','tailbase'),('leftear','rightear')]: 144 | plt.plot([Dataframe[scorer][bp1]['x'].values+DeltaX,Dataframe[scorer][bp2]['x'].values+DeltaX], 145 | [Dataframe[scorer][bp1]['y'].values+DeltaY,Dataframe[scorer][bp2]['y'].values+DeltaY],color=colors[shuffle-1],alpha=.1) 146 | 147 | 148 | plt.axis('off') 149 | 150 | plt.savefig('ResultsComparison/Stickfigures.png') 151 | 152 | 153 | cap = cv2.VideoCapture('ResultsComparison/m3v1mp4.mp4') 154 | 155 | nframes = int(cap.get(7)) 156 | strwidth = int(np.ceil(np.log10(nframes))) # width for strings 157 | ny = int(cap.get(4)) 158 | nx = int(cap.get(3)) 159 | #plt.figure(figsize=(10,5),dpi=1200) 160 | 161 | delta=30 162 | start=85 163 | 164 | plt.figure() #figsize=(10,5),dpi=1200) 165 | 166 | for shuffle in [1,2,3]: 167 | fn='ResultsComparison/m3v1mp4DLC_resnet50_openfieldOct30shuffle'+str(shuffle)+'_100000.h5' 168 | Dataframe = pd.read_hdf(fn) 169 | plt.clf() 170 | alphavalue=0.1 171 | scorer=Dataframe.columns.get_level_values(0)[0] 172 | bodyparts=set(Dataframe.columns.get_level_values(1)) 173 | 174 | 175 | for index in tqdm(start+np.arange(0,delta+1,5)): #range(nframes)): 176 | cap.set(1, index) 177 | ret, frame = cap.read() 178 | imname = "frame" + str(index).zfill(strwidth) 179 | if ret and index==start: 180 | frame = cv2.cvtColor(frame, cv2.COLOR_BGR2RGB) 181 | plt.imshow(frame) 182 | 183 | #for (bp1,bp2) in [('snout','tailbase'),('leftear','rightear')]: 184 | # plt.plot([Dataframe[scorer][bp1]['x'].values[index],Dataframe[scorer][bp2]['x'].values[index]], 185 | # [Dataframe[scorer][bp1]['y'].values[index],Dataframe[scorer][bp2]['y'].values[index]],color=colors[shuffle-1],alpha=.75,lw=3) 186 | for (bp1,bp2) in [('tailbase','snout',),('leftear','rightear')]: 187 | plt.arrow(Dataframe[scorer][bp1]['x'].values[index],Dataframe[scorer][bp1]['y'].values[index], 188 | Dataframe[scorer][bp2]['x'].values[index]-Dataframe[scorer][bp1]['x'].values[index], 189 | Dataframe[scorer][bp2]['y'].values[index]-Dataframe[scorer][bp1]['y'].values[index],color=colors[shuffle-1],alpha=.5,lw=3,head_width=9) 190 | 191 | if index==start+delta: 192 | image_output = os.path.join('ResultsComparisonFrames', imname + str(method[shuffle-1])+"startframe.png") 193 | plt.axis("off") 194 | plt.savefig(image_output) 195 | 196 | if ret and index==start+delta: 197 | frame = cv2.cvtColor(frame, cv2.COLOR_BGR2RGB) 198 | plt.imshow(frame) 199 | print(index) 200 | if index==start+delta: 201 | image_output = os.path.join('ResultsComparisonFrames', imname + str(method[shuffle-1])+"stopframe.png") 202 | plt.axis("off") 203 | plt.savefig(image_output) 204 | -------------------------------------------------------------------------------- /Primer_RobustnessEvaluation-Figures.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # -*- coding: utf-8 -*- 3 | """ 4 | 5 | Evaluting the models on the whole dataset and displaying results. 6 | AM, May 29th 2020 7 | 8 | For "A Primer on Motion Capture with Deep Learning: Principles, Pitfalls and Perspectives" 9 | by Alexander Mathis, Steffen Schneider, Jessy Lauer, and Mackenzie Weygandt Mathis 10 | 11 | """ 12 | 13 | 14 | import os 15 | import pandas as pd 16 | import numpy as np 17 | from pathlib import Path 18 | 19 | os.environ["DLClight"] = "True" 20 | 21 | import deeplabcut 22 | 23 | ######################################################### 24 | ##### Results for evaluation on the large dataset (before finetuning on additional frames) 25 | ######################################################### 26 | 27 | #Notes: mouse 5 - 8 domain shift (i.e. different camera) 28 | #m4 >> training mouse; 29 | for shuffle in [1, 2, 3]: 30 | RMSE=pd.read_hdf("ResultsComparison/Errors_shuffle"+str(shuffle)+".h5", "df_with_missing") 31 | 32 | differentmouse_samecamera=[image for image in RMSE.index if '/m1' in image or '/m2' in image or '/m3' in image] 33 | differentmouse_differentcamera=[image for image in RMSE.index if '/m5' in image or '/m6' in image or '/m7' in image or '/m8' in image] 34 | 35 | print(shuffle) 36 | print(np.mean(RMSE.loc[differentmouse_samecamera])) 37 | 38 | error_files = ['ResultsComparison/Errors_shuffle1.h5', 39 | 'ResultsComparison/Errors_shuffle2.h5', 40 | 'ResultsComparison/Errors_shuffle3.h5'] 41 | 42 | augmenters = ['imgaug', 'scalecrop', 'tensorpack'] 43 | data = [] 44 | for n, file in enumerate(error_files): 45 | df = pd.read_hdf(file) 46 | temp = df.stack().reset_index() 47 | temp['aug'] = augmenters[n] 48 | data.append(temp) 49 | data = pd.concat(data).set_index('level_0') 50 | data.columns = ['Bodyparts', 'Error', 'Augmenters'] 51 | same_camera = data.index.str.contains('/m1|/m2|/m3') 52 | diff_camera = data.index.str.contains('/m5|/m6|/m7|/m8') 53 | 54 | import matplotlib.pyplot as plt 55 | # Produce the PCK curves 56 | data.loc[same_camera, 'Camera'] = 'same' 57 | data.loc[diff_camera, 'Camera'] = 'diff' 58 | bpts = ['snout', 'leftear', 'rightear', 'tailbase'] 59 | cmap = plt.cm.get_cmap('viridis', 4) 60 | colors = cmap(range(4)) 61 | fig, axes = plt.subplots(2, 4, figsize=(5.32, 3.14), dpi=200) 62 | for (mask, bpt, aug), df in data.groupby(['Camera', 'Bodyparts', 'Augmenters']): 63 | n = bpts.index(bpt) 64 | sorted_errors = np.sort(df['Error']) 65 | n_detections = len(sorted_errors) + 1 66 | x = np.concatenate([sorted_errors, sorted_errors[[-1]]]) 67 | y = np.linspace(0, 1, n_detections) 68 | axes[int(mask == 'diff'), n].step(x, y, color=colors[augmenters.index(aug)], lw=2) 69 | for n, ax in enumerate(axes.flat): 70 | #ax.set_box_aspect(1) 71 | ax.tick_params(axis='both', direction='in') 72 | ax.set_xlim(0, 20) 73 | ax.set_ylim(0, 1) 74 | ax.spines['left'].set_position(('outward', 10)) 75 | ax.spines['bottom'].set_position(('outward', 10)) 76 | ax.spines['right'].set_visible(False) 77 | ax.spines['top'].set_visible(False) 78 | if n < 4: 79 | ax.set_xticks([]) 80 | ax.set_xticklabels([]) 81 | ax.spines['bottom'].set_visible(False) 82 | if n % 4 != 0: 83 | ax.spines['left'].set_visible(False) 84 | ax.set_yticks([]) 85 | ax.set_yticklabels([]) 86 | patches = [plt.plot([0, 0], [0, 0], color=color, label=f'{label}', lw=2)[0] 87 | for color, label in zip(colors, augmenters)] 88 | fig.legend(handles=patches, loc='center', frameon=False, 89 | bbox_to_anchor=(0, 0.45, 1, 0.1), 90 | ncol=3, borderaxespad=0.) 91 | 92 | plt.savefig("ResultsComparison/PCKresults.png") 93 | 94 | ######################################################### 95 | ##### Results for evaluation on the large dataset (after finetuning on additional frames from mouse 7) 96 | ######################################################### 97 | 98 | 99 | nameprefix="ResultsComparison/ErrorsafterAugmentation" 100 | error_files = [nameprefix+"_shuffle1.h5", 101 | nameprefix+"_shuffle2.h5", 102 | nameprefix+"_shuffle3.h5"] 103 | 104 | augmenters = ['imgaug', 'scalecrop', 'tensorpack'] 105 | data = [] 106 | for n, file in enumerate(error_files): 107 | df = pd.read_hdf(file) 108 | temp = df.stack().reset_index() 109 | temp['aug'] = augmenters[n] 110 | data.append(temp) 111 | data = pd.concat(data).set_index('level_0') 112 | data.columns = ['Bodyparts', 'Error', 'Augmenters'] 113 | 114 | same_camera = data.index.str.contains('/m1|/m2|/m3') 115 | diff_camera = data.index.str.contains('/m5|/m6|/m8') #DROPPING mouse 7 as it has now 5 frames in training set! 116 | 117 | # Produce the PCK curves 118 | data.loc[same_camera, 'Camera'] = 'same' 119 | data.loc[diff_camera, 'Camera'] = 'diff' 120 | bpts = ['snout', 'leftear', 'rightear', 'tailbase'] 121 | cmap = plt.cm.get_cmap('viridis', 4) 122 | colors = cmap(range(4)) 123 | fig, axes = plt.subplots(2, 4, figsize=(5.32, 3.14), dpi=200) 124 | for (mask, bpt, aug), df in data.groupby(['Camera', 'Bodyparts', 'Augmenters']): 125 | n = bpts.index(bpt) 126 | sorted_errors = np.sort(df['Error']) 127 | n_detections = len(sorted_errors) + 1 128 | x = np.concatenate([sorted_errors, sorted_errors[[-1]]]) 129 | y = np.linspace(0, 1, n_detections) 130 | axes[int(mask == 'diff'), n].step(x, y, color=colors[augmenters.index(aug)], lw=2) 131 | for n, ax in enumerate(axes.flat): 132 | #ax.set_box_aspect(1) 133 | ax.tick_params(axis='both', direction='in') 134 | ax.set_xlim(0, 20) 135 | ax.set_ylim(0, 1) 136 | ax.spines['left'].set_position(('outward', 10)) 137 | ax.spines['bottom'].set_position(('outward', 10)) 138 | ax.spines['right'].set_visible(False) 139 | ax.spines['top'].set_visible(False) 140 | if n < 4: 141 | ax.set_xticks([]) 142 | ax.set_xticklabels([]) 143 | ax.spines['bottom'].set_visible(False) 144 | if n % 4 != 0: 145 | ax.spines['left'].set_visible(False) 146 | ax.set_yticks([]) 147 | ax.set_yticklabels([]) 148 | patches = [plt.plot([0, 0], [0, 0], color=color, label=f'{label}', lw=2)[0] 149 | for color, label in zip(colors, augmenters)] 150 | fig.legend(handles=patches, loc='center', frameon=False, 151 | bbox_to_anchor=(0, 0.45, 1, 0.1), 152 | ncol=3, borderaxespad=0.) 153 | 154 | plt.savefig("ResultsComparison/PCKresultsafterAugmentation.png") 155 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ## Code for "A Primer on Motion Capture with Deep Learning: Principles, Pitfalls and Perspectives" 2 | 3 | By [Alexander Mathis](https://github.com/AlexEMG) | [Steffen Schneider](https://github.com/stes) | [Jessy Lauer](https://github.com/jeylau) | [Mackenzie Mathis](https://github.com/MMathisLab) 4 | 5 | Here we provide code that we used in the worked-examples we provide in our Primer on Deep Learning for Motion Capture. 6 | 7 | Publication in Neuron: https://www.cell.com/neuron/fulltext/S0896-6273(20)30717-0 8 | 9 | Preprint: https://arxiv.org/abs/2009.00564 10 | 11 | ### Illustrating augmention methods (Figure 3) 12 | 13 | Create the figure in Google Colaboratory: [![Open in Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/DeepLabCut/Primer-MotionCapture/blob/master/COLAB_Primer_MotionCapture_Fig3.ipynb) 14 | 15 | Or in plain Python: 16 | 17 | ``` 18 | python Illustrating-Augmentations-FigurePipelineMontBlancBirds.py 19 | python Illustrating-Augmentations-FigurePipelineMouse.py 20 | ``` 21 | 22 | This code creates images like this: 23 | 24 |

25 | 26 |

27 | 28 | ### Labeling Pitfalls: How corruptions affect performance (Figure 7) 29 | 30 | To simulate inattentive labeling we corrupted the original dataset from [Mathis et al.](https://www.nature.com/articles/s41593-018-0209-y), available on [Zenodo](https://zenodo.org/record/4008504#.X4S7RZqxVH4). We corrupted 1, 5, 10 and 20% of the dataset (N=1,066 images) either by swapping two labels or removing one, and trained with varying percentages of the data. Then we trained models and evaluated them on the test set (the rest of the data). The figures below show percentage of correct keypoints (PCK) on the test set for various conditions. The results from these experiments can be plotted like this: 31 | ``` 32 | python CorruptionFigure.py 33 | ``` 34 | 35 | Which creates figures like this (when training with 10% of the data as shown in the paper) 36 | 37 |

38 | 39 |

40 | 41 | Also results for different training fractions (not shown in the paper are plotted). 42 | 43 | ### Data Augmentation Improves Performance (Figure 8) 44 | 45 | Here we used the standad example dataset from the main repo: https://github.com/DeepLabCut/DeepLabCut/tree/master/examples/openfield-Pranav-2018-10-30 46 | and trained with 3 different augmentation methods. To plot the results run the following: 47 | 48 | ``` 49 | python Primer_AugmentationComparison-Figures.py 50 | ``` 51 | Creates figure (in folder: ResultsComparison) 52 | 53 | 8A = ResultsComparison/LearningCurves.png 54 | 55 | 8B = ResultsComparison/ErrorCurves.png 56 | 57 | 8C, D = Stickfigures.png, Stickfiguresfirst500.png 58 | 59 | incl. the 8D in the folder "ResultsComparisonFrames" 60 | 61 | We then evaluated this model (only trained on a single mouse and session, which is not recommended) on all other mice and sessions (data from here [Zenodo](https://zenodo.org/record/4008504#.X4S7RZqxVH4)). We noticed that with good augmentation (imgaug, tensorpack) the model generalizes to data from the same camera but not the higher-resolution camera (Fig 8E). We then furthermore illustrate active learning, by adding a few frames from an experiment with the higher-resolution camera (Fig 8F). We found that this is sufficient to generalize reasonably. 62 | 63 | ``` 64 | python Primer_RobustnessEvaluation-Figures.py 65 | ``` 66 | 67 | Creates figure (in folder: ResultsComparison) 68 | 69 | 8E = ResultsComparison/PCKresults.png 70 | 71 | 8F = ResultsComparison/PCKresultsafterAugmentation.png 72 | 73 | **Outlook** 74 | 75 | Do you want to contribute labeled data to the DeepLabCut project? 76 | Check out http://contrib.deeplabcut.org 77 | -------------------------------------------------------------------------------- /ResultsComparison/DLC_resnet50_openfieldOct30shuffle1_100000-results.csv: -------------------------------------------------------------------------------- 1 | ,Training iterations:,%Training dataset,Shuffle number, Train error(px), Test error(px),p-cutoff used,Train error with p-cutoff,Test error with p-cutoff 2 | 0,5000,95,1,4.69,4.88,0.4,4.69,4.88 3 | 1,10000,95,1,3.36,3.67,0.4,3.36,3.67 4 | 2,15000,95,1,4.15,5.42,0.4,4.15,5.42 5 | 3,20000,95,1,2.84,3.04,0.4,2.84,3.04 6 | 4,25000,95,1,2.62,3.05,0.4,2.62,3.05 7 | 5,30000,95,1,2.8,3.43,0.4,2.8,3.43 8 | 6,35000,95,1,3.38,3.49,0.4,3.38,3.49 9 | 7,40000,95,1,3.01,3.12,0.4,3.01,3.12 10 | 8,45000,95,1,2.91,3.09,0.4,2.91,3.09 11 | 9,50000,95,1,3.23,3.04,0.4,3.23,3.04 12 | 10,55000,95,1,3.18,2.89,0.4,3.18,2.89 13 | 11,60000,95,1,2.18,2.63,0.4,2.18,2.63 14 | 12,65000,95,1,2.27,2.56,0.4,2.27,2.56 15 | 13,70000,95,1,2.63,2.57,0.4,2.63,2.57 16 | 14,75000,95,1,2.36,2.57,0.4,2.36,2.57 17 | 15,80000,95,1,2.62,3.44,0.4,2.62,3.44 18 | 16,85000,95,1,2.96,3.15,0.4,2.96,3.15 19 | 17,90000,95,1,2.88,3.45,0.4,2.88,3.45 20 | 18,95000,95,1,2.29,2.93,0.4,2.29,2.93 21 | 19,100000,95,1,2.16,2.71,0.4,2.16,2.71 22 | -------------------------------------------------------------------------------- /ResultsComparison/DLC_resnet50_openfieldOct30shuffle2_100000-results.csv: -------------------------------------------------------------------------------- 1 | ,Training iterations:,%Training dataset,Shuffle number, Train error(px), Test error(px),p-cutoff used,Train error with p-cutoff,Test error with p-cutoff 2 | 0,5000,95,2,4.67,4.89,0.4,4.67,4.89 3 | 1,10000,95,2,3.11,3.47,0.4,3.11,3.47 4 | 2,15000,95,2,2.96,3.02,0.4,2.96,3.02 5 | 3,20000,95,2,2.38,3.34,0.4,2.38,3.34 6 | 4,25000,95,2,2.09,2.13,0.4,2.09,2.13 7 | 5,30000,95,2,3.44,3.84,0.4,3.44,3.84 8 | 6,35000,95,2,2.47,3.11,0.4,2.47,3.11 9 | 7,40000,95,2,1.96,2.34,0.4,1.96,2.34 10 | 8,45000,95,2,1.64,1.8,0.4,1.64,1.8 11 | 9,50000,95,2,2.79,3.66,0.4,2.79,3.66 12 | 10,55000,95,2,1.76,2.16,0.4,1.76,2.16 13 | 11,60000,95,2,1.87,2.82,0.4,1.87,2.82 14 | 12,65000,95,2,1.45,2.31,0.4,1.45,2.31 15 | 13,70000,95,2,1.72,2.57,0.4,1.72,2.57 16 | 14,75000,95,2,1.85,2.89,0.4,1.85,2.89 17 | 15,80000,95,2,1.94,3.0,0.4,1.94,3.0 18 | 16,85000,95,2,1.66,2.67,0.4,1.66,2.67 19 | 17,90000,95,2,1.82,2.46,0.4,1.82,2.46 20 | 18,95000,95,2,1.48,2.49,0.4,1.48,2.49 21 | 19,100000,95,2,2.02,3.03,0.4,2.02,3.03 22 | -------------------------------------------------------------------------------- /ResultsComparison/DLC_resnet50_openfieldOct30shuffle3_100000-results.csv: -------------------------------------------------------------------------------- 1 | ,Training iterations:,%Training dataset,Shuffle number, Train error(px), Test error(px),p-cutoff used,Train error with p-cutoff,Test error with p-cutoff 2 | 0,5000,95,3,3.49,4.14,0.4,3.49,4.14 3 | 1,10000,95,3,2.85,2.46,0.4,2.85,2.46 4 | 2,15000,95,3,4.73,5.09,0.4,4.73,5.09 5 | 3,20000,95,3,3.69,3.54,0.4,3.69,3.54 6 | 4,25000,95,3,2.7,3.37,0.4,2.7,3.37 7 | 5,30000,95,3,2.41,2.7,0.4,2.41,2.7 8 | 6,35000,95,3,2.47,2.93,0.4,2.47,2.93 9 | 7,40000,95,3,3.03,3.6,0.4,3.03,3.6 10 | 8,45000,95,3,2.0,2.7,0.4,2.0,2.7 11 | 9,50000,95,3,4.62,4.73,0.4,4.62,4.73 12 | 10,55000,95,3,2.61,3.67,0.4,2.61,3.67 13 | 11,60000,95,3,1.72,3.04,0.4,1.72,3.04 14 | 12,65000,95,3,2.18,3.08,0.4,2.18,3.08 15 | 13,70000,95,3,2.6,2.78,0.4,2.6,2.78 16 | 14,75000,95,3,2.16,3.08,0.4,2.16,3.08 17 | 15,80000,95,3,2.02,3.07,0.4,2.02,3.07 18 | 16,85000,95,3,1.85,2.71,0.4,1.85,2.71 19 | 17,90000,95,3,2.22,3.07,0.4,2.22,3.07 20 | 18,95000,95,3,1.98,2.35,0.4,1.98,2.35 21 | 19,100000,95,3,1.52,2.35,0.4,1.52,2.35 22 | -------------------------------------------------------------------------------- /ResultsComparison/ErrorCurves.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DeepLabCut/Primer-MotionCapture/ee595bb14ad89d5a6e2b412ce28962f5607cad77/ResultsComparison/ErrorCurves.png -------------------------------------------------------------------------------- /ResultsComparison/Errors_shuffle1.h5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DeepLabCut/Primer-MotionCapture/ee595bb14ad89d5a6e2b412ce28962f5607cad77/ResultsComparison/Errors_shuffle1.h5 -------------------------------------------------------------------------------- /ResultsComparison/Errors_shuffle2.h5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DeepLabCut/Primer-MotionCapture/ee595bb14ad89d5a6e2b412ce28962f5607cad77/ResultsComparison/Errors_shuffle2.h5 -------------------------------------------------------------------------------- /ResultsComparison/Errors_shuffle3.h5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DeepLabCut/Primer-MotionCapture/ee595bb14ad89d5a6e2b412ce28962f5607cad77/ResultsComparison/Errors_shuffle3.h5 -------------------------------------------------------------------------------- /ResultsComparison/ErrorsafterAugmentation_shuffle1.h5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DeepLabCut/Primer-MotionCapture/ee595bb14ad89d5a6e2b412ce28962f5607cad77/ResultsComparison/ErrorsafterAugmentation_shuffle1.h5 -------------------------------------------------------------------------------- /ResultsComparison/ErrorsafterAugmentation_shuffle2.h5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DeepLabCut/Primer-MotionCapture/ee595bb14ad89d5a6e2b412ce28962f5607cad77/ResultsComparison/ErrorsafterAugmentation_shuffle2.h5 -------------------------------------------------------------------------------- /ResultsComparison/ErrorsafterAugmentation_shuffle3.h5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DeepLabCut/Primer-MotionCapture/ee595bb14ad89d5a6e2b412ce28962f5607cad77/ResultsComparison/ErrorsafterAugmentation_shuffle3.h5 -------------------------------------------------------------------------------- /ResultsComparison/ErrorsafterAugmentationpcutoff_shuffle1.h5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DeepLabCut/Primer-MotionCapture/ee595bb14ad89d5a6e2b412ce28962f5607cad77/ResultsComparison/ErrorsafterAugmentationpcutoff_shuffle1.h5 -------------------------------------------------------------------------------- /ResultsComparison/ErrorsafterAugmentationpcutoff_shuffle2.h5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DeepLabCut/Primer-MotionCapture/ee595bb14ad89d5a6e2b412ce28962f5607cad77/ResultsComparison/ErrorsafterAugmentationpcutoff_shuffle2.h5 -------------------------------------------------------------------------------- /ResultsComparison/ErrorsafterAugmentationpcutoff_shuffle3.h5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DeepLabCut/Primer-MotionCapture/ee595bb14ad89d5a6e2b412ce28962f5607cad77/ResultsComparison/ErrorsafterAugmentationpcutoff_shuffle3.h5 -------------------------------------------------------------------------------- /ResultsComparison/Errorspcutoff_shuffle1.h5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DeepLabCut/Primer-MotionCapture/ee595bb14ad89d5a6e2b412ce28962f5607cad77/ResultsComparison/Errorspcutoff_shuffle1.h5 -------------------------------------------------------------------------------- /ResultsComparison/Errorspcutoff_shuffle2.h5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DeepLabCut/Primer-MotionCapture/ee595bb14ad89d5a6e2b412ce28962f5607cad77/ResultsComparison/Errorspcutoff_shuffle2.h5 -------------------------------------------------------------------------------- /ResultsComparison/Errorspcutoff_shuffle3.h5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DeepLabCut/Primer-MotionCapture/ee595bb14ad89d5a6e2b412ce28962f5607cad77/ResultsComparison/Errorspcutoff_shuffle3.h5 -------------------------------------------------------------------------------- /ResultsComparison/LearningCurves.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DeepLabCut/Primer-MotionCapture/ee595bb14ad89d5a6e2b412ce28962f5607cad77/ResultsComparison/LearningCurves.png -------------------------------------------------------------------------------- /ResultsComparison/PCKresults.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DeepLabCut/Primer-MotionCapture/ee595bb14ad89d5a6e2b412ce28962f5607cad77/ResultsComparison/PCKresults.png -------------------------------------------------------------------------------- /ResultsComparison/PCKresultsafterAugmentation.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DeepLabCut/Primer-MotionCapture/ee595bb14ad89d5a6e2b412ce28962f5607cad77/ResultsComparison/PCKresultsafterAugmentation.png -------------------------------------------------------------------------------- /ResultsComparison/Stickfigures.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DeepLabCut/Primer-MotionCapture/ee595bb14ad89d5a6e2b412ce28962f5607cad77/ResultsComparison/Stickfigures.png -------------------------------------------------------------------------------- /ResultsComparison/Stickfiguresfirst500.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DeepLabCut/Primer-MotionCapture/ee595bb14ad89d5a6e2b412ce28962f5607cad77/ResultsComparison/Stickfiguresfirst500.png -------------------------------------------------------------------------------- /ResultsComparison/learning_stats_shuffle1.csv: -------------------------------------------------------------------------------- 1 | 500, 0.03213, 0.005 2 | 1000, 0.01846, 0.005 3 | 1500, 0.01406, 0.005 4 | 2000, 0.01258, 0.005 5 | 2500, 0.01154, 0.005 6 | 3000, 0.01069, 0.005 7 | 3500, 0.01011, 0.005 8 | 4000, 0.00948, 0.005 9 | 4500, 0.00885, 0.005 10 | 5000, 0.00867, 0.005 11 | 5500, 0.00788, 0.005 12 | 6000, 0.00820, 0.005 13 | 6500, 0.00760, 0.005 14 | 7000, 0.00715, 0.005 15 | 7500, 0.00752, 0.005 16 | 8000, 0.00758, 0.005 17 | 8500, 0.00709, 0.005 18 | 9000, 0.00692, 0.005 19 | 9500, 0.00692, 0.005 20 | 10000, 0.00651, 0.005 21 | 10500, 0.01136, 0.02 22 | 11000, 0.01001, 0.02 23 | 11500, 0.00922, 0.02 24 | 12000, 0.00897, 0.02 25 | 12500, 0.00754, 0.02 26 | 13000, 0.00853, 0.02 27 | 13500, 0.00683, 0.02 28 | 14000, 0.00676, 0.02 29 | 14500, 0.00710, 0.02 30 | 15000, 0.00715, 0.02 31 | 15500, 0.00645, 0.02 32 | 16000, 0.00648, 0.02 33 | 16500, 0.00582, 0.02 34 | 17000, 0.00574, 0.02 35 | 17500, 0.00613, 0.02 36 | 18000, 0.00563, 0.02 37 | 18500, 0.00566, 0.02 38 | 19000, 0.00515, 0.02 39 | 19500, 0.00513, 0.02 40 | 20000, 0.00553, 0.02 41 | 20500, 0.00553, 0.02 42 | 21000, 0.00516, 0.02 43 | 21500, 0.00553, 0.02 44 | 22000, 0.00552, 0.02 45 | 22500, 0.00513, 0.02 46 | 23000, 0.00518, 0.02 47 | 23500, 0.00519, 0.02 48 | 24000, 0.00453, 0.02 49 | 24500, 0.00451, 0.02 50 | 25000, 0.00478, 0.02 51 | 25500, 0.00492, 0.02 52 | 26000, 0.00446, 0.02 53 | 26500, 0.00508, 0.02 54 | 27000, 0.00477, 0.02 55 | 27500, 0.00454, 0.02 56 | 28000, 0.00489, 0.02 57 | 28500, 0.00501, 0.02 58 | 29000, 0.00472, 0.02 59 | 29500, 0.00474, 0.02 60 | 30000, 0.00443, 0.02 61 | 30500, 0.00458, 0.02 62 | 31000, 0.00461, 0.02 63 | 31500, 0.00475, 0.02 64 | 32000, 0.00456, 0.02 65 | 32500, 0.00441, 0.02 66 | 33000, 0.00411, 0.02 67 | 33500, 0.00431, 0.02 68 | 34000, 0.00446, 0.02 69 | 34500, 0.00427, 0.02 70 | 35000, 0.00403, 0.02 71 | 35500, 0.00427, 0.02 72 | 36000, 0.00429, 0.02 73 | 36500, 0.00433, 0.02 74 | 37000, 0.00417, 0.02 75 | 37500, 0.00396, 0.02 76 | 38000, 0.00409, 0.02 77 | 38500, 0.00414, 0.02 78 | 39000, 0.00411, 0.02 79 | 39500, 0.00390, 0.02 80 | 40000, 0.00423, 0.02 81 | 40500, 0.00402, 0.02 82 | 41000, 0.00386, 0.02 83 | 41500, 0.00381, 0.02 84 | 42000, 0.00402, 0.02 85 | 42500, 0.00400, 0.02 86 | 43000, 0.00383, 0.02 87 | 43500, 0.00415, 0.02 88 | 44000, 0.00386, 0.02 89 | 44500, 0.00371, 0.02 90 | 45000, 0.00363, 0.02 91 | 45500, 0.00382, 0.02 92 | 46000, 0.00379, 0.02 93 | 46500, 0.00393, 0.02 94 | 47000, 0.00398, 0.02 95 | 47500, 0.00394, 0.02 96 | 48000, 0.00361, 0.02 97 | 48500, 0.00346, 0.02 98 | 49000, 0.00333, 0.02 99 | 49500, 0.00343, 0.02 100 | 50000, 0.00388, 0.02 101 | 50500, 0.00347, 0.02 102 | 51000, 0.00362, 0.02 103 | 51500, 0.00384, 0.02 104 | 52000, 0.00376, 0.02 105 | 52500, 0.00389, 0.02 106 | 53000, 0.00384, 0.02 107 | 53500, 0.00357, 0.02 108 | 54000, 0.00354, 0.02 109 | 54500, 0.00347, 0.02 110 | 55000, 0.00372, 0.02 111 | 55500, 0.00356, 0.02 112 | 56000, 0.00346, 0.02 113 | 56500, 0.00373, 0.02 114 | 57000, 0.00329, 0.02 115 | 57500, 0.00378, 0.02 116 | 58000, 0.00354, 0.02 117 | 58500, 0.00353, 0.02 118 | 59000, 0.00368, 0.02 119 | 59500, 0.00372, 0.02 120 | 60000, 0.00345, 0.02 121 | 60500, 0.00371, 0.02 122 | 61000, 0.00315, 0.02 123 | 61500, 0.00358, 0.02 124 | 62000, 0.00373, 0.02 125 | 62500, 0.00325, 0.02 126 | 63000, 0.00354, 0.02 127 | 63500, 0.00337, 0.02 128 | 64000, 0.00367, 0.02 129 | 64500, 0.00333, 0.02 130 | 65000, 0.00357, 0.02 131 | 65500, 0.00317, 0.02 132 | 66000, 0.00333, 0.02 133 | 66500, 0.00355, 0.02 134 | 67000, 0.00349, 0.02 135 | 67500, 0.00330, 0.02 136 | 68000, 0.00336, 0.02 137 | 68500, 0.00307, 0.02 138 | 69000, 0.00349, 0.02 139 | 69500, 0.00338, 0.02 140 | 70000, 0.00370, 0.02 141 | 70500, 0.00368, 0.02 142 | 71000, 0.00358, 0.02 143 | 71500, 0.00341, 0.02 144 | 72000, 0.00312, 0.02 145 | 72500, 0.00363, 0.02 146 | 73000, 0.00350, 0.02 147 | 73500, 0.00311, 0.02 148 | 74000, 0.00291, 0.02 149 | 74500, 0.00331, 0.02 150 | 75000, 0.00334, 0.02 151 | 75500, 0.00322, 0.02 152 | 76000, 0.00335, 0.02 153 | 76500, 0.00323, 0.02 154 | 77000, 0.00312, 0.02 155 | 77500, 0.00321, 0.02 156 | 78000, 0.00308, 0.02 157 | 78500, 0.00319, 0.02 158 | 79000, 0.00331, 0.02 159 | 79500, 0.00334, 0.02 160 | 80000, 0.00323, 0.02 161 | 80500, 0.00317, 0.02 162 | 81000, 0.00343, 0.02 163 | 81500, 0.00293, 0.02 164 | 82000, 0.00315, 0.02 165 | 82500, 0.00320, 0.02 166 | 83000, 0.00298, 0.02 167 | 83500, 0.00323, 0.02 168 | 84000, 0.00291, 0.02 169 | 84500, 0.00302, 0.02 170 | 85000, 0.00311, 0.02 171 | 85500, 0.00334, 0.02 172 | 86000, 0.00311, 0.02 173 | 86500, 0.00315, 0.02 174 | 87000, 0.00329, 0.02 175 | 87500, 0.00292, 0.02 176 | 88000, 0.00297, 0.02 177 | 88500, 0.00335, 0.02 178 | 89000, 0.00289, 0.02 179 | 89500, 0.00314, 0.02 180 | 90000, 0.00308, 0.02 181 | 90500, 0.00311, 0.02 182 | 91000, 0.00295, 0.02 183 | 91500, 0.00307, 0.02 184 | 92000, 0.00307, 0.02 185 | 92500, 0.00287, 0.02 186 | 93000, 0.00349, 0.02 187 | 93500, 0.00299, 0.02 188 | 94000, 0.00304, 0.02 189 | 94500, 0.00318, 0.02 190 | 95000, 0.00323, 0.02 191 | 95500, 0.00312, 0.02 192 | 96000, 0.00289, 0.02 193 | 96500, 0.00285, 0.02 194 | 97000, 0.00287, 0.02 195 | 97500, 0.00285, 0.02 196 | 98000, 0.00283, 0.02 197 | 98500, 0.00298, 0.02 198 | 99000, 0.00284, 0.02 199 | 99500, 0.00299, 0.02 200 | 100000, 0.00290, 0.02 201 | -------------------------------------------------------------------------------- /ResultsComparison/learning_stats_shuffle2.csv: -------------------------------------------------------------------------------- 1 | 500, 0.02909, 0.005 2 | 1000, 0.01221, 0.005 3 | 1500, 0.00931, 0.005 4 | 2000, 0.00823, 0.005 5 | 2500, 0.00797, 0.005 6 | 3000, 0.00724, 0.005 7 | 3500, 0.00648, 0.005 8 | 4000, 0.00611, 0.005 9 | 4500, 0.00627, 0.005 10 | 5000, 0.00567, 0.005 11 | 5500, 0.00549, 0.005 12 | 6000, 0.00511, 0.005 13 | 6500, 0.00505, 0.005 14 | 7000, 0.00494, 0.005 15 | 7500, 0.00475, 0.005 16 | 8000, 0.00442, 0.005 17 | 8500, 0.00437, 0.005 18 | 9000, 0.00453, 0.005 19 | 9500, 0.00448, 0.005 20 | 10000, 0.00430, 0.005 21 | 10500, 0.00653, 0.02 22 | 11000, 0.00659, 0.02 23 | 11500, 0.00546, 0.02 24 | 12000, 0.00561, 0.02 25 | 12500, 0.00492, 0.02 26 | 13000, 0.00483, 0.02 27 | 13500, 0.00454, 0.02 28 | 14000, 0.00425, 0.02 29 | 14500, 0.00441, 0.02 30 | 15000, 0.00430, 0.02 31 | 15500, 0.00425, 0.02 32 | 16000, 0.00383, 0.02 33 | 16500, 0.00387, 0.02 34 | 17000, 0.00378, 0.02 35 | 17500, 0.00380, 0.02 36 | 18000, 0.00356, 0.02 37 | 18500, 0.00363, 0.02 38 | 19000, 0.00382, 0.02 39 | 19500, 0.00387, 0.02 40 | 20000, 0.00314, 0.02 41 | 20500, 0.00352, 0.02 42 | 21000, 0.00323, 0.02 43 | 21500, 0.00340, 0.02 44 | 22000, 0.00304, 0.02 45 | 22500, 0.00324, 0.02 46 | 23000, 0.00308, 0.02 47 | 23500, 0.00295, 0.02 48 | 24000, 0.00295, 0.02 49 | 24500, 0.00322, 0.02 50 | 25000, 0.00301, 0.02 51 | 25500, 0.00294, 0.02 52 | 26000, 0.00296, 0.02 53 | 26500, 0.00295, 0.02 54 | 27000, 0.00299, 0.02 55 | 27500, 0.00271, 0.02 56 | 28000, 0.00276, 0.02 57 | 28500, 0.00274, 0.02 58 | 29000, 0.00308, 0.02 59 | 29500, 0.00296, 0.02 60 | 30000, 0.00287, 0.02 61 | 30500, 0.00280, 0.02 62 | 31000, 0.00292, 0.02 63 | 31500, 0.00269, 0.02 64 | 32000, 0.00264, 0.02 65 | 32500, 0.00276, 0.02 66 | 33000, 0.00244, 0.02 67 | 33500, 0.00271, 0.02 68 | 34000, 0.00275, 0.02 69 | 34500, 0.00267, 0.02 70 | 35000, 0.00262, 0.02 71 | 35500, 0.00233, 0.02 72 | 36000, 0.00245, 0.02 73 | 36500, 0.00255, 0.02 74 | 37000, 0.00244, 0.02 75 | 37500, 0.00261, 0.02 76 | 38000, 0.00245, 0.02 77 | 38500, 0.00243, 0.02 78 | 39000, 0.00242, 0.02 79 | 39500, 0.00231, 0.02 80 | 40000, 0.00249, 0.02 81 | 40500, 0.00253, 0.02 82 | 41000, 0.00233, 0.02 83 | 41500, 0.00231, 0.02 84 | 42000, 0.00232, 0.02 85 | 42500, 0.00209, 0.02 86 | 43000, 0.00209, 0.02 87 | 43500, 0.00245, 0.02 88 | 44000, 0.00249, 0.02 89 | 44500, 0.00233, 0.02 90 | 45000, 0.00237, 0.02 91 | 45500, 0.00237, 0.02 92 | 46000, 0.00224, 0.02 93 | 46500, 0.00232, 0.02 94 | 47000, 0.00220, 0.02 95 | 47500, 0.00219, 0.02 96 | 48000, 0.00216, 0.02 97 | 48500, 0.00214, 0.02 98 | 49000, 0.00229, 0.02 99 | 49500, 0.00222, 0.02 100 | 50000, 0.00223, 0.02 101 | 50500, 0.00217, 0.02 102 | 51000, 0.00228, 0.02 103 | 51500, 0.00216, 0.02 104 | 52000, 0.00222, 0.02 105 | 52500, 0.00202, 0.02 106 | 53000, 0.00197, 0.02 107 | 53500, 0.00211, 0.02 108 | 54000, 0.00207, 0.02 109 | 54500, 0.00216, 0.02 110 | 55000, 0.00212, 0.02 111 | 55500, 0.00210, 0.02 112 | 56000, 0.00190, 0.02 113 | 56500, 0.00214, 0.02 114 | 57000, 0.00196, 0.02 115 | 57500, 0.00202, 0.02 116 | 58000, 0.00198, 0.02 117 | 58500, 0.00201, 0.02 118 | 59000, 0.00217, 0.02 119 | 59500, 0.00203, 0.02 120 | 60000, 0.00196, 0.02 121 | 60500, 0.00203, 0.02 122 | 61000, 0.00204, 0.02 123 | 61500, 0.00198, 0.02 124 | 62000, 0.00197, 0.02 125 | 62500, 0.00188, 0.02 126 | 63000, 0.00198, 0.02 127 | 63500, 0.00195, 0.02 128 | 64000, 0.00183, 0.02 129 | 64500, 0.00191, 0.02 130 | 65000, 0.00204, 0.02 131 | 65500, 0.00187, 0.02 132 | 66000, 0.00178, 0.02 133 | 66500, 0.00187, 0.02 134 | 67000, 0.00178, 0.02 135 | 67500, 0.00181, 0.02 136 | 68000, 0.00189, 0.02 137 | 68500, 0.00176, 0.02 138 | 69000, 0.00188, 0.02 139 | 69500, 0.00195, 0.02 140 | 70000, 0.00193, 0.02 141 | 70500, 0.00177, 0.02 142 | 71000, 0.00179, 0.02 143 | 71500, 0.00174, 0.02 144 | 72000, 0.00182, 0.02 145 | 72500, 0.00176, 0.02 146 | 73000, 0.00180, 0.02 147 | 73500, 0.00180, 0.02 148 | 74000, 0.00179, 0.02 149 | 74500, 0.00180, 0.02 150 | 75000, 0.00188, 0.02 151 | 75500, 0.00175, 0.02 152 | 76000, 0.00172, 0.02 153 | 76500, 0.00188, 0.02 154 | 77000, 0.00167, 0.02 155 | 77500, 0.00189, 0.02 156 | 78000, 0.00176, 0.02 157 | 78500, 0.00181, 0.02 158 | 79000, 0.00184, 0.02 159 | 79500, 0.00195, 0.02 160 | 80000, 0.00164, 0.02 161 | 80500, 0.00173, 0.02 162 | 81000, 0.00167, 0.02 163 | 81500, 0.00178, 0.02 164 | 82000, 0.00174, 0.02 165 | 82500, 0.00169, 0.02 166 | 83000, 0.00171, 0.02 167 | 83500, 0.00178, 0.02 168 | 84000, 0.00161, 0.02 169 | 84500, 0.00166, 0.02 170 | 85000, 0.00166, 0.02 171 | 85500, 0.00168, 0.02 172 | 86000, 0.00163, 0.02 173 | 86500, 0.00161, 0.02 174 | 87000, 0.00166, 0.02 175 | 87500, 0.00198, 0.02 176 | 88000, 0.00176, 0.02 177 | 88500, 0.00183, 0.02 178 | 89000, 0.00154, 0.02 179 | 89500, 0.00169, 0.02 180 | 90000, 0.00160, 0.02 181 | 90500, 0.00156, 0.02 182 | 91000, 0.00160, 0.02 183 | 91500, 0.00154, 0.02 184 | 92000, 0.00158, 0.02 185 | 92500, 0.00160, 0.02 186 | 93000, 0.00162, 0.02 187 | 93500, 0.00160, 0.02 188 | 94000, 0.00158, 0.02 189 | 94500, 0.00167, 0.02 190 | 95000, 0.00153, 0.02 191 | 95500, 0.00157, 0.02 192 | 96000, 0.00174, 0.02 193 | 96500, 0.00153, 0.02 194 | 97000, 0.00168, 0.02 195 | 97500, 0.00163, 0.02 196 | 98000, 0.00158, 0.02 197 | 98500, 0.00152, 0.02 198 | 99000, 0.00151, 0.02 199 | 99500, 0.00155, 0.02 200 | 100000, 0.00155, 0.02 201 | -------------------------------------------------------------------------------- /ResultsComparison/learning_stats_shuffle3.csv: -------------------------------------------------------------------------------- 1 | 500, 0.02980, 0.005 2 | 1000, 0.01612, 0.005 3 | 1500, 0.01376, 0.005 4 | 2000, 0.01303, 0.005 5 | 2500, 0.01114, 0.005 6 | 3000, 0.01106, 0.005 7 | 3500, 0.00763, 0.005 8 | 4000, 0.00873, 0.005 9 | 4500, 0.00754, 0.005 10 | 5000, 0.00770, 0.005 11 | 5500, 0.00769, 0.005 12 | 6000, 0.00630, 0.005 13 | 6500, 0.00737, 0.005 14 | 7000, 0.00698, 0.005 15 | 7500, 0.00665, 0.005 16 | 8000, 0.00609, 0.005 17 | 8500, 0.00528, 0.005 18 | 9000, 0.00611, 0.005 19 | 9500, 0.00665, 0.005 20 | 10000, 0.00678, 0.005 21 | 10500, 0.00914, 0.02 22 | 11000, 0.00795, 0.02 23 | 11500, 0.01043, 0.02 24 | 12000, 0.00765, 0.02 25 | 12500, 0.00733, 0.02 26 | 13000, 0.00714, 0.02 27 | 13500, 0.00716, 0.02 28 | 14000, 0.00689, 0.02 29 | 14500, 0.00595, 0.02 30 | 15000, 0.00676, 0.02 31 | 15500, 0.00620, 0.02 32 | 16000, 0.00690, 0.02 33 | 16500, 0.00533, 0.02 34 | 17000, 0.00633, 0.02 35 | 17500, 0.00559, 0.02 36 | 18000, 0.00677, 0.02 37 | 18500, 0.00531, 0.02 38 | 19000, 0.00460, 0.02 39 | 19500, 0.00547, 0.02 40 | 20000, 0.00656, 0.02 41 | 20500, 0.00565, 0.02 42 | 21000, 0.00540, 0.02 43 | 21500, 0.00573, 0.02 44 | 22000, 0.00539, 0.02 45 | 22500, 0.00504, 0.02 46 | 23000, 0.00370, 0.02 47 | 23500, 0.00523, 0.02 48 | 24000, 0.00500, 0.02 49 | 24500, 0.00590, 0.02 50 | 25000, 0.00661, 0.02 51 | 25500, 0.00461, 0.02 52 | 26000, 0.00418, 0.02 53 | 26500, 0.00501, 0.02 54 | 27000, 0.00383, 0.02 55 | 27500, 0.00440, 0.02 56 | 28000, 0.00590, 0.02 57 | 28500, 0.00554, 0.02 58 | 29000, 0.00475, 0.02 59 | 29500, 0.00472, 0.02 60 | 30000, 0.00443, 0.02 61 | 30500, 0.00476, 0.02 62 | 31000, 0.00389, 0.02 63 | 31500, 0.00417, 0.02 64 | 32000, 0.00359, 0.02 65 | 32500, 0.00432, 0.02 66 | 33000, 0.00408, 0.02 67 | 33500, 0.00473, 0.02 68 | 34000, 0.00395, 0.02 69 | 34500, 0.00478, 0.02 70 | 35000, 0.00444, 0.02 71 | 35500, 0.00505, 0.02 72 | 36000, 0.00406, 0.02 73 | 36500, 0.00341, 0.02 74 | 37000, 0.00373, 0.02 75 | 37500, 0.00470, 0.02 76 | 38000, 0.00345, 0.02 77 | 38500, 0.00369, 0.02 78 | 39000, 0.00403, 0.02 79 | 39500, 0.00401, 0.02 80 | 40000, 0.00391, 0.02 81 | 40500, 0.00363, 0.02 82 | 41000, 0.00438, 0.02 83 | 41500, 0.00380, 0.02 84 | 42000, 0.00366, 0.02 85 | 42500, 0.00337, 0.02 86 | 43000, 0.00351, 0.02 87 | 43500, 0.00344, 0.02 88 | 44000, 0.00362, 0.02 89 | 44500, 0.00427, 0.02 90 | 45000, 0.00329, 0.02 91 | 45500, 0.00549, 0.02 92 | 46000, 0.00396, 0.02 93 | 46500, 0.00311, 0.02 94 | 47000, 0.00304, 0.02 95 | 47500, 0.00393, 0.02 96 | 48000, 0.00317, 0.02 97 | 48500, 0.00500, 0.02 98 | 49000, 0.00315, 0.02 99 | 49500, 0.00496, 0.02 100 | 50000, 0.00465, 0.02 101 | 50500, 0.00430, 0.02 102 | 51000, 0.00394, 0.02 103 | 51500, 0.00400, 0.02 104 | 52000, 0.00406, 0.02 105 | 52500, 0.00447, 0.02 106 | 53000, 0.00375, 0.02 107 | 53500, 0.00379, 0.02 108 | 54000, 0.00309, 0.02 109 | 54500, 0.00310, 0.02 110 | 55000, 0.00445, 0.02 111 | 55500, 0.00382, 0.02 112 | 56000, 0.00359, 0.02 113 | 56500, 0.00369, 0.02 114 | 57000, 0.00396, 0.02 115 | 57500, 0.00278, 0.02 116 | 58000, 0.00283, 0.02 117 | 58500, 0.00357, 0.02 118 | 59000, 0.00300, 0.02 119 | 59500, 0.00443, 0.02 120 | 60000, 0.00363, 0.02 121 | 60500, 0.00359, 0.02 122 | 61000, 0.00260, 0.02 123 | 61500, 0.00318, 0.02 124 | 62000, 0.00374, 0.02 125 | 62500, 0.00330, 0.02 126 | 63000, 0.00404, 0.02 127 | 63500, 0.00382, 0.02 128 | 64000, 0.00398, 0.02 129 | 64500, 0.00293, 0.02 130 | 65000, 0.00349, 0.02 131 | 65500, 0.00323, 0.02 132 | 66000, 0.00351, 0.02 133 | 66500, 0.00428, 0.02 134 | 67000, 0.00373, 0.02 135 | 67500, 0.00317, 0.02 136 | 68000, 0.00374, 0.02 137 | 68500, 0.00373, 0.02 138 | 69000, 0.00418, 0.02 139 | 69500, 0.00440, 0.02 140 | 70000, 0.00320, 0.02 141 | 70500, 0.00304, 0.02 142 | 71000, 0.00353, 0.02 143 | 71500, 0.00391, 0.02 144 | 72000, 0.00349, 0.02 145 | 72500, 0.00278, 0.02 146 | 73000, 0.00340, 0.02 147 | 73500, 0.00247, 0.02 148 | 74000, 0.00324, 0.02 149 | 74500, 0.00336, 0.02 150 | 75000, 0.00523, 0.02 151 | 75500, 0.00265, 0.02 152 | 76000, 0.00329, 0.02 153 | 76500, 0.00291, 0.02 154 | 77000, 0.00302, 0.02 155 | 77500, 0.00378, 0.02 156 | 78000, 0.00339, 0.02 157 | 78500, 0.00270, 0.02 158 | 79000, 0.00307, 0.02 159 | 79500, 0.00312, 0.02 160 | 80000, 0.00257, 0.02 161 | 80500, 0.00321, 0.02 162 | 81000, 0.00317, 0.02 163 | 81500, 0.00266, 0.02 164 | 82000, 0.00343, 0.02 165 | 82500, 0.00313, 0.02 166 | 83000, 0.00401, 0.02 167 | 83500, 0.00311, 0.02 168 | 84000, 0.00320, 0.02 169 | 84500, 0.00334, 0.02 170 | 85000, 0.00311, 0.02 171 | 85500, 0.00295, 0.02 172 | 86000, 0.00297, 0.02 173 | 86500, 0.00263, 0.02 174 | 87000, 0.00351, 0.02 175 | 87500, 0.00340, 0.02 176 | 88000, 0.00280, 0.02 177 | 88500, 0.00427, 0.02 178 | 89000, 0.00336, 0.02 179 | 89500, 0.00296, 0.02 180 | 90000, 0.00328, 0.02 181 | 90500, 0.00325, 0.02 182 | 91000, 0.00260, 0.02 183 | 91500, 0.00362, 0.02 184 | 92000, 0.00290, 0.02 185 | 92500, 0.00358, 0.02 186 | 93000, 0.00352, 0.02 187 | 93500, 0.00284, 0.02 188 | 94000, 0.00340, 0.02 189 | 94500, 0.00242, 0.02 190 | 95000, 0.00262, 0.02 191 | 95500, 0.00365, 0.02 192 | 96000, 0.00276, 0.02 193 | 96500, 0.00300, 0.02 194 | 97000, 0.00307, 0.02 195 | 97500, 0.00365, 0.02 196 | 98000, 0.00389, 0.02 197 | 98500, 0.00303, 0.02 198 | 99000, 0.00301, 0.02 199 | 99500, 0.00369, 0.02 200 | 100000, 0.00332, 0.02 201 | -------------------------------------------------------------------------------- /ResultsComparison/m3v1mp4.mp4: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DeepLabCut/Primer-MotionCapture/ee595bb14ad89d5a6e2b412ce28962f5607cad77/ResultsComparison/m3v1mp4.mp4 -------------------------------------------------------------------------------- /ResultsComparison/m3v1mp4DLC_resnet50_openfieldOct30shuffle1_100000.h5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DeepLabCut/Primer-MotionCapture/ee595bb14ad89d5a6e2b412ce28962f5607cad77/ResultsComparison/m3v1mp4DLC_resnet50_openfieldOct30shuffle1_100000.h5 -------------------------------------------------------------------------------- /ResultsComparison/m3v1mp4DLC_resnet50_openfieldOct30shuffle2_100000.h5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DeepLabCut/Primer-MotionCapture/ee595bb14ad89d5a6e2b412ce28962f5607cad77/ResultsComparison/m3v1mp4DLC_resnet50_openfieldOct30shuffle2_100000.h5 -------------------------------------------------------------------------------- /ResultsComparison/m3v1mp4DLC_resnet50_openfieldOct30shuffle3_100000.h5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DeepLabCut/Primer-MotionCapture/ee595bb14ad89d5a6e2b412ce28962f5607cad77/ResultsComparison/m3v1mp4DLC_resnet50_openfieldOct30shuffle3_100000.h5 -------------------------------------------------------------------------------- /ResultsComparisonFrames/frame0115imgaugstartframe.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DeepLabCut/Primer-MotionCapture/ee595bb14ad89d5a6e2b412ce28962f5607cad77/ResultsComparisonFrames/frame0115imgaugstartframe.png -------------------------------------------------------------------------------- /ResultsComparisonFrames/frame0115imgaugstopframe.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DeepLabCut/Primer-MotionCapture/ee595bb14ad89d5a6e2b412ce28962f5607cad77/ResultsComparisonFrames/frame0115imgaugstopframe.png -------------------------------------------------------------------------------- /ResultsComparisonFrames/frame0115scalecropstartframe.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DeepLabCut/Primer-MotionCapture/ee595bb14ad89d5a6e2b412ce28962f5607cad77/ResultsComparisonFrames/frame0115scalecropstartframe.png -------------------------------------------------------------------------------- /ResultsComparisonFrames/frame0115scalecropstopframe.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DeepLabCut/Primer-MotionCapture/ee595bb14ad89d5a6e2b412ce28962f5607cad77/ResultsComparisonFrames/frame0115scalecropstopframe.png -------------------------------------------------------------------------------- /ResultsComparisonFrames/frame0115tensorpackstartframe.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DeepLabCut/Primer-MotionCapture/ee595bb14ad89d5a6e2b412ce28962f5607cad77/ResultsComparisonFrames/frame0115tensorpackstartframe.png -------------------------------------------------------------------------------- /ResultsComparisonFrames/frame0115tensorpackstopframe.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DeepLabCut/Primer-MotionCapture/ee595bb14ad89d5a6e2b412ce28962f5607cad77/ResultsComparisonFrames/frame0115tensorpackstopframe.png -------------------------------------------------------------------------------- /ResultsCorruption/LabelingCorruptionimpact_10Percent.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DeepLabCut/Primer-MotionCapture/ee595bb14ad89d5a6e2b412ce28962f5607cad77/ResultsCorruption/LabelingCorruptionimpact_10Percent.png -------------------------------------------------------------------------------- /ResultsCorruption/LabelingCorruptionimpact_20Percent.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DeepLabCut/Primer-MotionCapture/ee595bb14ad89d5a6e2b412ce28962f5607cad77/ResultsCorruption/LabelingCorruptionimpact_20Percent.png -------------------------------------------------------------------------------- /ResultsCorruption/LabelingCorruptionimpact_50Percent.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DeepLabCut/Primer-MotionCapture/ee595bb14ad89d5a6e2b412ce28962f5607cad77/ResultsCorruption/LabelingCorruptionimpact_50Percent.png -------------------------------------------------------------------------------- /ResultsCorruption/LabelingCorruptionimpact_5Percent.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DeepLabCut/Primer-MotionCapture/ee595bb14ad89d5a6e2b412ce28962f5607cad77/ResultsCorruption/LabelingCorruptionimpact_5Percent.png -------------------------------------------------------------------------------- /ResultsCorruption/LabelingCorruptionimpact_80Percent.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DeepLabCut/Primer-MotionCapture/ee595bb14ad89d5a6e2b412ce28962f5607cad77/ResultsCorruption/LabelingCorruptionimpact_80Percent.png -------------------------------------------------------------------------------- /ResultsCorruption/LabelingCorruptionimpact_90Percent.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DeepLabCut/Primer-MotionCapture/ee595bb14ad89d5a6e2b412ce28962f5607cad77/ResultsCorruption/LabelingCorruptionimpact_90Percent.png -------------------------------------------------------------------------------- /ResultsCorruption/data_corruption_experiments.pickle: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DeepLabCut/Primer-MotionCapture/ee595bb14ad89d5a6e2b412ce28962f5607cad77/ResultsCorruption/data_corruption_experiments.pickle -------------------------------------------------------------------------------- /augmentationexamples/montblanc_images_img0071_joint.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DeepLabCut/Primer-MotionCapture/ee595bb14ad89d5a6e2b412ce28962f5607cad77/augmentationexamples/montblanc_images_img0071_joint.jpg -------------------------------------------------------------------------------- /augmentationexamples/montblanc_images_img0071_joint.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DeepLabCut/Primer-MotionCapture/ee595bb14ad89d5a6e2b412ce28962f5607cad77/augmentationexamples/montblanc_images_img0071_joint.png -------------------------------------------------------------------------------- /augmentationexamples/montblanc_images_img0155_joint.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DeepLabCut/Primer-MotionCapture/ee595bb14ad89d5a6e2b412ce28962f5607cad77/augmentationexamples/montblanc_images_img0155_joint.jpg -------------------------------------------------------------------------------- /augmentationexamples/montblanc_images_img0293_joint.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DeepLabCut/Primer-MotionCapture/ee595bb14ad89d5a6e2b412ce28962f5607cad77/augmentationexamples/montblanc_images_img0293_joint.jpg -------------------------------------------------------------------------------- /augmentationexamples/montblanc_images_img0293_joint.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DeepLabCut/Primer-MotionCapture/ee595bb14ad89d5a6e2b412ce28962f5607cad77/augmentationexamples/montblanc_images_img0293_joint.png -------------------------------------------------------------------------------- /augmentationexamples/montblanc_images_img0382_joint.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DeepLabCut/Primer-MotionCapture/ee595bb14ad89d5a6e2b412ce28962f5607cad77/augmentationexamples/montblanc_images_img0382_joint.jpg -------------------------------------------------------------------------------- /augmentationexamples/montblanc_images_img0719_joint.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DeepLabCut/Primer-MotionCapture/ee595bb14ad89d5a6e2b412ce28962f5607cad77/augmentationexamples/montblanc_images_img0719_joint.jpg -------------------------------------------------------------------------------- /augmentationexamples/montblanc_images_img1164_joint.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DeepLabCut/Primer-MotionCapture/ee595bb14ad89d5a6e2b412ce28962f5607cad77/augmentationexamples/montblanc_images_img1164_joint.jpg -------------------------------------------------------------------------------- /augmentationexamples/mouse_m7s3_img0019_joint.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DeepLabCut/Primer-MotionCapture/ee595bb14ad89d5a6e2b412ce28962f5607cad77/augmentationexamples/mouse_m7s3_img0019_joint.jpg -------------------------------------------------------------------------------- /augmentationexamples/mouse_m7s3_img0019_joint.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DeepLabCut/Primer-MotionCapture/ee595bb14ad89d5a6e2b412ce28962f5607cad77/augmentationexamples/mouse_m7s3_img0019_joint.png -------------------------------------------------------------------------------- /augmentationexamples/mouse_m7s3_img0039_joint.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DeepLabCut/Primer-MotionCapture/ee595bb14ad89d5a6e2b412ce28962f5607cad77/augmentationexamples/mouse_m7s3_img0039_joint.jpg -------------------------------------------------------------------------------- /augmentationexamples/mouse_m7s3_img0039_joint.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DeepLabCut/Primer-MotionCapture/ee595bb14ad89d5a6e2b412ce28962f5607cad77/augmentationexamples/mouse_m7s3_img0039_joint.png -------------------------------------------------------------------------------- /montblanc_images/CollectedData_Daniel.h5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DeepLabCut/Primer-MotionCapture/ee595bb14ad89d5a6e2b412ce28962f5607cad77/montblanc_images/CollectedData_Daniel.h5 -------------------------------------------------------------------------------- /montblanc_images/img0071.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DeepLabCut/Primer-MotionCapture/ee595bb14ad89d5a6e2b412ce28962f5607cad77/montblanc_images/img0071.png -------------------------------------------------------------------------------- /montblanc_images/img0155.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DeepLabCut/Primer-MotionCapture/ee595bb14ad89d5a6e2b412ce28962f5607cad77/montblanc_images/img0155.png -------------------------------------------------------------------------------- /montblanc_images/img0293.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DeepLabCut/Primer-MotionCapture/ee595bb14ad89d5a6e2b412ce28962f5607cad77/montblanc_images/img0293.png -------------------------------------------------------------------------------- /montblanc_images/img0382.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DeepLabCut/Primer-MotionCapture/ee595bb14ad89d5a6e2b412ce28962f5607cad77/montblanc_images/img0382.png -------------------------------------------------------------------------------- /montblanc_images/img0719.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DeepLabCut/Primer-MotionCapture/ee595bb14ad89d5a6e2b412ce28962f5607cad77/montblanc_images/img0719.png -------------------------------------------------------------------------------- /montblanc_images/img1164.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DeepLabCut/Primer-MotionCapture/ee595bb14ad89d5a6e2b412ce28962f5607cad77/montblanc_images/img1164.png -------------------------------------------------------------------------------- /mouse_m7s3/CollectedData_Pranav.h5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DeepLabCut/Primer-MotionCapture/ee595bb14ad89d5a6e2b412ce28962f5607cad77/mouse_m7s3/CollectedData_Pranav.h5 -------------------------------------------------------------------------------- /mouse_m7s3/img0019.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DeepLabCut/Primer-MotionCapture/ee595bb14ad89d5a6e2b412ce28962f5607cad77/mouse_m7s3/img0019.png -------------------------------------------------------------------------------- /mouse_m7s3/img0039.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DeepLabCut/Primer-MotionCapture/ee595bb14ad89d5a6e2b412ce28962f5607cad77/mouse_m7s3/img0039.png --------------------------------------------------------------------------------