Skip to content

A computer vision system that detects and counts cars and people in an image or a video stream, specifically identifying blue cars.

License

Notifications You must be signed in to change notification settings

ShravyaMalogi/Car-colour-detection

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

63 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🚙 Car Colour Detection along with People Count

Python
OpenCV
YOLO
License: MIT

Detects blue cars, counts vehicles, and counts people at traffic signals.


📌 Overview

This project uses YOLO object detection with a color classification model to detect cars at traffic signals, identify their colors, and count people.

It’s useful for traffic monitoring, enforcement, and analytics.


📂 Repository Structure

Car-colour-detection/
├── app.py
│ 
├── models/
│ └── blue_car_classifier.keras
│
├── yolo/
│ └── yolov8s.pt
│
├── style.css
│
├── notebooks/
│ └── Car_Colour_Detection.ipynb
│
├── data/
│ ├── input/
│ │ └── sample_inputs
│ └── output/
│   └── sample_outputs
│
├── results/
│ ├── evaluation_metrics.png
│ ├── confusion_matrix.png
│ └── classification_report.png
│
├── requirements.txt
└── README.md


🚀 Features

  • 🚗 Colour-specific car detection
  • 🔲 Bounding Box for cars
  • 📊 Display of car colour & count + people count
  • ⚡ Works with images and video files
  • 🎯 Achieved ~96% Accuracy

📂 Dataset


📜 How It Works

  1. Detection → YOLO detects cars & people in each frame
  2. Classification → Car colours are identified
  3. Bounding Boxes
    • Blue cars → Red boxes
    • Other cars → Blue boxes
  4. Counting → Number of cars & people displayed on top

📈 Example Output

visuals output


▶️ How to Run

In GitHub Codespaces

# Update the package list and then install the libgl1 graphics library
sudo apt-get update && sudo apt-get install libgl1

# Install dependencies
pip install -r requirements.txt

# Run the Streamlit app
streamlit run app.py

On Local System

# Clone the repository
git clone https://github.com/ShravyaMalogi/Car-colour-detection.git
cd Car-colour-detection

# Install dependencies
pip install -r requirements.txt

# Run the Streamlit app
streamlit run app.py

About

A computer vision system that detects and counts cars and people in an image or a video stream, specifically identifying blue cars.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published