Skip to content


Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?

Latest commit


Git stats


Failed to load latest commit information.
Latest commit message
Commit time

6-DoF Object Pose from Semantic Keypoints

Georgios Pavlakos, Xiaowei Zhou, Aaron Chan, Konstantinos G. Derpanis, Kostas Daniilidis

This is the code for the paper 6-DoF Object Pose from Semantic Keypoints. Please follow the links to read the paper and visit the corresponding project page.

We provide code to test our approach on PASCAL3D. Please follow the instructions below to setup and use our code. To run this code, make sure the following are installed:

1) Downloading model and PASCAL3D data

To get the pretrained model and PASCAL3D data in the expected folders, we have included all the preprocessing steps in the following script:


2) Training PASCAL3D models (optional - a pretrained model was downloaded in the previous script)

We have included the Stacked Hourglass training code with small adaptations in our package, so that you can run training on PASCAL3D dataset using the provided keypoint annotations. From terminal you need to run the following code so you can start training:

cd pose-hg/pose-hg-train/src
th main.lua -dataset pascal3d -expID test-run-stacked -netType hg-stacked -task pose-int -nStack 2 -LR 2.5e-4 -nEpochs 100 -snapshot 1

For more details on the command line options you can take a look at the pose-hg/pose-hg-train/src/opt.lua file or the original Stacked Hourglass code. Here, we have applied only minimal changes to make training on PASCAL3D feasible.

3) Heatmap Predictions

First we need to run the ConvNet on the validation images to get heatmap predictions.

cd pose-hg/pose-hg-demo
th main.lua pascal3d valid pretrained

4) Pose Optimization

On Matlab, you can run the pose optimization on the whole PASCAL3D dataset by using the file:


The results for the clean set of the dataset (no occlusions or truncations) are printed in the specified results folder. Optionally, you can also visualize the results (heatmaps and viewpoint predictions) by setting the flag vis = 1.

5) Additional Demos

We provide sample precomputed heatmaps to check the pose optimization results for the weak perspective and the full perspective case respectively:


Additionally, if you want to use our code on your own custom images, the following demo describes the steps you need to follow (both for Keypoint Localization and Pose Optimization):



If you find this code useful for your research, please consider citing the following paper:

  Title          = {6-DoF Object Pose from Semantic Keypoints},
  Author         = {Pavlakos, Georgios and Zhou, Xiaowei and Chan, Aaron and Derpanis, Konstantinos G and Daniilidis, Kostas},
  Booktitle      = {International Conference on Robotics and Automation (ICRA)},
  Year           = {2017}


This code follows closely the released code for the Stacked Hourglass networks by Alejandro Newell. If you use this code, please consider citing the respective paper.


Code for "6-DoF Object Pose from Semantic Keypoints", ICRA 2017







No releases published


No packages published