Skip to content

balakrish181/Ambulance_detection

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Ambulance Detection System

A project developed for the Pragyan competition to identify emergency vehicles in real-time using audio and video analysis, helping to prioritize their route through traffic.

Overview

This system provides a proof-of-concept for intelligent traffic management by detecting ambulance sirens and vehicles. It uses a combination of audio and video processing to achieve this:

  • Audio Detection: A Convolutional Neural Network (CNN) classifies sound clips to distinguish between ambulance sirens, firetruck sirens, and general traffic noise. The audio is converted into a spectrogram image, which is then fed into the model.
  • Video Detection: A YOLOv3-tiny model is used for real-time object detection to visually identify ambulances in a video feed.

🎥 Demonstration

Check out a video of the system in action. This clip showcases both the audio and video detection capabilities.

Watch the Demonstration Video (audio.mp4)

📁 Project Structure

└── Ambulance_detection/
    ├── README.md
    ├── audio_model
    │   ├── .gitignore
    │   ├── dataset
    │   ├── mic.py
    │   ├── model
    │   ├── report
    │   ├── requirements.txt
    │   └── train.ipynb
    ├── video_model
    │   ├── save_.py
    │   ├── yolo_object_detection.py
    │   ├── yolov3-tiny_training.cfg
    │   └── yolov3-tiny_training_final.weights
    └── videos
        ├── audio.mp4
        └── out_yolo_ambu.mp4

The repository is organized into two main components:

  • audio_model/: Contains the complete pipeline for audio-based siren detection.
    • train.ipynb: A Jupyter Notebook to train the audio classification model.
    • mic.py: A script to run live inference using a microphone.
    • model/: Contains the pre-trained TensorFlow model.
    • dataset/: Holds the audio dataset for training.
  • video_model/: Contains the pipeline for video-based vehicle detection.
    • yolo_object_detection.py: A script for running inference on video files or a live camera feed.
    • yolov3-tiny_training_final.weights: Pre-trained weights for the YOLO model.
  • videos/: Contains sample videos for testing the video detection model.

Getting Started

Prerequisites

  • Python 3.7+
  • Pip

Installation

  1. Clone the repository:

    git clone Ambulance_detection
    cd Ambulance_detection
  2. Install the required dependencies: The audio model has its own set of dependencies.

    pip install -r audio_model/requirements.txt

    (Note: The video model dependencies like OpenCV need to be installed separately if not already present.)

How to Run

Audio Detection (from Microphone)

To start detecting sounds from your microphone in real-time:

python audio_model/mic.py

The script will listen for sounds and classify them as "Ambulance," "Firetruck," or "Traffic."

Video Detection

To run object detection on a video file:

python video_model/yolo_object_detection.py --video videos/your_video.mp4

Dataset

The audio classification model was trained on the Emergency Vehicle Siren Sounds dataset from Kaggle.


This project was developed a while back for a competition and has been reorganized for clarity and demonstration.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published