Skip to main content

3D human pose estimation from video using DiffPose + MixSTE

Project description

DiffPose-Video

PyPI version Python CI License: MIT

3D human pose estimation from arbitrary video using MixSTE (2D→3D lifting) and DiffPose (diffusion-based refinement).

This package wraps the original DiffPose research code with a clean inference pipeline, an interactive visualisation dashboard, and a video renderer — all accessible as CLI commands after a single pip install.

Paper: DiffPose: Toward More Reliable 3D Pose Estimation, CVPR 2023.


Install

# 1. Install PyTorch for your CUDA version first (example: CUDA 12.8)
pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu128

# 2. Install this package
pip install diffpose-video

Note: onnxruntime-gpu==1.20.1 is pinned because later versions have a broken CUDA provider on some systems.


Download pretrained checkpoints

diffpose-download

Downloads all pretrained weights to ~/.cache/diffpose_video/checkpoints/. Safe to re-run — skips files that already exist.


Usage

1. Run inference on a video

diffpose-infer --input video.mp4 --output_dir results/

Config and checkpoint paths default to the bundled config and ~/.cache/diffpose_video/checkpoints/ (populated by diffpose-download). Override with --config, --model_pose, --model_diff if needed.

Output: results/<video_name>.npz containing:

  • poses_3d(T, 17, 3) root-relative 3D joint positions
  • keypoints_2d(T, 17, 3) pixel-space 2D detections + confidence

Process a whole folder of videos by passing a directory to --input.

2. Interactive dashboard

diffpose-explore \
  --npz   results/video.npz \
  --video video.mp4 \
  --fps   30

Opens a Plotly Dash app at http://localhost:8050 with:

  • Synchronized video playback with 2D skeleton overlay
  • Animated 3D skeleton
  • X / Y / Z trajectory graphs per joint
  • Play/pause + frame scrubber, all linked

3. Render a side-by-side MP4

diffpose-visualise \
  --npz    results/video.npz \
  --video  video.mp4 \
  --output results/video_vis.mp4

Produces a video with the original footage (+ 2D overlay) on the left and the animated 3D skeleton on the right.


Docker

The image is self-contained — checkpoints and config are baked in at build time.

# Build once
docker compose build

# Inference (outputs land in ./results/)
export VIDEOS_DIR=/path/to/your/videos
docker compose run infer --input /videos/clip.mp4

# Render side-by-side MP4
docker compose run visualise \
  --npz /results/clip.npz --video /videos/clip.mp4 --output /results/clip_vis.mp4

# Interactive dashboard — open http://localhost:8050
docker compose run --service-ports explore \
  --npz /results/clip.npz --video /videos/clip.mp4

Citation

@InProceedings{gong2023diffpose,
    author    = {Gong, Jia and Foo, Lin Geng and Fan, Zhipeng and Ke, Qiuhong and Rahmani, Hossein and Liu, Jun},
    title     = {DiffPose: Toward More Reliable 3D Pose Estimation},
    booktitle = {Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR)},
    month     = {June},
    year      = {2023},
}

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

diffpose_video-0.2.1.tar.gz (62.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

diffpose_video-0.2.1-py3-none-any.whl (77.1 kB view details)

Uploaded Python 3

File details

Details for the file diffpose_video-0.2.1.tar.gz.

File metadata

  • Download URL: diffpose_video-0.2.1.tar.gz
  • Upload date:
  • Size: 62.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.12

File hashes

Hashes for diffpose_video-0.2.1.tar.gz
Algorithm Hash digest
SHA256 614b94b5ce6d346aeb76626e0ce328b9bb811650721b23ee366bc6a60b113670
MD5 a9e53ae51a7f2560d45ace70066b6d22
BLAKE2b-256 a55cbad6d71f1395fb404e0ceea395ea1e879f217dbb509a0c1945592243477a

See more details on using hashes here.

File details

Details for the file diffpose_video-0.2.1-py3-none-any.whl.

File metadata

  • Download URL: diffpose_video-0.2.1-py3-none-any.whl
  • Upload date:
  • Size: 77.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.12

File hashes

Hashes for diffpose_video-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 75f066458e27d85405a75327c7a0c5667d4a7701d36bf4e32e47e6cb0fe2e0fa
MD5 b961b50202e0341b7884b08db93bda1e
BLAKE2b-256 b248727afeb94adcd07dbcc872ea5d98f99436915fd0fe2e6f2db02b88d513ff

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page