Keras-YOLOv4 icon indicating copy to clipboard operation
Keras-YOLOv4 copied to clipboard

数据增强代码BUG

Open zhiyoujingtian opened this issue 4 years ago • 2 comments

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. 这一部分代码是变成 中心点,应该是有误的吧  不需要它

zhiyoujingtian avatar Jun 15 '20 11:06 zhiyoujingtian

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

miemie2013 avatar Jun 17 '20 15:06 miemie2013

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

顶点坐标转中心+长宽的话,是没有错误的

mhcao916 avatar Jul 28 '20 01:07 mhcao916