def main(): baseModel = ResNet50(include_top=False, pooling='avg', weights='imagenet') fire_detector_model = lib.createModel( baseModel, hidden_layers, num_classes) history = lib.trainModel(dataset, fire_detector_model, epochs, batch_size, image_size, preprocess_input) if(output_pdf): lib.create_pdf(history, model_name) lib.testModel(fire_detector_model, batch_size, dataset, num_classes, model_name, image_size, preprocess_input, output_statistics) fire_detector_model.save(f'saved_models/{model_name}.h5')
def main(): fire_detector_model = Sequential([ Flatten(), Dense(25, activation="relu"), Dense(10, activation="relu"), Dense(2, activation='softmax') ]) fire_detector_model.compile(optimizer='rmsprop', loss='categorical_crossentropy', metrics=lib.METRICS) history = lib.trainModel(dataset, fire_detector_model, epochs, batch_size, image_size, preprocess_input) if output_pdf: lib.create_pdf(history, model_name) lib.testModel(fire_detector_model, batch_size, dataset, num_classes, model_name, image_size, preprocess_input, output_statistics) fire_detector_model.save(f'saved_models/{model_name}.h5')