How mzgl222/traffic-threat-detection-msc works
This repository is a video-based traffic-safety analysis application. Its main workflow processes video frames into tracked objects, derives world positions, zones, motion and crossing-risk metrics, evaluates pedestrian–vehicle risk, and writes tabular results. The source also includes standalone track, risk-event, risk-timeline, homography-point and VQA-to-CSV tools. The README provides no further capability detail; relationships for the sampled pipeline are grounded in its source, while some runner wiring is only partially excerpted.
Main entry points: pipeline.py Frame pipeline · run.py Frame runner · detector.py Detection and tracking · homography.py World calibration
Components 21
Video processing
- Frame runner
run.py - Frame pipeline
traffic_safety/pipeline.py
Object analysis
- Detection and tracking
traffic_safety/detector.py - World calibration
traffic_safety/homography.py - Zone classification
traffic_safety/zones.py - Track histories
traffic_safety/trajectory.py - Speed estimation
traffic_safety/speed.py - Object state
traffic_safety/state.py
Safety assessment
- Crosswalk metrics
traffic_safety/risk_metrics.py - Safety rules
traffic_safety/safety_rules.py
Results and tools
- Object results CSV
traffic_safety/csv_writer.py - Risk events CSV
traffic_safety/risk_event_writer.py - Risk timeline CSV
traffic_safety/risk_timeline_writer.py - Track analysis
scripts/analyze_tracks.py - Risk event analysis
scripts/analyze_risk_events.py - Risk timeline analysis
scripts/analyze_risk_timeline.py - Calibration point tool
scripts/select_homography_points.py - VQA CSV conversion
scripts/vqa2csv.py
Other components
- Operator
- Input video
- Annotated video
Connections 20
- Operator → Frame runner: starts
run.py - Input video → Frame runner: provides frames
run.py - Frame runner → Frame pipeline: processes frames
run.py - Frame pipeline → Detection and tracking: tracks objects
traffic_safety/pipeline.py - Frame pipeline → World calibration: projects positions
traffic_safety/pipeline.py - Frame pipeline → Zone classification: classifies zones
traffic_safety/pipeline.py - Frame pipeline → Track histories: updates histories
traffic_safety/pipeline.py - Frame pipeline → Speed estimation: estimates speed
traffic_safety/pipeline.py - Frame pipeline → Object state: estimates state
traffic_safety/pipeline.py - Frame pipeline → Crosswalk metrics: estimates TTC
traffic_safety/pipeline.py - Frame runner → Safety rules: evaluates objects
run.py - Frame runner → Object results CSV: writes objects
run.py - Frame runner → Risk events CSV: writes events
run.py - Frame runner → Risk timeline CSV: configures output
run.py - Frame runner → Annotated video: renders video
run.py - Operator → Track analysis: runs analysis
- Operator → Risk event analysis: runs analysis
- Operator → Risk timeline analysis: runs analysis
- Operator → Calibration point tool: selects points
- Operator → VQA CSV conversion: converts data