A clean architecture implementation of SynthPose for pose estimation.
Project description
SynthPose: Clean Architecture Implementation
A robust, modular Python package for human pose estimation using RT-DETR and VitPose. This project has been refactored to follow Clean Architecture principles, making it suitable for research, extension, and integration into larger systems (e.g., Avalonia/C# apps).
Features
- Clean Architecture: Separation of concerns into Domain, Application, Adapters, and Infrastructure layers.
- State-of-the-Art Models:
- Detection: RT-DETR (
PekingU/rtdetr_r50vd_coco_o365) - Pose Estimation: VitPose (
stanfordmimi/synthpose-vitpose-huge-hforbase)
- Detection: RT-DETR (
- Standardized Output: OpenPose-compatible JSON format.
- Configurable: Support for YAML configuration and CLI arguments.
- Type Safe: Fully typed codebase using Python type hints and Pydantic.
Architecture
The project is organized as follows:
domain/: Core business logic and entities (FrameData,Person,Keypoint). No external dependencies.application/: Use cases and orchestration (VideoProcessor). Depends only on Domain.adapters/: Implementations of interfaces (OpenCVVideoSource,RTDetrPersonDetector,VitPoseEstimator,OpenPoseResultWriter). Depends on external libraries (torch,cv2).infrastructure/: Configuration and Entry points (CLI,Settings).
Installation
This project uses Poetry for dependency management.
# Install dependencies
poetry install
Usage
CLI
Run the processor via the synthpose command (defined in pyproject.toml):
# Basic usage
poetry run synthpose process path/to/video.mp4
# With options
poetry run synthpose process video.mp4 --mode base --device cpu
# Using a config file
poetry run synthpose process video.mp4 --config configs/default.yaml
Configuration
You can use a YAML file to configure the pipeline:
# configs/example.yaml
device: "cuda"
model_mode: "huge"
det_threshold: 0.3
vis_show_weight: true
Output
- Video:
{input_name}_output.mp4(Visualized result) - JSON:
pose/{input_name}_json/{input_name}_{frame_id}.json(Keypoints data)
Testing
poetry run pytest
License
MIT License
References
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 synthpose-0.1.0.tar.gz.
File metadata
- Download URL: synthpose-0.1.0.tar.gz
- Upload date:
- Size: 10.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.2.1 CPython/3.13.5 Windows/11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cb3375996b23d4d0bf7415952a762f735b781bd96cd392ee152fbda33bd39620
|
|
| MD5 |
b719a76ce7649af00af3ccc136fba84e
|
|
| BLAKE2b-256 |
087ee0b5427a2d739710da0a5c672cb6b97c98b259be990ed719a96eae49018b
|
File details
Details for the file synthpose-0.1.0-py3-none-any.whl.
File metadata
- Download URL: synthpose-0.1.0-py3-none-any.whl
- Upload date:
- Size: 14.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.2.1 CPython/3.13.5 Windows/11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a5e5044c70a223e79f88ff16a0f79621829dde1ee7fadfe4d98b1f5c7e530908
|
|
| MD5 |
feeaa0e64ddd6c2d099d621809001f0f
|
|
| BLAKE2b-256 |
87487b2c5b11bc1e63da11d96036c6cfa42575772a4dc4596eb56503ef742855
|