コード例 #1
0
def evaluate(images_filename, labels_filename, names_filename):
    images = deep_utils.load_image_data(images_filename)
    labels = deep_utils.load_labels(labels_filename, 2)
    names = np.load(names_filename)['arr_0']

    model = load_model(MODEL_FILENAME)
    return model.evaluate(images, labels)    
コード例 #2
0
    def load_train_datasets(self, fold_id):
        ids = deep_utils.load_ids(self.train_id_filenames[fold_id])

        data = deep_utils.load_image_data(self.data_filename)
        data = np.take(data, ids, axis=0)

        labels = deep_utils.load_labels(self.labels_filename, NUM_CLASSES)
        labels = np.take(labels, ids, axis=0)
        return (data, labels)
コード例 #3
0
 def load_pretrain_datasets(self):
     data = deep_utils.load_image_data(self.pretrain_data_filename)
     labels = deep_utils.load_labels(self.pretrain_labels_filename,
                                     NUM_CLASSES)
     return (data, labels)
コード例 #4
0
 def compute_number_of_elements(self):
     labels = deep_utils.load_labels(self.labels_filename, NUM_CLASSES)
     return labels.shape[0]