Install & Compatibility
Where this runs
tested against v2.3.0 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
py 3.13
✕ build_error
✕ build_error
338MB installed
● package 338MB
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
Tracker
✓ from norfair import Tracker
✗ from norfair.tracker import Tracker
Tracker was moved to top-level in v2.0.0. Direct import from submodule may break.
Detection
✓ from norfair import Detection
✗ import norfair.Detection
Detection is a class, not a module.
Minimal example using a distance-based tracker with point detections.
import norfair
# Initialize tracker
tracker = norfair.Tracker(distance_function="euclidean", distance_threshold=30)
# Example detection from a detector
detections = [
norfair.Detection(points=norfair.Point(x=10, y=20)),
norfair.Detection(points=norfair.Point(x=50, y=60)),
]
# Update tracker with current detections
tracked_objects = tracker.update(detections=detections)
# Print tracked object IDs
for obj in tracked_objects:
print(f"Tracked ID: {obj.id}")
Errors
Common errors & fixes
ImportError: cannot import name 'Tracker' from 'norfair'
Using an older version of norfair (<2.0.0) where Tracker was in a submodule.
fixUpgrade to norfair >=2.0.0: pip install --upgrade norfair
AttributeError: 'Detection' object has no attribute 'points'
Detection object was created incorrectly (e.g., passing coordinates as raw list instead of norfair.Point).
fixCorrect construction: Detection(points=[norfair.Point(x, y)])
TypeError: __init__() got an unexpected keyword argument 'hit_inertia_max'
Using old parameter names from before v1.0.0.
fixUpdate to new names: hit_counter_max instead of hit_inertia_max.
Upgrade
Version history
2.3.0latest on PyPI · released Apr 30, 2025
Audit
Dependencies
opencv-pythonrequiredRequired for drawing and video handling.
numpyrequiredCore dependency for array operations.
richoptionalFor console output formatting.