Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

posecraft

posecraft is a Python package designed to load, manipulate, and transform pose data. It uses PyTorch to handle pose tensors, allowing you to perform operations such as centering, normalizing distances, filling missing values, and more.


Features

  • Pose Loading Load pose data (stored in .npy format) directly into a PyTorch tensor.

  • Transforms A set of classes (inheriting from torch.nn.Module) that can be chained to modify and clean your pose data, including:

    • CenterToKeypoint: Center all keypoints to a chosen reference keypoint.
    • NormalizeDistances: Enforce a fixed distance between two chosen keypoints.
    • FillMissing: Interpolate and fill missing (NaN) keypoints across frames.
    • InterpolateFrames: Resample frames to a uniform number of frames.
    • NormalizeFramesSpeed: Dynamically adjust frames based on the amount of movement.
    • FilterLandmarks: Filter out unwanted landmarks based on a mask.
    • PadTruncateFrames: Pad or truncate the total number of frames.
    • RandomSampleFrames / RandomSampleFrameLegacy: Randomly sample frames with fixed intervals or by chunks.
    • ReplaceNansWithZeros: Replace all NaN values in the tensor with zeros.
    • UseFramesDiffs: Represent each frame as the difference from the previous frame.
    • FlattenKeypoints: Reshape and flatten the keypoints across frames.
  • Animation Built-in functionality to animate the keypoints over time using matplotlib.animation.FuncAnimation.


Installation (From PyPI)

You can install the package directly from PyPI:

pip install posecraft

Installation (From Source)

  1. Clone this repository or add posecraft to your Python environment.
  2. Install dependencies:
    pip install -r requirements.txt
    
  3. (Optional) For development and documentation, navigate to the docs/ folder and install additional requirements.

Usage

Below is a basic example of how to load a pose and apply some transformations:

import torch
from posecraft.Pose import Pose
from posecraft.transforms import CenterToKeypoint, NormalizeDistances

# Load a pose from a .npy file
pose_data = Pose(path="path/to/pose.npy")

# Create a set of transforms
transforms = torch.nn.Sequential(
    CenterToKeypoint(center_keypoint=0),
    NormalizeDistances(indices=(11, 12), distance_factor=0.2)
)

# Apply transforms
transformed_pose = transforms(pose_data.pose)

# Now do something with 'transformed_pose', like visualizing or saving

You can also chain other available transforms (e.g., FillMissing, FilterLandmarks, etc.) depending on your data cleaning or preprocessing needs.

Documentation

Full documentation can be found at https://pedroodb.github.io/posecraft/.

Also, if installed locally, comprehensive documentation can be found under the docs/ folder. This includes:

  • Guides on setting up a development container (.devcontainer).
  • Instructions for running tests (tests/) and CI workflows.
  • Explanation of each transform class and utility function.

To build and view the documentation locally, navigate to the docs/ folder and run:

make html

Then open the generated HTML files from docs/_build/html/.

Contributing

  1. Fork the repository and create a new branch for your contribution.
  2. Make your changes, then open a pull request (PR).
  3. Ensure all tests and documentation checks pass.

Please follow the CODE_OF_CONDUCT.md for guidance on project etiquette and the LICENSE for usage permissions.


Support and Security

For any questions or issues, please see SUPPORT.md. Security concerns should be reported as outlined in SECURITY.md.


License

This project is licensed under the terms of the MIT License.

Metadata

Release files for posecraft 1.0.1rc93.post1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for posecraft 1.0.1rc93.post1
File Size Uploaded Provenance Actions
posecraft-1.0.1rc93.post1.tar.gz 302.7 kB Without provenance Details for posecraft-1.0.1rc93.post1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for posecraft 1.0.1rc93.post1
File Interpreter ABI Platform Actions
posecraft-1.0.1rc93.post1-py3-none-any.whl Python 3 none any Details for posecraft-1.0.1rc93.post1-py3-none-any.whl

Total release size: 586.2 kB

Release files / posecraft-1.0.1rc93.post1.tar.gz

Download URL posecraft-1.0.1rc93.post1.tar.gz
Size 302.7 kB
Tags Source
SHA-256 checksum
How to use checksums
23dcc1f38c6dd8ca93c7bf9ac7ed62bed5957ed125d1162a57d95ac7e1a99750
BLAKE2b-256 checksum
How to use checksums
0edc66272da8baa107cc62c9719808bc31354da15d5100e08daea64978e7665b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via python-requests/2.32.3

Release files / posecraft-1.0.1rc93.post1-py3-none-any.whl

Download URL posecraft-1.0.1rc93.post1-py3-none-any.whl
Size 283.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b53a4a3a3a0b962dab49318378c675a14b0ad5871f831b1f37eeae3975b237f2
BLAKE2b-256 checksum
How to use checksums
35e8e05f32d90f0972ba7067521cb93083efb3971279b61efab737c8293b7339
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via python-requests/2.32.3

Security for posecraft 1.0.1rc93.post1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page