This repository trains lightweight OpenPose (Real-time 2D Multi-Person Pose Estimation on CPU: Lightweight OpenPose) on CrowdPose dataset (CrowdPose: Efficient Crowded Scenes Pose Estimation and A New Benchmark), and it mainly follows the work of Daniil Osokin.
- Ubuntu 16.04
- Python 3.6
- PyTorch 0.4.1 (should also work with 1.0, but not tested)
- Download CrowdPose dataset: train/validation/test images + annotations to <CP_HOME>.
- Install the CrowdPose API: run
sh install.sh
under CrowdPose/crowdpose-api/PythonAPI/
-
Convert train annotations in internal format. Run
python scripts/prepare_cp_train_labels.py --labels <CP_HOME>/json/crowdpose_train.json
. It will produceprepared_cp_train_annotation.pkl
with converted in internal format annotations. -
To train from MobileNet weights, run
python train_cp.py --train-images-folder <CP_HOME>/images/ --prepared-train-labels prepared_cp_train_annotation.pkl --checkpoint-path <path_to>/mobilenet_sgd_68.848.pth.tar --from-mobilenet
-
Next, to train from checkpoint from previous step, run
python train_cp.py --train-images-folder <CP_HOME>/images/ --prepared-train-labels prepared_cp_train_annotation.pkl --checkpoint-path <path_to>/checkpoint_iter_420000.pth.tar --weights-only
-
Finally, to train from checkpoint from previous step and 3 refinement stages in network, run
python train_cp.py --train-images-folder <CP_HOME>/images/ --prepared-train-labels prepared_cp_train_annotation.pkl --checkpoint-path <path_to>/checkpoint_iter_280000.pth.tar --weights-only --num-refinement-stages 3
. We took checkpoint after 370000 iterations as the final one.