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.0.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.0-py3-none-any.whl (17.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: virtual_landmark-0.1.0.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.0.tar.gz
Algorithm Hash digest
SHA256 b831fb68471a0dbf656f40258997869a8afce456c8290751692662b58346758d
MD5 6d5bc2c06accc03ea9d5db5638fc1fae
BLAKE2b-256 3833cf2813c7f26c993e4dfbf847b45a9215e0201a3ceeae2496c9217118b275

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for virtual_landmark-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 2e3b5ab98dcf8b730d2715d227e59f6ac57028831826e5e4832a20d22f7a94ed
MD5 70ceb58ab4fab879fe986b0a9aa90d49
BLAKE2b-256 d276455a5acf1cc4827c58d87b8499f13b0c2cd852a9a040f7e4064e2bc1d6e9

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