Пример #1
0
    x = model.output
    x = SpatialPyramidPooling([1, 2, 3, 6])(x)
    # x = Dense(1024, activation='relu')(x)
    predictions = Dense(classes, activation='softmax')(x)
    model = Model(inputs=model.input,
                  outputs=predictions,
                  name='inception_v3_spp')
    return model


if __name__ == "__main__":
    start = datetime.now()
    model = InceptionV1(include_top=True,
                        input_shape=(224, 224, 3),
                        weights=None,
                        classes=2)
    # model = make_model()

    model.summary()
    util = ModelUtils(epochs=120)
    # util.get_train_data(resize=(224, 224))

    # util.train(model)
    # util.evaluate()
    # util.save()
    # util.confusion_matrix()
    # util.plot_loss_accuracy()
    util.plot_multiple_roc(model, (224, 224))

    time_elapsed = datetime.now() - start
    print('Time elapsed (hh:mm:ss.ms) {}'.format(time_elapsed))
Пример #2
0
from datetime import datetime
from utils.model_utils import ModelUtils
import tensorflow as tf
tf.set_random_seed(1000)
random.seed(1000)
np.random.seed(1000)
MODEL_SIZE=(227, 227)

if __name__ == "__main__":
    start = datetime.now()
    # CREATE MODEL 
    alexnet = AlexNet(input_shape=(227,227, 3), classes=2)

    model = alexnet.model()

    model.summary()

    util = ModelUtils(epochs=120)
    util.get_train_data()
    # util.get_val_data(resize=(MODEL_SIZE))

    # util.train(model)
    # util.evaluate()
    # util.save()
    # util.confusion_matrix()
    # util.plot_roc_curve()
    # util.plot_loss_accuracy()
    util.plot_multiple_roc(model)
    
    time_elapsed = datetime.now() - start 
    print('Time elapsed (hh:mm:ss.ms) {}'.format(time_elapsed))