Skip to main content

A Python package for defining custom landmarks in Mediapipe making easy to calculate some new virtual points with a single extention class

Project description

Virtual Landmark

virtual-landmark is a modular and extensible system for working with custom landmarks on top of MediaPipe Pose. It enables developers to define additional pose points through geometric relationships, access them like native MediaPipe landmarks, and extend pose rendering and analysis.

The complete documentation can be found on the documentation page


Features

  • 🧩 Create virtual landmarks with @landmark decorator
  • 📐 Measure 2D and 3D joint angles
  • 🎨 Extend pose drawings with new connections and styles
  • 📚 Seamlessly integrate with MediaPipe’s landmark list
  • 🧠 Named access to all landmarks via enum-like interface

How It Works

The system works in three stages:

1. Definition

Virtual landmarks are declared using @landmark("NAME", connection=[...]) decorators on methods that return a 3D point.

2. Discovery

Upon instantiating VirtualLandmark, all decorated methods are scanned, executed, and their results added to the landmark list.

3. Access

Virtual landmarks behave like native landmarks:

  • Access index via .NAME.value
  • Retrieve coordinates via landmark list
  • Draw using standard MediaPipe rendering tools

Getting Started

Install MediaPipe:

pip install mediapipe opencv-python virtual-landmark

Clone or copy this repo, then run the examples:

python examples/get_started.py
python examples/hello_world.py
python examples/video.py
python examples/web_cam.py

There are also a Jupyter notebook that you can run through the follow command:

pip install jupyterlab matplotlib
jupyter lab examples

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

virtual_landmark-0.1.1.tar.gz (17.4 kB view details)

Uploaded Source

Built Distribution

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

virtual_landmark-0.1.1-py3-none-any.whl (17.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: virtual_landmark-0.1.1.tar.gz
  • Upload date:
  • Size: 17.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for virtual_landmark-0.1.1.tar.gz
Algorithm Hash digest
SHA256 168427ae2f9ebc96dac4258d47a1d6b0114ab013f7b66c92eec9277752faef76
MD5 e2011d5ba9c988e0e0ef33ef59f3ba2b
BLAKE2b-256 9b3f9740e8be28efc675c4ed1de7c61b00647112b85dafc44dca83f1f4cc9db5

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for virtual_landmark-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 3379e54e6e4a09d3243fbd9a678dff3795c994a83912a491e2c349ba6a38ae21
MD5 77192e28a50c98413daaa6f19f56dd99
BLAKE2b-256 d3ad0386677f9c4d66b4ef399f3706f6f58ccb4d9359d55e8b23bd438c6f571b

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