Пример #1
0
OS_UPPER_PATH = os.getcwd()
labels_path = OS_UPPER_PATH + "/Resources/SWUPark/test.txt"
root_images_folder = OS_UPPER_PATH + "/Resources/SWUPark/All"
weights_file = OS_UPPER_PATH + "/" + model_prop.weight_filename
text_output_filename = "TEXT_" + model_prop.weight_filename

#Initialize Variables
batch_size = 1000
image_color_channel = 3
image_size_w = 224
image_size_h = 224
resume_at_epoch = 0

#Initialize Necessary  Object
confusion_mat = ConfusionMatrixObject()
file_writer = FileWriterObject(f_name=OS_UPPER_PATH + "/" +
                               text_output_filename + ".final")

model = MiniAlexnet(base_lr=model_prop.base_lr,
                    momentum=model_prop.momentum,
                    decay_rate=model_prop.decay_rate,
                    nesterov=model_prop.nesterov)
model.load_weights(weights_file)
model.summary()

confusion_mat = ConfusionMatrixObject()

i = 0
while (True):
    x_test, y_test, test_num = read_labels_batch_out(