Keras-YOLOv4
Keras-YOLOv4 copied to clipboard
数据增强代码BUG
class BboxXYXY2XYWH(BaseOperator): """ Convert bbox XYXY format to XYWH format. """
def __init__(self):
super(BboxXYXY2XYWH, self).__init__()
def __call__(self, sample, context=None):
assert 'gt_bbox' in sample
bbox = sample['gt_bbox']
bbox[:, 2:4] = bbox[:, 2:4] - bbox[:, :2]
bbox[:, :2] = bbox[:, :2] + bbox[:, 2:4] / 2.
sample['gt_bbox'] = bbox
return sample
bbox[:, :2] = bbox[:, :2] + bbox[:, 2:4] / 2. 这一部分代码是变成 中心点,应该是有误的吧 不需要它
class BboxXYXY2XYWH(BaseOperator): """ Convert bbox XYXY format to XYWH format. """
def __init__(self): super(BboxXYXY2XYWH, self).__init__() def __call__(self, sample, context=None): assert 'gt_bbox' in sample bbox = sample['gt_bbox'] bbox[:, 2:4] = bbox[:, 2:4] - bbox[:, :2] bbox[:, :2] = bbox[:, :2] + bbox[:, 2:4] / 2. sample['gt_bbox'] = bbox return sample bbox[:, :2] = bbox[:, :2] + bbox[:, 2:4] / 2. 这一部分代码是变成 中心点,应该是有误的吧 不需要它
不是bug
class BboxXYXY2XYWH(BaseOperator): """ Convert bbox XYXY format to XYWH format. """
def __init__(self): super(BboxXYXY2XYWH, self).__init__() def __call__(self, sample, context=None): assert 'gt_bbox' in sample bbox = sample['gt_bbox'] bbox[:, 2:4] = bbox[:, 2:4] - bbox[:, :2] bbox[:, :2] = bbox[:, :2] + bbox[:, 2:4] / 2. sample['gt_bbox'] = bbox return sample bbox[:, :2] = bbox[:, :2] + bbox[:, 2:4] / 2. 这一部分代码是变成 中心点,应该是有误的吧 不需要它
不是bug
顶点坐标转中心+长宽的话,是没有错误的