IT Vizag
← Computer Vision in Practice

▶ 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-up

Time 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

🔒 Code example: sign up free (above) to unlock it.

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.

Tip: Ship a simple version first, with one camera and one direction. Then extend it once the counts match the manual check.

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.

Saved on this device. Sign in to keep progress everywhere.

Share with a friend