Its an image classification model (CNN) to classify fire images from nonfire images.
- the most data in our datset are images based on outdoor environment so it's not suitable for classifying indoor environments.
for train a model, one can easily run the python3 train.py with this argument:
python3 train.py -c train_config.json
The paths of all data and backbone weights are in Aparat2 Server. For more details refer to fire_image_classification/train/data_path/data_path.txt
-
train_path: tain path of data wich includes fire and Nonfire folders. -
test_path: validation path of data wich includes fire and Nonfire folders. -
num_epoch: an integer number of epochs. -
learning_rate: a float number (for example: 0.001). -
backbone_name: a string value based on the existence models (for example: "resnet18", "mobilenet") -
model_json_file: a json model architecture path based on the existence models(for mobilenet its valus in None) -
path_weight: path of weights. -
checkpoint_path: path for saving checkpoints. -
num_freeze: an integer number to freeze backbone layers (for mobilenetv2 its value is 15 but for resnet18 its value is 78). -
target_shape: a tuple of integer numbers to set inputs shape of model (for example [448, 448]) -
batch_size: an integer number of batch size of images. -
early_stopping_mode: a string value based on the existence models (for example: empty string "" for resnet18, any string value for mobilenetv2). -
lr_reduction_mode: a string value based on the existence models (for example: empty string "" for resnet18, any string value for mobilenetv2).
To run this product you can activate this virtual environment:
source /home/bahrami/fire/new_git_FC/bin/activate
You can easily run the python3 example.py with no argument.
python3 example.py