This is my implementation of CPN on LSP. This implemetation is simple and computation is small (about 3.5G gpu). You can use this implementation for as first 2d-pose estimation project.
PyTorch (0.4 or later)
opencv-python
tensorboardX
numpy
- download resnet-50.pth from https://download.pytorch.org/models/resnet50-19c8e357.pth
- download LSP from http://sam.johnson.io/research/lsp_dataset.zip
- unzip lsp_dataset.zip. There are four parts(joints.mat,images,visualized,readme.txt)
- set utils/config.py. set pretrained(resnet50.pth), lsp_mat (path of joints.mat) , lsp_images(path of
images
dir) , weights_dir(where the model weights will be saved, not necessary), weights_name(the name of model weights, not necessary), tb_dir(where the tensorboardX will log the performance, not necessary) and other parameters. - start train
$ python train.py
$ tensorboard --logdir=logs/tblog --port=6006
or
$ tensorboard --logdir=your dir --port=6006
Then you can go to http://0.0.0.0:6006 .The results is shown as below:
- download cpn_lsp_without_ohkm_best.pth and code is s67b
$ python demo.py --img_path vis/test3.jpg --weights_path cpn_lsp_without_ohkm_best.pth --save_path vis/vis3.jpg
or use your weights after train.
Thanks alwc for providing dataloader and model define codes.