2 min read
Traffic Flow AI
Real-time AI traffic radar system using YOLOv10 model

Project Overview

TrafficFlow AI is a real-time vehicle radar system that uses computer vision to detect and count cars in a predefined area, identifying traffic jams and analyzing flow patterns as they happen.

The project was built during HackBCN, a 30-hour hackathon, by a team of 3 members. For most of us, it was the first time integrating an AI model into a real project.


My Role

My responsibilities spanned both ends of the stack. On the AI side, I implemented the YOLOv10 model to detect and count vehicles within a defined region of interest in the video feed. On the frontend side, I built the Next.js client to display the live detection results and traffic analysis in a clear, visual interface.

The biggest challenge was time: learning how to work with YOLOv10, integrate it into a pipeline, and ship a working demo — all within 30 hours and with no prior AI project experience.


Design Process

1

Step 1 — Problem Definition

Define a traffic monitoring use case achievable within 30 hours: detect vehicles in a fixed area and identify congestion in real time.

2

Step 2 — Model Selection

Evaluated object detection options and selected YOLOv10 for its balance of speed and accuracy, suitable for real-time inference.

3

Step 3 — YOLOv10 Integration

Set up the Python inference pipeline: load the model, define the region of interest, and run frame-by-frame vehicle detection on a video stream.

4

Step 4 — Traffic Logic

Implement vehicle counting and congestion thresholds to classify traffic state (free flow, slow, jammed) based on detected car density.

5

Step 5 — Frontend

Built the Next.js interface to consume the detection data and display live stats, vehicle counts, and traffic state in a dashboard.

6

Step 6 — Demo & Presentation

Integrated all components into a working end-to-end demo and presented at HackBCN with real-time detection running on sample traffic footage.


Features

Vehicle Detection
YOLOv10 model detects and counts cars in a predefined area of the video feed in real time.
Traffic Analysis
Classifies traffic state based on vehicle density: free flow, slow, or jammed.
Live Dashboard
Next.js frontend displays real-time detection results, vehicle counts, and traffic status.
YOLOv10
Object detection model selected for its balance of inference speed and accuracy on video streams.
30-Hour Build
Designed, trained, integrated, and demoed during a single HackBCN hackathon session.
Region of Interest
Detection focused on a configurable area of the frame, reducing noise and improving accuracy.

Tech Stack

LayerTechnology
Object detectionYOLOv10
AI / inferencePython
FrontendNext.js

Conclusions

TrafficFlow AI was a first contact with applied AI under real pressure. Going from zero AI project experience to a working YOLOv10 pipeline with a live frontend in 30 hours forced rapid learning and decisive prioritization.

Beyond the technical side, the hackathon context taught us to scope aggressively, cut non-essential features early, and focus energy on what makes a demo convincing. The result was a functional traffic radar that detected vehicles in real time and classified congestion. Given more time, the pipeline could support more camera angles, real traffic feeds, and finer congestion thresholds.

Related Content

esc close

Keyboard Shortcuts

Global Shortcuts

Open command palette
⌘K or Ctrl+K
Go to Projects
g then p
Go to Work
g then w
Go to Blog
g then b
Go to Home
g then h
Show keyboard shortcuts ?

Navigation Shortcuts

Scroll down j
Scroll up k
Jump to top gg
Jump to bottom G
Go back h
Go forward l
Jump to prev section [
Jump to next section ]

Palette Shortcuts

Quick select result 1-9
Navigate results ↑↓
Select result
Close palette Esc

Tips

  • Global shortcuts work from anywhere on the site
  • Press g twice quickly for chord shortcuts
  • Number shortcuts (1-9) only appear for the first 9 results
  • Chord shortcuts show a visual indicator in the bottom right
  • Navigation shortcuts (j/k/[/]) don't work when typing in input fields