This repository contains code for a Fire Detection system using deep learning techniques. The system utilizes the ResNet50 architecture pre-trained on the ImageNet dataset and is fine-tuned for the task of detecting fires in images.
The project consists of the following main components:
-
Data Collection: The dataset used for training, validation, and testing is organized into directories containing images of fire and non-fire scenarios.
-
Data Preprocessing: Data augmentation techniques are applied to generate additional training samples and enhance the diversity of the dataset.
-
Model Training: A deep learning model based on the ResNet50 architecture is trained using the preprocessed data. The training script can be found in the
training.pyfile. -
Model Evaluation: The trained model is evaluated on a separate test dataset to assess its performance in detecting fires.
-
Prediction: The trained model can be used to predict whether a given image contains a fire or not. An example of how to use the model is provided in the
Model_Use.ipynbnotebook. -
Deployment: The deployment folder contains a
Main.pyfile which serves as the entry point for deploying the model locally. To deploy the model, run the following command:
streamlit run deployment/Main.py- Clone the repository:
git clone https://github.com/datharv07/Fire-Detection.git- Install the required dependencies:
pip install -r requirements.txt- Train the model:
python training.ipynb- Make predictions:
python Model Use .ipynb path_to_imageReplace path_to_image with the path to the image you want to make predictions on.
The following Python libraries are required to run the code:
- tensorflow
- keras
- numpy
- pandas
- matplotlib
- seaborn
- scikit-learn
- opencv-python
- tqdm
- pillow
- scikit-image
These dependencies can be installed using the requirements.txt file provided in the repository.
