Skip to main content

PyRoboVision

Multi-object tracking (Kalman filter + Hungarian association) and trajectory prediction for robotics — pure Python (NumPy + SciPy) core, with an optional real MiDaS monocular depth backend.

CI PyPI License: Apache 2.0 Python 3.10+

What it is

PyRoboVision's real, tested core is a multi-object tracker: Kalman-filter state estimation plus Hungarian-algorithm association, with occlusion handling (tracks are predicted through detection gaps and re-associate on reacquisition) and constant-velocity / constant-acceleration trajectory prediction with uncertainty. Around it are supporting utilities: 3D perception (depth, 3D boxes, LiDAR, occupancy grids), rule-based behavior/intent classification, and minimal imitation-learning / behavior-cloning / safety-constraint building blocks. The core depends on NumPy and SciPy only; PyTorch is optional.

Features

  • Multi-object tracking — MOTTracker, Track, Detection; birth/confirm/occlude/death lifecycle; IoU association via scipy.optimize.linear_sum_assignment.
  • Occlusion handling — every track is predicted each frame; a confirmed track survives up to max_age missed frames and re-associates to the same track_id.
  • Trajectory prediction — TrajectoryPredictor with "cv" (constant velocity) or "ca" (constant acceleration) models and uncertainty.
  • Depth estimation — DepthEstimator(model="heuristic") (default, no extra deps) or model="midas" (real pretrained MiDaS_small via torch.hub, optional [depth] extra).
  • 3D perception utilities — Box3DConverter (2D bbox + depth → 3D), LiDAR point-cloud filtering/clustering, BEV occupancy grids.
  • Sensor fusion — Kalman-based IMU/GPS fusion with covariance (SensorFusionEngine).
  • ONNX export — thin wrapper around torch.onnx.export (optional [onnx] extra).
  • Learning helpers — imitation learning, behavior cloning, SafetyValidator constraint correction.

Who it's for / Use cases

  • Adding tracking on top of your own detector — feed bounding boxes from YOLO/SAM/anything into MOTTracker; it handles identity persistence through occlusion.
  • Forecasting from tracked positions — constant-velocity/acceleration prediction with uncertainty for downstream collision-avoidance logic.
  • IMU/GPS fusion — a fused position estimate with covariance without hand-rolling a Kalman filter.
  • Prototyping 3D perception — depth maps, 3D boxes, and occupancy grids from 2D detections and a calibrated camera.

What it is not

  • No object detector. You bring your own detections (bounding boxes + confidence); none is bundled or wrapped.
  • No GPU-accelerated inference pipeline. The tracking/prediction core is CPU NumPy/SciPy.
  • No foundation-model integration (CLIP/SAM/Grounding DINO). An earlier version shipped a module that returned hardcoded fake results; it was removed, not fixed.
  • MiDaS output is relative, not metric — correctly ordered near/far depth, not meters, unless you calibrate against a known reference.
  • Not a certified or safety-verified autonomous-driving stack. SafetyValidator is a basic constraint checker.
  • The default heuristic depth backend is a Sobel-edge placeholder, not a learned depth model.

Project status

Beta (Development Status 4), version 3.1.0 (matching the latest PyPI release). tracking/ and prediction/ are implemented and tested; supporting utilities (perception, fusion, learning) are real but minimal. 278 passed / 7 skipped, 84% measured line coverage on Python 3.11 (the 7 skips are the torch/MiDaS-dependent tests, which run when the [depth] extra is installed). black --check / isort --check-only currently report unformatted files and mypy reports pre-existing type errors, none enforced in CI today. See ROADMAP_HONEST.md.

Installation

pip install pyrobovision

# real MiDaS depth estimation (installs PyTorch; one-time model download)
pip install "pyrobovision[depth]"

# ONNX model-export utilities
pip install "pyrobovision[onnx]"

Requires Python 3.10+. From source:

git clone https://github.com/Mullassery/PyRoboVision.git
cd PyRoboVision
pip install -e ".[dev]"

Quick start

import numpy as np
from pyrobovision.tracking.mot import MOTTracker, Detection

tracker = MOTTracker(max_age=30, min_hits=3)

# Detections come from *your* detector — each is a bounding box + confidence.
detections = [Detection(bbox=np.array([100, 100, 140, 180]), confidence=0.92)]

for track in tracker.update(detections):
    print(track.track_id, track.get_position(), track.get_velocity())

Usage

Tracking plus trajectory prediction:

import numpy as np
from pyrobovision.tracking.mot import MOTTracker, Detection
from pyrobovision.prediction.trajectory import TrajectoryPredictor

tracker = MOTTracker(max_age=30, min_hits=3)
positions = []
for x in (100, 110, 120, 130):
    tracker.update([Detection(bbox=np.array([x, 100, x + 40, 180]), confidence=0.9)])
    positions.append(tracker.get_track_by_id(1).get_position())

