• Stars
    star
    575
  • Rank 77,622 (Top 2 %)
  • Language
    Jupyter Notebook
  • License
    Other
  • Created over 8 years ago
  • Updated over 7 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Training and experimentation code used for "Stacked Hourglass Networks for Human Pose Estimation"

Stacked Hourglass Networks for Human Pose Estimation (Training Code)

This is the training pipeline used for:

Alejandro Newell, Kaiyu Yang, and Jia Deng, Stacked Hourglass Networks for Human Pose Estimation, arXiv:1603.06937, 2016.

A pretrained model is available on the project site. You can use the option -loadModel path/to/model to try fine-tuning.

To run this code, make sure the following are installed:

Getting Started

Download the full MPII Human Pose dataset, and place the images directory in data/mpii. From there, it is as simple as running th main.lua -expID test-run (the experiment ID is arbitrary). To run on FLIC, again place the images in a directory data/flic/images then call th main.lua -dataset flic -expID test-run.

Most of the command line options are pretty self-explanatory, and can be found in src/opts.lua. The -expID option will be used to save important information in a directory like pose-hg-train/exp/mpii/test-run. This directory will include snapshots of the trained model, training/validations logs with loss and accuracy information, and details of the options set for that particular experiment.

Running experiments

There are a couple features to make experiments a bit easier:

  • Experiment can be continued with th main.lua -expID example-exp -continue it will pick up where the experiment left off with all of the same options set. But let's say you want to change an option like the learning rate, then you can do the same call as above but add the option -LR 1e-5 for example and it will preserve all old options except for the new learning rate.

  • In addition, the -branch option allows for the initialization of a new experiment directory leaving the original experiment intact. For example, if you have trained for a while and want to drop the learning rate but don't know what to change it to, you can do something like the following: th main.lua -branch old-exp -expID new-exp-01 -LR 1e-5 and then compare to a separate experiment th main.lua -branch old-exp -expID new-exp-02 -LR 5e-5.

In src/misc there's a simple script for monitoring a set of experiments to visualize and compare training curves.

Getting final predictions

To generate final test set predictions for MPII, you can call:

th main.lua -branch your-exp -expID final-preds -finalPredictions -nEpochs 0

This assumes there is an experiment that has already been run. If you just want to provide a pre-trained model, that's fine too and you can call:

th main.lua -expID final-preds -finalPredictions -nEpochs 0 -loadModel /path/to/model

Training accuracy metric

For convenience during training, the accuracy function evaluates PCK by comparing the output heatmap of the network to the ground truth heatmap. The normalization in this case will be slightly different than the normalization done when officially evaluating on FLIC or MPII. So there will be some discrepancy between the numbers, but the heatmap-based accuracy still provides a good picture of how well the network is learning during training.

Final notes

In the paper, the training time reported was with an older version of cuDNN, and after switching to cuDNN 4, training time was cut in half. Now, with a Titan X NVIDIA GPU, training time from scratch is under 3 days for MPII, and about 1 day for FLIC.

pypose/

Included in this repository is a folder with a bunch of old python code that I used. It hasn't been updated in a while, and might not be totally functional at the moment. There are a number of useful functions for doing evaluation and analysis on pose predictions and it is worth digging into. It will be updated and cleaned up soon.

Questions?

I am sure there is a lot not covered in the README at the moment so please get in touch if you run into any issues or have any questions!

Acknowledgements

Thanks to Soumith Chintala, this pipeline is largely built on his example ImageNet training code available at: https://github.com/soumith/imagenet-multiGPU.torch

More Repositories

1

infinigen

Infinite Photorealistic Worlds using Procedural Generation
Python
5,286
star
2

RAFT

Python
3,189
star
3

CornerNet

Python
2,355
star
4

CornerNet-Lite

Python
1,780
star
5

DROID-SLAM

Python
1,730
star
6

lietorch

Cuda
670
star
7

RAFT-Stereo

Python
667
star
8

DeepV2D

Python
651
star
9

DPVO

Deep Patch Visual Odometry/SLAM
C++
597
star
10

pytorch_stacked_hourglass

Pytorch implementation of the ECCV 2016 paper "Stacked Hourglass Networks for Human Pose Estimation"
Python
469
star
11

