コード例 #1
0
ファイル: resnet50.py プロジェクト: kgorgi/Deepfire
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')
コード例 #2
0
ファイル: simple-neural-net.py プロジェクト: kgorgi/Deepfire
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')