diff --git a/utils/utils.py b/utils/utils.py index 2994711e61c05184f7bc6cd93e9be510337c8a44..ed334a40cef38ed31c6190dfd1b83b6a3471e374 100644 --- a/utils/utils.py +++ b/utils/utils.py @@ -98,7 +98,7 @@ def merge_bboxes(bboxes, cutx, cuty): merge_bbox.append(tmp_box) return merge_bbox -def get_random_data_with_Mosaic(annotation_line, input_shape, max_boxes=50, hue=.1, sat=1.5, val=1.5): +def get_random_data_with_Mosaic(annotation_line, input_shape, max_boxes=100, hue=.1, sat=1.5, val=1.5): '''random preprocessing for real-time data augmentation''' h, w = input_shape min_offset_x = 0.4 @@ -206,7 +206,7 @@ def get_random_data_with_Mosaic(annotation_line, input_shape, max_boxes=50, hue= return new_image, box_data -def get_random_data(annotation_line, input_shape, max_boxes=50, jitter=.3, hue=.1, sat=1.5, val=1.5): +def get_random_data(annotation_line, input_shape, max_boxes=100, jitter=.3, hue=.1, sat=1.5, val=1.5): '''random preprocessing for real-time data augmentation''' line = annotation_line.split() image = Image.open(line[0]) @@ -216,7 +216,7 @@ def get_random_data(annotation_line, input_shape, max_boxes=50, jitter=.3, hue=. # 对图像进行缩放并且进行长和宽的扭曲 new_ar = w/h * rand(1-jitter,1+jitter)/rand(1-jitter,1+jitter) - scale = rand(.5, 1.5) + scale = rand(.25, 2) if new_ar < 1: nh = int(scale*h) nw = int(nh*new_ar)