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.

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.0.tar.gz (20.1 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.0-py3-none-any.whl (21.0 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for simple_rtmw-0.1.0.tar.gz
Algorithm Hash digest
SHA256 4f6e0c887c794e73e650b523463a3e3ebe14b4f9e7e717b7cf0f62b2942019ff
MD5 4a67fca2a24dc47d0d94dfbc0c5ca1c6
BLAKE2b-256 4840ce78998a5ef5805fdac9cb4a3e46ecd80dd7b7809802e058c4caf90d3feb

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for simple_rtmw-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 0db4c59c0ab32092c92baab52443323af5cc7586b11f45e6fbb8b513c8bcfaeb
MD5 d506d75532464ce3c6f5ba13ae7176db
BLAKE2b-256 496258696b6f23a1bb726813997bd0e1f95c643caf51f0ffbd6c3fadad068166

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