Skip to main content

RTMW simple rtmw inference

Project description

Simple RTMW

Multi-person whole-body pose estimation using ONNX models with RTMPose and YOLOX detectors.

Installation

Install from PyPI:

pip install simple-rtmw

Or install from source:

git clone https://github.com/anath2/simple-rtmw
cd simple-rtmw
pip install .

Quick Start

import cv2
from simple_rtmw import Wholebody
from simple_rtmw.draw import draw_annotated_image

# Initialize pipeline
model = Wholebody(device="cpu")  # Use "cuda" or "mps" for GPU

# Load image and run inference
image = cv2.imread("image.jpg")
keypoints, scores = model(image)
detection_boxes = model.det_model(image)

# Format and visualize results
keypoints_with_scores = np.concatenate([keypoints, scores[..., np.newaxis]], axis=-1)
pose_results = model.format_result(keypoints_with_scores)

annotated_image = draw_annotated_image(
    image,
    detection_boxes=detection_boxes,
    pose_results=pose_results
)

cv2.imwrite("output.jpg", annotated_image)

Features

  • Easy to use: No depencencies except OpenCV, ONNX and Numpy
  • Whole-body detection: 17 body + 68 face + 21 hand + 3 foot keypoints per person
  • Multi-platform: CPU, CUDA, MPS (Apple Silicon) support
  • Flexible visualization: Customizable drawing with detection boxes and pose annotations

Configuration

from simple_rtmw.draw import DrawConfig, DetectionConfig, PoseConfig

# Control what gets drawn
draw_config = DrawConfig(
    draw_detection_boxes=True,
    draw_pose_keypoints=True,
    draw_pose_skeleton=False
)

# Customize appearance
detection_config = DetectionConfig(box_color=(0, 0, 255), box_thickness=3)
pose_config = PoseConfig(keypoint_radius=5, min_score=0.5)

annotated_image = draw_annotated_image(
    image, detection_boxes, pose_results,
    draw_config=draw_config,
    detection_config=detection_config,
    pose_config=pose_config
)

License

Licensed under the Apache License, Version 2.0. See LICENSE for details.

Acknowledgments

  • RTMPose for pose estimation models
  • YOLOX for detection models
  • OpenMMLab for pre-trained models and research

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

simple_rtmw-0.1.1.tar.gz (20.9 kB view details)

Uploaded Source

Built Distribution

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

simple_rtmw-0.1.1-py3-none-any.whl (21.3 kB view details)

Uploaded Python 3

File details

Details for the file simple_rtmw-0.1.1.tar.gz.

File metadata

  • Download URL: simple_rtmw-0.1.1.tar.gz
  • Upload date:
  • Size: 20.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.7.12

File hashes

Hashes for simple_rtmw-0.1.1.tar.gz
Algorithm Hash digest
SHA256 86ec21d76f38ea7352e76eddcb46efabcf701ea48cf1dcc6a2fd3e6e315c842b
MD5 d4195e23599db225c8e357dc1eef5629
BLAKE2b-256 974e3f3c8fa03fc546e237aa2c87b64eb2d2112221c66f2368d06d3bfad557a2

See more details on using hashes here.

File details

Details for the file simple_rtmw-0.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for simple_rtmw-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 2c89c3274d3c430e2935e4d1de875d4a976b5bc856653b6fbbe878d6da331bc0
MD5 8b616e2327bf239141adbe9b79fb2241
BLAKE2b-256 2b57be01637b25bf60d105d804104a2beb7649ab9d2dd799441c2afcbba53a8e

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