This script performs traffic flow analysis using YOLOv8, an object-detection method and ByteTrack, a simple yet effective online multi-object tracking method. It uses the supervision package for multiple tasks such as tracking, annotations, etc.
traffic_analysis_result.mov
-
clone repository and navigate to example directory
git clone https://github.com/roboflow/supervision.git cd supervision/examples/traffic_analysis -
setup python environment and activate it [optional]
python3 -m venv venv source venv/bin/activate -
install required dependencies
pip install -r requirements.txt
-
download
traffic_analysis.ptandtraffic_analysis.movfiles./setup.sh
python script.py \
--source_weights_path data/traffic_analysis.pt \
--source_video_path data/traffic_analysis.mov \
--confidence_threshold 0.3 \
--iou_threshold 0.5 \
--target_video_path data/traffic_analysis_result.mov