predictor = TrajectoryPredictor(model="cv")  # "cv" or "ca"
print(predictor.predict_trajectory(np.array(positions), horizon=5))

Depth + 3D boxes + occupancy (default heuristic depth; swap in model="midas" for real inference):

import numpy as np
from pyrobovision.perception.depth import DepthEstimator
from pyrobovision.perception.bbox_3d import Box3DConverter
from pyrobovision.perception.occupancy import OccupancyGridBuilder

estimator = DepthEstimator(model="heuristic")
estimator.set_calibration(fx=500, fy=500, cx=320, cy=240)
depth = estimator.estimate_depth(np.random.randint(0, 255, (480, 640, 3), dtype=np.uint8))

box = Box3DConverter().from_2d_bbox_and_depth(
    bbox_2d=np.array([100, 100, 200, 200]), depth_map=depth.data, fx=500, fy=500, cx=320, cy=240)
grid = OccupancyGridBuilder(grid_size=(100, 100), resolution=0.1).from_3d_bboxes([box])
print(len(grid.get_occupied_cells()))

IMU/GPS fusion and safety checks:

from pyrobovision.fusion.sensor_fusion import SensorFusionEngine, IMUData, GPSData
from pyrobovision.learning.safety import SafetyValidator

engine = SensorFusionEngine(origin_lat=37.7749, origin_lon=-122.4194)
engine.update_imu(IMUData(timestamp=0.0, accelerometer=[0, 0, 9.8], gyroscope=[0, 0, 0]))
state = engine.update_gps(GPSData(timestamp=0.1, latitude=37.7749, longitude=-122.4194,
                                  altitude=10.0, speed=5.0, heading=90.0, accuracy=2.0))

safe = SafetyValidator(max_acceleration=5.0, max_steering=45.0).correct_action(
    proposed_action=[6.5, 50.0], context={"speed": 15.0})  # clamped to limits

Documentation

Contributing

Contributions welcome — see CONTRIBUTING.md. Security issues: SECURITY.md.

Part of the robotics & autonomy family

PyRoboVision is one of six complementary, composable tools in the Mullassery robotics & autonomy family. Together they form a single stack: perceive → map → simulate → learn → debug → coordinate the fleet.

Tool Role What it does
PyRoboVision Perception This project — multi-object tracker (Kalman filter + Hungarian algorithm) and trajectory predictor for robot perception.
PyTerrainMap Mapping / SLAM Fuses multi-robot terrain observations into a spatial-temporal store, with H3 spatial indexing and SLAM.
PyRoboSimulator Simulation World simulator for autonomous systems, with a FastAPI backend.
PyRoboFrames Learning data Rust-backed ML dataloader for robot-learning datasets (native LeRobot format, Apple Silicon hardware video decode).
PyRoboReplay Mission forensics Forensic-debugging and causal-analysis engine for autonomous robot mission replay.
SyncFleet Fleet coordination Rust + SQLite, peer-to-peer state sync for robotics fleets — mutual-TLS 1.3, version-vector replication, mDNS discovery; conflict resolution on the roadmap.

Each works standalone, but they're complementary by design. Browse all projects →

License

Apache License 2.0 — see LICENSE.

Metadata

Release files for pyrobovision 3.1.1

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

Source distribution (sdist)

Source distribution for pyrobovision 3.1.1
File Size Uploaded Provenance Actions
pyrobovision-3.1.1.tar.gz 66.1 kB Without provenance Details for pyrobovision-3.1.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for pyrobovision 3.1.1
File Interpreter ABI Platform Actions
pyrobovision-3.1.1-py3-none-any.whl Python 3 none any Details for pyrobovision-3.1.1-py3-none-any.whl

Total release size: 114.8 kB

Release files / pyrobovision-3.1.1.tar.gz

Download URL pyrobovision-3.1.1.tar.gz
Size 66.1 kB
Tags Source
SHA-256 checksum
How to use checksums
798f65c29e839cf14dae3c9c17a5644fd80f3f1261e3cc5814dfdca328c1efe7
BLAKE2b-256 checksum
How to use checksums
3044fd9b59aa33790bb51b1990fdc280e31f75e1178a9790ce1581cd33708217
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.9.6

Release files / pyrobovision-3.1.1-py3-none-any.whl

Download URL pyrobovision-3.1.1-py3-none-any.whl
Size 48.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d9642f5a673aba38f5a5c347937ccf9c39688dc67fc26d4c616e6f862c73f191
BLAKE2b-256 checksum
How to use checksums
c2d8adb01b5957ab3b814251865dd0c831a92dc984352e175f1972a757ea2058
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.9.6

Security for pyrobovision 3.1.1

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