Introduction

Continuously tested on Linux, MacOS and Windows: Tests deploy-guide Downloads
New 2021 paper:

OpenPifPaf: Composite Fields for Semantic Keypoint Detection and Spatio-Temporal Association
Sven Kreiss, Lorenzo Bertoni, Alexandre Alahi, 2021.

Many image-based perception tasks can be formulated as detecting, associating and tracking semantic keypoints, e.g., human body pose estimation and tracking. In this work, we present a general framework that jointly detects and forms spatio-temporal keypoint associations in a single stage, making this the first real-time pose detection and tracking algorithm. We present a generic neural network architecture that uses Composite Fields to detect and construct a spatio-temporal pose which is a single, connected graph whose nodes are the semantic keypoints (e.g., a person’s body joints) in multiple frames. For the temporal associations, we introduce the Temporal Composite Association Field (TCAF) which requires an extended network architecture and training method beyond previous Composite Fields. Our experiments show competitive accuracy while being an order of magnitude faster on multiple publicly available datasets such as COCO, CrowdPose and the PoseTrack 2017 and 2018 datasets. We also show that our method generalizes to any class of semantic keypoints such as car and animal parts to provide a holistic perception framework that is well suited for urban mobility such as self-driving cars and delivery robots.

Previous CVPR 2019 paper.

Install

Python 3 is required. Python 2 is not supported. Do not clone this repository and make sure there is no folder named openpifpaf in your current directory.

pip3 install openpifpaf

You need to install matplotlib to produce visual outputs. To modify OpenPifPaf itself, please follow Modify Code.

For a live demo, we recommend to try the openpifpafwebdemo project. Alternatively, python3 -m openpifpaf.video (requires OpenCV) provides a live demo as well.

Executable Guide

This is a jupyter-book or “executable book”. Many sections of this book, like Prediction, are generated from the code shown on the page itself: most pages are based on Jupyter Notebooks that can be downloaded or launched interactively in the cloud by clicking on the rocket at the top and selecting a cloud provider like Binder. The code on the page is all the code required to reproduce that particular page.

Pre-trained Models

Performance metrics on the COCO val set obtained with a GTX1080Ti:

Checkpoint

AP

APᴹ

APᴸ

t_{total} [ms]

t_{dec} [ms]

size

resnet50

68.2

65.8

72.7

64

22

98.0MB

shufflenetv2k16

67.2

62.7

74.6

51

19

39.3MB

shufflenetv2k30

71.0

66.6

78.5

92

16

115.6MB

Command to reproduce this table: python -m openpifpaf.benchmark –checkpoints resnet50 shufflenetv2k16 shufflenetv2k30.

Pretrained model files are shared in the openpifpaf-torchhub repository and linked from the checkpoint names in the table above. The pretrained models are downloaded automatically when using the command line option --checkpoint checkpointasintableabove.

Citation

@article{kreiss2021openpifpaf,
  title = {{OpenPifPaf: Composite Fields for Semantic Keypoint Detection and Spatio-Temporal Association}},
  author = {Sven Kreiss and Lorenzo Bertoni and Alexandre Alahi},
  journal = {arXiv preprint arXiv:2103.02440},
  month = {March},
  year = {2021}
}

@InProceedings{kreiss2019pifpaf,
  author = {Kreiss, Sven and Bertoni, Lorenzo and Alahi, Alexandre},
  title = {{PifPaf: Composite Fields for Human Pose Estimation}},
  booktitle = {The IEEE Conference on Computer Vision and Pattern Recognition (CVPR)},
  month = {June},
  year = {2019}
}

References: [KBA21, KBA19]

Commercial License

This software is available for licensing via the EPFL Technology Transfer Office (https://tto.epfl.ch/, info.tto@epfl.ch).