The Problem

Estimating vehicle speed from video frames requires object detection, segmentation, and tracking. Without an integrated pipeline, users must stitch together YOLO‑v8 segmentation, DeepSORT tracking, and custom geometry to compute speed, which is time‑consuming and error‑prone.

What This Does

The repository provides a single Jupyter notebook CopyofYOLOv8objecttrackingcountingspeed.ipynb that demonstrates a workflow for speed estimation using YOLO‑v8 segmentation and DeepSORT tracking. The notebook references a modified predict.py (originally from the Ultralytics YOLO‑v8 segmentation repo) to run inference, but the script itself is not included in the repository. The README merely restates the intent and points to Google Colab as the execution environment.

Key actions performed in the notebook:

Load a pre‑trained YOLO‑v8 segmentation model. Run inference on video frames via the (missing) predict.py entry point. Feed detection results to DeepSORT for persistent IDs. Compute per‑object displacement across frames and convert to speed using a hard‑coded pixel‑to‑meter scale.

How To Use It

Prepare the environment – the notebook expects the Ultralytics YOLO‑v8 package and DeepSORT dependencies. Install them in a fresh Colab or local Python 3.9+ environment:

pip install ultralytics==8. # YOLO‑v8 pip install opencv-python deepsortrealtime Obtain the missing inference script – the notebook calls !python segmentation/predict.py .... Clone the official YOLO‑v8 segmentation repo, copy its predict.py into a segmentation/ sub‑folder, and apply the modifications described in the notebook cells (typically adjusting --conf and --save-txt flags). Run the notebook – open CopyofYOLOv8objecttrackingcountingspeed.ipynb in Colab or Jupyter, execute cells sequentially. Provide the path to the input video when prompted and optionally adjust the PIXELTOMETER constant used for speed conversion. Inspect results – the notebook saves an output video with bounding‑box IDs and speed annotations, and prints a summary table of average speeds per tracked object.

No configuration files, environment‑variable definitions, or CLI wrappers are present; all parameters are hard‑coded or entered interactively in the notebook.*

Real‑World Use

A traffic‑monitoring operator could upload a short street‑camera clip to the notebook, run the cells, and obtain per‑vehicle speed estimates without writing custom tracking code. Example integration flow:

from pathlib import Path videopath = Path("/data/intersection.mp4") Run notebook programmatically (nbconvert) or call the same functions defined in cells speeddf = runspeedestimation(videopath) speeddf.tocsv("intersectionspeeds.csv")

Code Health & Issues

Medium – Missing source files – segmentation/predict.py is referenced but not in the repo; the notebook cannot run without it. Medium – No automated tests – No test suite; inference and speed calculations are unverified beyond the notebook demonstration. Medium – No CI/CD – Absence of GitHub Actions or other pipelines means regressions are unchecked. Medium – No license – Repository lacks a LICENSE file, leaving usage rights ambiguous. Low – Hard‑coded constants – Pixel‑to‑meter conversion and camera‑frame rate are fixed in the notebook, limiting portability. Low – Minimal documentation – README provides only a title; detailed usage instructions are only implicit in notebook cells.

The Bottom Line

The repo offers a proof‑of‑concept notebook that ties YOLO‑v8 segmentation to DeepSORT for speed estimation, but it is incomplete without the required predict.py script and lacks any production‑grade scaffolding (tests, CI, licensing). It may be useful as a quick demo for researchers comfortable filling the missing pieces, but it requires substantial integration work before reliable deployment.