This is the repository reference for tracking objects moving toward the camera and flagging dangerous passes. Use it when you need motion-based safety logic on top of spatial detections and tracking.
- You need person tracking with a “moving toward camera” signal.
- You want a bird’s-eye view plus directional alert outputs.
- You need stereo-backed tracking rather than 2D-only tracklets.
- You only need standard person tracking.
- You need person-to-person distance checks instead of motion-toward-camera logic.
- You need a generic object tracker with no spatial branch.
Category:neural-networks/object-tracking/collision-avoidanceShape:script+standalonePrimary task:detect and track people moving dangerously toward the cameraEntrypoint:main.pyStandalone path:oakapp.tomlFrontend:noneRuns on:devices withCAM_A,CAM_B, andCAM_C; RVC2 peripheral, RVC4 peripheral, and RVC4 standalone packagingRequires:stereo depth, person detections, tracking, and calibrationInput:live color plus stereo pairOutput:Video,Tracklets,Direction, andBird FrameModels:YOLOv6 YAMLs in depthai_models/Visualizer / UI:DepthAI Visualizer viadai.RemoteConnection
- A
SpatialDetectionNetworkruns onCAM_Awith stereo depth fromCAM_B/C. ImgDetectionsFilterkeeps only thepersonlabel.ObjectTrackerproduces tracklets from the filtered spatial detections.- utils/collision_avoidance_node.py derives the “approaching camera” direction/alert stream.
- utils/host_bird_eye_view.py renders the overhead motion view.
- The current repo state is person-only because
person_labelis selected explicitly in main.py. - The example requires three cameras and aligned stereo depth.
- Alert quality depends on tracklet stability and Z-motion estimation, not just 2D motion.
- neural-networks/object-tracking/kalman: use this when you want smoothing of tracked spatial boxes instead of collision alerts
- neural-networks/object-detection/social-distancing: use this when you need person distance monitoring rather than motion-toward-camera logic
- neural-networks/object-tracking/people-tracker: use this when you need directional people-flow counts
Run:python3 main.pySuccess looks like:the Visualizer shows tracked people, direction output, and a bird’s-eye view that reacts to movement toward the cameraCommon failure meaning:the device lacks stereo cameras, tracklets are unstable, or the person-only filtering does not match the scene