美文网首页
data_augment.py

data_augment.py

作者: YJHMITWEB | 来源:发表于2017-09-30 23:55 被阅读0次

augment模式:

水平翻转,horizontal_flips:

翻转图像:cv2.flip

翻转bbox:
for bbox in img_data_aug['bboxes']:

     x1 = bbox['x1]

     x2 = bbox['x2']

     bbox['x2'] = cols - x1

     bbox['x1'] = cols - x2

垂直翻转,vertical_flips;

旋转90°、180°、270°


augment之后的图片尺寸必须和原图相同:

img_data_aug['width'] = img.shape[1]

img_data_aug['height'] = img.shape[0]


return img_data_aug, img

返回原图和aug_data

相关文章

  • data_augment.py

    augment模式: 水平翻转,horizontal_flips: 翻转图像:cv2.flip 翻转bbox:fo...

网友评论

      本文标题:data_augment.py

      本文链接:https://www.haomeiwen.com/subject/vsjajxtx.html