How joireve/passerby works
Passerby is a C++ pedestrian-detection application for images and video. Its main workflow parses CLI options, selects and opens a source reader, reads frames, runs YOLOv8 inference and postprocessing, then writes per-frame CSV and optionally displays annotated frames. The graph also preserves engine selection, timing, and allocation statistics. Some implementation details are unsampled; documented capabilities are shown where supported, and uncertain links are omitted.
Main entry points: main.cpp Application loop · PedestrianDetector.cpp Pedestrian detector · FrameReaderFactory.cpp Reader factory · yolov8n.onnx ONNX model
Components 16
Runtime orchestration
- Application loop
src/main.cpp - CSV output
src/main.cpp - Window display
src/main.cpp
Frame input
- Reader factory
src/FrameReaderFactory.cpp - Image reader
src/ImageFrameReader.cpp - Video reader
src/VideoFrameReader.cpp
Detection pipeline
- ONNX model
models/yolov8n.onnx - Pedestrian detector
src/PedestrianDetector.cpp - DNN engine selection
include/DnnEngine.hpp - LetterBox and blob
src/PedestrianDetector.cpp - DNN forward
src/PedestrianDetector.cpp - Decode and NMS
src/PedestrianDetector.cpp
Runtime observability
- Stage timing
src/StageTimeTracker.cpp - Allocation statistics
src/CountingAllocator.cpp
Other components
- CLI user
- OpenCV DNN
Connections 15
- CLI user → Application loop: provides options
README.md - Application loop → Reader factory: creates reader
src/main.cpp - Reader factory → Image reader: dispatches images
README.md - Reader factory → Video reader: dispatches videos
README.md - Application loop → Pedestrian detector: runs detection
src/main.cpp - Application loop → CSV output: writes detections
src/main.cpp - Application loop → Window display: displays frames
src/main.cpp - ONNX model → Pedestrian detector: loaded by
README.md - Pedestrian detector → DNN engine selection: selects engine
src/PedestrianDetector.cpp - Pedestrian detector → LetterBox and blob: preprocesses frames
src/PedestrianDetector.cpp - Pedestrian detector → DNN forward: runs inference
src/PedestrianDetector.cpp - Pedestrian detector → Decode and NMS: postprocesses output
src/PedestrianDetector.cpp - DNN forward → OpenCV DNN: calls DNN
src/PedestrianDetector.cpp - Application loop → Stage timing: records stages
src/main.cpp - Application loop → Allocation statistics: counts allocations
src/main.cpp