CoqGym

A Learning Environment for Theorem Proving with the Coq proof assistant
Coq
380
star
12

pose-ae-train

Training code for "Associative Embedding: End-to-End Learning for Joint Detection and Grouping"
Python
373
star
13

pose-hg-demo

Code to test and use the model from "Stacked Hourglass Networks for Human Pose Estimation"
Lua
316
star
14

SEA-RAFT

[ECCV2024 - Oral, Best Paper Award Candidate] SEA-RAFT: Simple, Efficient, Accurate RAFT for Optical Flow
Python
298
star
15

RAFT-3D

Python
229
star
16

SimpleView

Official Code for ICML 2021 paper "Revisiting Point Cloud Shape Classification with a Simple and Effective Baseline"
Python
154
star
17

px2graph

Training code for "Pixels to Graphs by Associative Embedding"
Python
133
star
18

relative_depth

Code for the NIPS 2016 paper
Lua
124
star
19

CER-MVS

Python
122
star
20

YouTube3D

Code for the CVPR 2019 paper "Learning Single-Image Depth from Videos using Quality Assessment Networks"
Python
106
star
21

Coupled-Iterative-Refinement

Python
105
star
22

pose-ae-demo

Python
97
star
23

MultiSlam_DiffPose

Jupyter Notebook
94
star
24

SNP

Official code for View Synthesis with Sculpted Neural Points
Python
83
star
25

DecorrelatedBN

Code for Decorrelated Batch Normalization
Lua
80
star
26

SpatialSense

An Adversarially Crowdsourced Benchmark for Spatial Relation Recognition
Python
70
star
27

oasis

Code for the CVPR 2020 paper "OASIS: A Large-Scale Dataset for Single Image 3D in the Wild"
MATLAB
64
star
28

selfstudy

Code for reproducing experiments in "How Useful is Self-Supervised Pretraining for Visual Tasks?"
Python
60
star
29

PackIt

Code for reproducing results in ICML 2020 paper "PackIt: A Virtual Environment for Geometric Planning"
Jupyter Notebook
52
star
30

d3dhelper

Unofficial sample code for Distilled 3D Networks (D3D) in Tensorflow.
Jupyter Notebook
48
star
31

Oriented1D

Official code for ICCV 2023 paper "Convolutional Networks with Oriented 1D Kernels"
Python
44
star
32

SOLID

Python
41
star
33

OGNI-DC

[ECCV24] official code for "OGNI-DC: Robust Depth Completion with Optimization-Guided Neural Iterations"
Python
38
star
34

OcMesher

C++
35
star
35

attach-juxtapose-parser

Code for the paper "Strongly Incremental Constituency Parsing with Graph Neural Networks"
Python
34
star
36

surface_normals

Code for the ICCV 2017 paper "Surface Normals in the Wild"
Lua
33
star
37

MetaGen

Code for the paper "Learning to Prove Theorems by Learning to Generate Theorems"
Objective-C++
30
star
38

FormulaNet

Code for FormulaNet in NIPS 2017
Python
29
star
39

Rel3D

Official code for NeurRIPS 2020 paper "Rel3D: A Minimally Contrastive Benchmark for Grounding Spatial Relations in 3D"
Python
26
star
40

selfstudy-render

Code to generate datasets used in "How Useful is Self-Supervised Pretraining for Visual Tasks?"
Python
22
star
41

think_visually

Code for ACL 2018 paper 'Think Visually: Question Answering through Virtual Imagery'
Python
14
star
42

structured-matching

codes for ECCV 2016
Lua
9
star
43

DPVO_Docker

Shell
8
star
44

uniloss

Python
8
star
45

MetaQNL

Learning Symbolic Rules for Reasoning in Quasi-Natural Language: https://arxiv.org/abs/2111.12038
Julia
6
star
46

PackIt_Extra

Code for generating data in ICML 2020 paper "PackIt: A Virtual Environment for Geometric Planning"
C#
5
star
47

Rel3D_Render

Code for rendering images for NeurRIPS 2020 paper "Rel3D: A Minimally Contrastive Benchmark for Grounding Spatial Relations in 3D"
Python
3
star
48

HYPE-C

Python
1
star