use tensorpack dataflow to improve augmentation#409
Conversation
|
@katierupp thanks very much! - Mackenzie |
|
Looks good, thanks for your contribution! Will test this soon. |
|
@AlexEMG Sounds great, thank you! I just added the compatible version of tensorpack to setup.py. |
|
Thanks for that contribution! I moved the defaults directly into https://github.com/AlexEMG/DeepLabCut/blob/master/deeplabcut/pose_estimation_tensorflow/dataset/pose_dataset_tensorpack.py I also added a testscript that https://github.com/AlexEMG/DeepLabCut/blob/master/examples/testscript_openfielddata_augmentationcomparison.py This is a test script to compare the loaders. tensorpack allows much more choices for augmentation. My results were: With standard loader: With tensorpack loader: |
|
@AlexEMG Looks good, thank you! |



I have added a different variation of the pose_dataset.py file that uses Tensorpack DataFlow to apply more types of augmentation during training to help the network generalize better. In addition to scaling and cropping, these types of augmentation include rotation, saturation, brightness, contrast, blur, and noise. All of the augmentation parameters are configurable through pose_cfg.yaml, so they can be optimized for any dataset.
We have tested augmentation on our own data, and there is a significant reduction in test error, as well as a noticeable visual improvement in the network's performance. The tests were run on a camera view that the network was not trained on. A figure of a bar chart is attached below to demonstrate how this augmentation compares to the previous implementation. Training time is comparable to the original version of DeepLabCut.
These changes were tested on Ubuntu 16.04. The output from testscript.py with the original pose_dataset.py, as well as the output from testscript.py using the tensorpack dataset can be found at https://gist.github.com/katierupp/893c3d314845c7eedfaad0837bb58f95.
.