A Pytorch implementation of Convolutional Pose Machine(CPM) and Feature Pyramid Netword(FPN) for FashionAI Key Points Detection
This code references some of the ideas of others on github and is based on the paper realtime multi-person pose estimation in CVPR'17 (Oral) . The final result is 56 on the leaderboard, and the score is 6.38%. It is not bad for me a freshman in the DeepLearning :) You can take the code as your baseline solution.
There are some visiable results as follows:
You can reproduce my result by following steps.
- Python version 3.5
- Numpy
- Pandas
- PyTorch
- cv2
- tqdm
- Keras(TensorFlow backend)
Download FashionAI dataset and put files in such structure:
step1: make sure that your image data and annotations are in the fold 'data'.The data directory structure is as follows:
DATA_DIR/
|-- test/
| |-- test.csv
| |-- Images/
| | |-- blouse
| | |-- ...
|-- train/
| |-- Annotations/
| | |-- train.csv
| |-- Images/
| | |-- blouse
| | |-- ...
|-- ...
-
MASK-RCNN for detecting fashion location (put the prameters file in the $ROOT/utils/)
-
resnet-50 in Pytorch (put the prameters file in the $ROOT/detection/model/)
-
After putting all the data in the appropriate directory. You should first run the
$ROOT/code/data_preprocess.py
to preprocess the raw data. -
For training, you can just run the
$ROOT/code/train_net.py
, the training process took me about 6 hours with one GPU(1080Ti). Also you can modify the$ROOT/code/config.yml
just fit your environment. The parameters will be saved in the path of$ROOT/saveparameter/
-
Also you can take my trained model parameters for pretrained model or demo test. click here to download.
-
After training your models, you should first run the
$ROOT/detection/code/getRoi.sh
for get the object locations information. The information will be saved in the path of$ROOT/detection/code/submit/
. We set additional margin for the detection bounding box, you can midify this configration in the$ROOT/detection/code/clothes_test_ori.py/
line 228. -
Then you should run the
$ROOT/code/submitDect.py
to gain your results.
- There are some papers I think worthy for reading, they are:
《Realtime Multi-person Pose Estimation》
《Cascaded Pyramid Network for Multi-Person Pose Estimation》
《Attentive Fashion Grammar Network for Fashion Landmark Detection and Clothing Category Classification》