未验证 提交 d9275532 编写于 作者: J JiaQi Xu 提交者: GitHub

Update train.py

上级 baa3b89a
...@@ -44,14 +44,14 @@ def data_generator(annotation_lines, batch_size, input_shape, anchors, num_class ...@@ -44,14 +44,14 @@ def data_generator(annotation_lines, batch_size, input_shape, anchors, num_class
np.random.shuffle(annotation_lines) np.random.shuffle(annotation_lines)
if mosaic: if mosaic:
if flag and (i+4) < n: if flag and (i+4) < n:
image, box = get_random_data_with_Mosaic(annotation_lines[i:i+4], input_shape, random=True) image, box = get_random_data_with_Mosaic(annotation_lines[i:i+4], input_shape)
i = (i+4) % n i = (i+4) % n
else: else:
image, box = get_random_data(annotation_lines[i], input_shape, random=True) image, box = get_random_data(annotation_lines[i], input_shape)
i = (i+1) % n i = (i+1) % n
flag = bool(1-flag) flag = bool(1-flag)
else: else:
image, box = get_random_data(annotation_lines[i], input_shape, random=True) image, box = get_random_data(annotation_lines[i], input_shape)
i = (i+1) % n i = (i+1) % n
image_data.append(image) image_data.append(image)
box_data.append(box) box_data.append(box)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册