Examples, counting by class
How many people, bicycles and cars cross each line?
Two lines over a car park seen from above, one a tenth of the way in from each edge, count every class the experiment tracks, in both directions. The same pattern counts pedestrians and vehicles on a street or at a building entrance.
Switch the video off to see only what the run stored.
What the run recorded
YOLO11m on cuda:0 with ByteTrack, tracking person, bicycle, car. The arrow on each line points in its forward direction, which is to the left for both lines here.
West edge 3 crossings
East edge 5 crossings
| Line | Total | Forward | Reverse | By class |
|---|---|---|---|---|
| West edge | 3 | 2 | 1 | car 2, person 1 |
| East edge | 5 | 0 | 5 | person 3, bicycle 2 |
Tracked objects by class: person 4, bicycle 2, car 2.
Why a cyclist counts twice
The detector sees the rider as a person and the bicycle as a bicycle. Both are tracked, so one cyclist adds one person and one bicycle to a line that counts both classes. That is why the East edge shows three people: one pedestrian and two riders.
To count cyclists, count bicycles. To count pedestrians only, subtract the bicycles from the people, or draw a line that tracks only people where cyclists do not pass. Guide 07 walks through both.
Reproduce it
- Install CV-Scope; the setup downloads this clip too.
- Follow guide 07 to draw the two lines and track three classes.
- Leave part of the picture out with an ignore area, as in guide 08.
Clip: person-bicycle-car-detection.mp4, Intel IoT DevKit sample videos, CC BY 4.0. Data exported 2026-09-29 from CV-Scope at commit 14ae109.