Directional headcounts from a webcam and some glue code
It glues YOLOv5 and DeepSORT into a ready-to-run demo that counts pedestrians and vehicles crossing a virtual line, splitting the tally by direction.

What it does This project detects and tracks six default classes—pedestrians, bicycles, cars, motorcycles, buses, and trucks—then tallies how many cross a virtual boundary in each direction. It is essentially a practical integration of existing detection and tracking code, built as a ready-to-run demo rather than a general-purpose framework.
The interesting bit
Instead of just drawing bounding boxes, it uses two polygons in main.py as directional gates, giving separate “in” and “out” counts. That turns the standard YOLOv5-plus-DeepSORT stack into a simple traffic analytics tool, though you tune it by editing source coordinates rather than waving a config file at it.
Key highlights
- Detects and tracks six default classes using YOLOv5 and DeepSORT, with categories adjustable in
detector.py - Splits traffic into “in” and “out” counts using two polygons defined in
main.py - Ships with a Bilibili video demo and a 140 MB test video (hosted on Baidu Pan)
- Acts as a use-case-specific wrapper around three existing repositories
Caveats
- All configuration shown in the README requires editing specific lines in
main.pyanddetector.py; no command-line interface or config file is mentioned - The README and code comments are in Chinese
- The repository contains weights and video files, so the maintainers warn that cloning may be slow
Verdict Worth a look if you want a hackable, offline baseline for directional people or vehicle counting. Skip it if you need a production-grade, configurable video analytics platform.
Frequently asked
- What is dyh/unbox_yolov5_deepsort_counting?
- It glues YOLOv5 and DeepSORT into a ready-to-run demo that counts pedestrians and vehicles crossing a virtual line, splitting the tally by direction.
- Is unbox_yolov5_deepsort_counting open source?
- Yes — dyh/unbox_yolov5_deepsort_counting is an open-source project tracked on heatdrop.
- What language is unbox_yolov5_deepsort_counting written in?
- dyh/unbox_yolov5_deepsort_counting is primarily written in Python.
- How popular is unbox_yolov5_deepsort_counting?
- dyh/unbox_yolov5_deepsort_counting has 1.1k stars on GitHub.
- Where can I find unbox_yolov5_deepsort_counting?
- dyh/unbox_yolov5_deepsort_counting is on GitHub at https://github.com/dyh/unbox_yolov5_deepsort_counting.