Giter VIP home page Giter VIP logo

atrw_ensemble_hrnet's Introduction

Tiger Pose Estimation - Ensemble learning on HRNet

An ensemble technique applied on High Resolution net to improve accuracy on pose detection task. This project was carried out as a part of CVWC-2019 for ICCV 2019 - Amur Tiger re-Identification challenge.

Method Description

The key aspect of our approach was to improve on the corner cases on already effective HRNet network. For this reason, the following methodology was adopted:

  1. We conducted experiments with multi resolution images to test the effect of resolution on the model. We finally settled on 640x480 input size.
  2. During training we adopted a 5 fold split on the entire train+validation dataset.
  3. For improving the accuracy during inference, the 5 fold split was ensembled using multiple approaches - average ensemble, bagging ensemble and random forest ensemble for obtaining the best results from the solution. For the submission we have selected average ensemble as it performed the best in our experiments.
  4. All the models used we trained on HRNet-W32 network which were pre-trained on ImageNet dataset.

Folder structure for pretrained model

HEAD
|__models
   |__pytorch
      |__imagenet
         |__hrnet_w32-36af842e.pth

Folder structure for dataset

HEAD
|__data
   |__tiger
      |__images
      |  |__train
      |  |__test
      |  |__val
      |__annotations
         |__<train_annotations>
         |__<test_annotations>
         |__bb_predictions_pose_test.json <GT bboxes for test dataset>

Folder structure for output directory (Taken care by the code)

HEAD
|__output (or whatever name was specified in the config or Notebook)
   |__<dataset>
       |__pose_hrnet
          |__<config>
             |__contains results and intermediate training results

Data Preparation

All trained models and pretrained models are available here: Drive_Link_For_models

The pretrained model needs to be placed as per the instructions above for the pretrained model.

For the trained models, each model must be placed in separate directories as the code looks for model directories and not model-paths( we are working on fixing that as well)

for eg:

{ROOT}
|__trained
   |__<resolution>
       |__model1
       |  |__final_state.pth
       |__model2
       |  |__final_state.pth
       |....
       :
       :

Running the Experiments

The experiment requires you to create 5 directories named output1, output2.... These will store the trained output models. The trained models are fed to a predictor which runs evaluation on the val/test dataset to obtain the final outputs. The outputs and the GTs are passed to the evaluator script which scores and returns the performance metrics to us. To run the above mentioned scenario do the following:

  1. Create your conda environment from the '.yaml' file provided in the root directory.
conda env create -f pose-env.yaml
  1. Run the commands
   mkdir output
   mkdir log
  1. Go to the lib directory and run make. This builds the nms library
  2. Also install pycocotools
  3. Your basic setup is ready.

Training the 5-Fold training model

Run the following command:

python tools/train.py \
    --cfg experiments/coco/hrnet/w32_256x192_adam_lr1e-3.yaml

Remember to change the config file path to suite your requirements.

Test a sample

python tools/test.py \
   --cfg experiments/coco/hrnet/w32_256x192_adam_lr1e-3.yaml

Ensemble Testing

All the ensemble code has been kept in the interactive python Notebook situated here:

<root>/tools/ensemble-hrnet.ipynb

Follow the instructions in sequence in the notebook.

References

[1] Deep High-Resolution Representation Learning for Human Pose Estimation. Ke Sun, Bin Xiao, Dong Liu, and Jingdong Wang. CVPR 2019. download

atrw_ensemble_hrnet's People

Contributors

amajee11us avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.