Real-time (GPU) pose estimation pipeline with 🤗 Transformers
Project description
RT-Pose
Real-time (GPU) pose estimation pipeline with 🤗 Transformers
Installation
- [Optional] It's recommended to run with
uvfor faster installation. First, installuv:
pip install uv
- Install
rt_pose(you can ignoreuvin case you want to install with purepip)
uv pip install rt-pose # with minimal dependencies
uv pip install rt-pose[demo] # with additional dependencies to run `scripts/` and `notebooks/`
Quick start
Notebooks
Python snippet
import torch
from rt_pose import PoseEstimationPipeline
# Load pose estimation pipeline
pipeline = PoseEstimationPipeline(
object_detection_checkpoint="PekingU/rtdetr_r50vd_coco_o365",
pose_estimation_checkpoint="usyd-community/vitpose-plus-small",
device="cuda",
dtype=torch.bfloat16,
compile=False, # or True to get more speedup
)
# Run pose estimation on image
output = pipeline(image)
# output.person_boxes_xyxy (`torch.Tensor`):
# of shape `(N, 4)` with `N` boxes of detected persons on the image in (x_min, y_min, x_max, y_max) format
# output.keypoints_xy (`torch.Tensor`):
# of shape `(N, 17, 2)` with 17 keypoints per each person
# output.scores (`torch.Tensor`):
# of shape (N, 17) with corresponding scores (aka confidence) for each keypoint
# Visualize with supervision/matplotlib/opencv
# see ./scripts/run_on_image.py
Other object detection checkpoints on the Hub:
Other pose estimation checkpoints on the Hub:
Run pose estimation on image
--inputcan be URL or path
python scripts/run_on_image.py \
--input "https://res-3.cloudinary.com/dostuff-media/image/upload//w_1200,q_75,c_limit,f_auto/v1511369692/page-image-10656-892d1842-b089-4a7a-80f1-5be99b2b3454.png" \
--output "results/image.png" \
--device "cuda:0"
Run pose estimation on video
--inputcan be URL or path--dtypeit's recommended to run inbfloat16precision to get the best precision/speed tradeoff--compileyou can compile models in the pipeline to get even more speed up (x2), but compilation can be quite long, so it makes sense to activate for long videos only.
python scripts/run_on_video.py \
--input "https://huggingface.co/datasets/qubvel-hf/assets/blob/main/rt_pose_break_dance_v1.mp4" \
--output "results/rt_pose_break_dance_v1_annotated.mp4" \
--device "cuda:0" \
--dtype bfloat16
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file rt_pose-0.0.3.tar.gz.
File metadata
- Download URL: rt_pose-0.0.3.tar.gz
- Upload date:
- Size: 834.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a33d720d252efd780c307f35cbfd328e74dfa774ee9b1dddeedec610fb3ea6ba
|
|
| MD5 |
96b5dcee45b320ad636e3c974f418499
|
|
| BLAKE2b-256 |
a461199515937bf2557d54d4423e0f83499fb87b6470b963f29ed4fd1d7df390
|
Provenance
The following attestation bundles were made for rt_pose-0.0.3.tar.gz:
Publisher:
python-publish.yml on qubvel/rt-pose
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
rt_pose-0.0.3.tar.gz -
Subject digest:
a33d720d252efd780c307f35cbfd328e74dfa774ee9b1dddeedec610fb3ea6ba - Sigstore transparency entry: 168516497
- Sigstore integration time:
-
Permalink:
qubvel/rt-pose@b31bf7a48eae8581126fdf033ffb58703a87f7e8 -
Branch / Tag:
refs/tags/v0.0.3-fix - Owner: https://github.com/qubvel
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@b31bf7a48eae8581126fdf033ffb58703a87f7e8 -
Trigger Event:
release
-
Statement type:
File details
Details for the file rt_pose-0.0.3-py3-none-any.whl.
File metadata
- Download URL: rt_pose-0.0.3-py3-none-any.whl
- Upload date:
- Size: 11.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
002705d28355377cbec14cc8c4c49b450d3ed76a15fb032653ac2101db4d72d6
|
|
| MD5 |
77d7d94a7d51350e06bce036c963729f
|
|
| BLAKE2b-256 |
e736893b0d735bbd07db7755a9196d2fdc957d44ff578dcaeca3d396175b0e2f
|
Provenance
The following attestation bundles were made for rt_pose-0.0.3-py3-none-any.whl:
Publisher:
python-publish.yml on qubvel/rt-pose
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
rt_pose-0.0.3-py3-none-any.whl -
Subject digest:
002705d28355377cbec14cc8c4c49b450d3ed76a15fb032653ac2101db4d72d6 - Sigstore transparency entry: 168516505
- Sigstore integration time:
-
Permalink:
qubvel/rt-pose@b31bf7a48eae8581126fdf033ffb58703a87f7e8 -
Branch / Tag:
refs/tags/v0.0.3-fix - Owner: https://github.com/qubvel
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@b31bf7a48eae8581126fdf033ffb58703a87f7e8 -
Trigger Event:
release
-
Statement type: