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.2.tar.gz (17.3 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.2-py3-none-any.whl (17.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: virtual_landmark-0.1.2.tar.gz
  • Upload date:
  • Size: 17.3 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.2.tar.gz
Algorithm Hash digest
SHA256 9b45b0bfe3258ee885717e5ac3587d8c59fef598ebe6014e2082aa96d7efe54e
MD5 7370b6a666ace706befddd930b38645d
BLAKE2b-256 bf8abeb01389d71c8134b5a3376fd16509e713036d3944f9fc862cdfdacf7699

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for virtual_landmark-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 b8e5c0411a30a8a09fa9c71afd0cd33803dbeaea4bc5d67d3bd55b316bdb5e14
MD5 8f007ca7869e645489e521ec1e3bd6a2
BLAKE2b-256 338e0c5a94fa0c3f54eddd492360d288de0bb4eb72769bf1a12403d3417dad8e

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