module) if X2 is None: return -1, -1 neg_samples = np.where(Y1[0, :, -1] == 1) pos_samples = np.where(Y1[0, :, -1] == 0) if len(pos_samples) > 0: pos_samples = pos_samples[0] else: pos_samples = [] return len(pos_samples), pos_samples all_imgs, classes_count, class_mapping = get_data('') if 'bg' not in classes_count: classes_count['bg'] = 0 class_mapping['bg'] = len(class_mapping) C.class_mapping = class_mapping inv_map = {v: k for k, v in class_mapping.items()} print('Training images per class:') pprint.pprint(classes_count) print('Num classes (including bg) = {}'.format(len(classes_count))) config_output_filename = 'config_options'
C = config.Config() C.use_horizontal_flips = horizontal_flips C.use_vertical_flips = vertical_flips C.rot_90 = rot_90 C.network = 'vgg' #C.record_path = record_path C.model_path = output_weight_path C.num_rois = num_rois C.base_net_weights = base_weight_path st = time.time() all_imgs, classes_count, class_mapping = simple_parser.get_data(train_path) if 'bg' not in classes_count: classes_count['bg'] = 0 class_mapping['bg'] = len(class_mapping) C.class_mapping = class_mapping # inv_map = {v: k for k, v in class_mapping.items()} print('Training images per class:') pprint.pprint(classes_count) print('Num classes (including bg) = {}'.format(len(classes_count))) print(class_mapping) # config_output_filename = options.config_filename