▶ Sign up free for the video, slides & prompts
The lesson below is open to all. Enter your email once to unlock every video, slide deck, prompt and code example on this device.
Checking…
Computer Vision in Practice · Lesson 14 of 15 · 2 min read · 7 min video
Project: a vehicle counter for Vizag traffic
Detect, track and count vehicles from a traffic camera video, end to end.
📄 Download slides (PDF)· free sign-upTime to put it together. You'll build a system that counts vehicles by type at a busy junction, say the NAD flyover or Siripuram, from a traffic camera video.
1. Define the goal
- Count: cars, buses, bikes, autos and trucks crossing a line, in each direction
- Report: counts every 15 minutes, saved to a database
- Run: on a Jetson board at the junction, close to real time
2. Data
- Collect a few hours of video at different times: morning rush, noon, night and rain
- Sample frames, about 1 every 2 seconds, so you don't label near-duplicates
- Label 1,500–3,000 frames with boxes for all five classes, including auto-rickshaw, which standard datasets don't have
- Split by video clip, not by frame, so test clips are truly unseen
3. Train the detector
- Fine-tune a pre-trained YOLO small model on your labels
- Check mAP per class and look at the night and rain clips separately
- Add more labels for whatever class or condition is weakest, and retrain
4. Track and count
A real version also checks the direction of travel and saves each crossing with a timestamp.
5. Deploy to the edge
- Export to TensorRT with INT8 quantisation for the Jetson
- Re-check accuracy after export, then measure frames per second on the device
- Send only the counts to the server, not the video
6. Validate and monitor
- Count by hand for a few 15-minute windows and compare with the system. Aim for within 5%
- Alert if the camera goes offline or the counts drop to zero suddenly
- Recheck accuracy each season, especially through the monsoon
Privacy
Count vehicles; don't store faces or number plates, and keep raw video only briefly for debugging.
In one line
A vehicle counter combines a fine-tuned detector, a tracker, a counting line, edge deployment and manual validation, while keeping only the counts, not people's data.
Share with a friend