Realsense Mediapipe Tracking
This is a project to integrate the use of a Realsense d435 depth camera with Mediapipe for tracking the position of a subjects hand.
Using UV for package management.
Mediapipe requires python 3.12 or older unless built from source.
Example Streaming
import sys
import os
sys.path.append(os.path.abspath("src/realsense_mediapipe_tracking"))
import time
from src.realsense_mediapipe_tracking.camera import realsenseCamera
from src.realsense_mediapipe_tracking.hand_tracking import handTrack
def main():
# Initialize the RealSense camera with desired parameters
cam = realsenseCamera(width=640, height=480, fps=30)
# Initialize the hand tracking class with the camera object
track = handTrack(cam)
try:
# Start streaming
print("Starting stream...")
track.stream()
except Exception as e:
print(f"An error occurred: {e}")
finally:
# Stop the camera and release resources
cam.stop()
if __name__ == "__main__":
main()
Example direct x y z coordinate printing
import sys
import os
sys.path.append(os.path.abspath("src/realsense_mediapipe_tracking"))
from src.realsense_mediapipe_tracking.camera import realsenseCamera
from src.realsense_mediapipe_tracking.hand_tracking import handTrack
def main():
# Initialize the RealSense camera
cam = realsenseCamera()
# Initialize the hand tracking class with the camera object
tracker = handTrack(cam)
try:
while True:
color_image, depth_image, depth_frame = tracker.cam.get_frames()
if color_image is None or depth_image is None:
continue
landmarks_xyz, results = tracker.tracking(color_image, depth_frame)
# Print the XYZ coordinates for each hand
for hand_xyz in landmarks_xyz:
for idx, (X, Y, Z) in enumerate(hand_xyz):
print(f"Landmark {idx}: X={X:.2f}m, Y={Y:.2f}m, Z={Z:.2f}m")
except Exception as e:
print(f"An error occurred: {e}")
finally:
cam.stop()
if __name__ == "__main__":
main()
Required external libraries: https://github.com/IntelRealSense/librealsense
Licensed under GNU GPLv3
Release files for realsense-mediapipe-tracking 0.1.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| realsense_mediapipe_tracking-0.1.3.tar.gz | 29.5 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| realsense_mediapipe_tracking-0.1.3-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 48.4 kB
Release files / realsense_mediapipe_tracking-0.1.3.tar.gz
| Download URL | realsense_mediapipe_tracking-0.1.3.tar.gz |
|---|---|
| Size | 29.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
fc6ffe0027fab3029435a0acace668c2956d99d48c034b43d16bb24f0a2dacef
|
|
BLAKE2b-256 checksum How to use checksums |
b902c98269f02a383fbe7a7853d06e7dcc3577286bd17f3bb35890bb81e3f3ba
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Feb 13, 2026.
Transparency logRelease files / realsense_mediapipe_tracking-0.1.3-py3-none-any.whl
| Download URL | realsense_mediapipe_tracking-0.1.3-py3-none-any.whl |
|---|---|
| Size | 18.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
f469fe6369b1bb1e7b532d5a3828408735837344e656ef340d2c3fc13f8c9738
|
|
BLAKE2b-256 checksum How to use checksums |
c9d56afa535c889887be6bb99c2bba9bc3d230d764bf1708af31f9a8b083a561
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Feb 13, 2026.
Transparency log