My Project

Threat Detection in Videos using Faster R-CNN ๐ŸŽฅ๐Ÿšจ

Overview

This repository provides a Threat Detection solution using the Faster R-CNN (Region-based Convolutional Neural Network) model for analyzing videos. The model is trained to detect threats within video frames, making it a valuable tool for security and surveillance applications.

๐Ÿ“‹ Table of Contents

  1. Introduction
  2. Setup
  3. Training
  4. Testing
  5. Validation
  6. Usage
  7. Contributing
  8. License

๐Ÿš€ Introduction

The Faster R-CNN model is employed to identify threats within video frames. This solution allows for efficient threat detection and is customizable based on your dataset.

โš™๏ธ Setup

To get started, follow these steps:

  • Clone this repository to your local machine.
  • Install the required dependencies by running pip install -r requirements.txt.
  • Ensure that your dataset is organized with CSV annotations and image directories.

๐Ÿš‚ Training

To train the model, use the following command:

python train.py -cp <path_to_csv> -ip <path_to_images> -mp <main_directory_path> -simg <sample_image_count> -e <epochs> -sm <save_model_flag>
  • -cp or --csv_path: Path to the CSV file containing annotations.
  • -ip or --image_path: Path to the directory containing images.
  • -mp or --main_directory_path: Path to the main directory.
  • -simg or --sample_image: Number of total data samples.
  • -e or --epochs: Number of training epochs.
  • -sm or --save_model: Specify True if you want to save the trained model.

๐Ÿงช Testing

To test the model, use the following command:

python test.py -fp <file_path_to_test_image> --test_model True
  • -fp or --file_path: Path to the image for testing.
  • --test_model: Specify True to enable testing mode.

โœ”๏ธ Validation

Validation is an integral part of the training process, ensuring the model's generalization. During training, a portion of the dataset is used for validation. Adjust the parameters accordingly to achieve optimal performance.

๐Ÿ› ๏ธ Usage:

[Watch the video