未验证 提交 1c582c26 编写于 作者: G George Ni 提交者: GitHub

[MOT] Fix JDE gt_ide, transform and nms (#2993)

* fix hsv randomaffine

* fix nms return_index

* fix gt_ide by tid_start_index
上级 4e88bec5
...@@ -4,7 +4,7 @@ TrainReader: ...@@ -4,7 +4,7 @@ TrainReader:
- Decode: {} - Decode: {}
- AugmentHSV: {} - AugmentHSV: {}
- LetterBoxResize: {target_size: [608, 1088]} - LetterBoxResize: {target_size: [608, 1088]}
- RandomAffine: {} - MOTRandomAffine: {}
- RandomFlip: {} - RandomFlip: {}
- BboxXYXY2XYWH: {} - BboxXYXY2XYWH: {}
- NormalizeBox: {} - NormalizeBox: {}
......
...@@ -44,3 +44,4 @@ JDEBBoxPostProcess: ...@@ -44,3 +44,4 @@ JDEBBoxPostProcess:
nms_threshold: 0.4 nms_threshold: 0.4
nms_top_k: 2000 nms_top_k: 2000
normalized: true normalized: true
return_index: true
...@@ -214,6 +214,9 @@ class MOTDataSet(DetDataset): ...@@ -214,6 +214,9 @@ class MOTDataSet(DetDataset):
gt_class = labels[:, 0:1].astype('int32') gt_class = labels[:, 0:1].astype('int32')
gt_score = np.ones((len(labels), 1)).astype('float32') gt_score = np.ones((len(labels), 1)).astype('float32')
gt_ide = labels[:, 1:2].astype('int32') gt_ide = labels[:, 1:2].astype('int32')
for i, _ in enumerate(gt_ide):
if gt_ide[i] > -1:
gt_ide[i] += self.tid_start_index[data_name]
mot_rec = { mot_rec = {
'im_file': img_file, 'im_file': img_file,
......
...@@ -2014,7 +2014,7 @@ class Rbox2Poly(BaseOperator): ...@@ -2014,7 +2014,7 @@ class Rbox2Poly(BaseOperator):
@register_op @register_op
class AugmentHSV(BaseOperator): class AugmentHSV(BaseOperator):
def __init__(self, fraction=0.50, is_bgr=True): def __init__(self, fraction=0.50, is_bgr=False):
""" """
Augment the SV channel of image data. Augment the SV channel of image data.
Args: Args:
...@@ -2075,7 +2075,7 @@ class Norm2PixelBbox(BaseOperator): ...@@ -2075,7 +2075,7 @@ class Norm2PixelBbox(BaseOperator):
@register_op @register_op
class RandomAffine(BaseOperator): class MOTRandomAffine(BaseOperator):
def __init__(self, def __init__(self,
degrees=(-5, 5), degrees=(-5, 5),
translate=(0.10, 0.10), translate=(0.10, 0.10),
...@@ -2083,9 +2083,17 @@ class RandomAffine(BaseOperator): ...@@ -2083,9 +2083,17 @@ class RandomAffine(BaseOperator):
shear=(-2, 2), shear=(-2, 2),
borderValue=(127.5, 127.5, 127.5)): borderValue=(127.5, 127.5, 127.5)):
""" """
Transform the image data with random affine Affine transform to image and coords to achieve the rotate, scale and
shift effect for training image.
Args:
degrees (tuple): rotation value
translate (tuple): xy coords translation value
scale (tuple): scale value
shear (tuple): shear value
borderValue (tuple): border color value
""" """
super(RandomAffine, self).__init__() super(MOTRandomAffine, self).__init__()
self.degrees = degrees self.degrees = degrees
self.translate = translate self.translate = translate
self.scale = scale self.scale = scale
......
...@@ -410,6 +410,7 @@ class MultiClassNMS(object): ...@@ -410,6 +410,7 @@ class MultiClassNMS(object):
nms_threshold=.5, nms_threshold=.5,
normalized=True, normalized=True,
nms_eta=1.0, nms_eta=1.0,
return_index=False,
return_rois_num=True): return_rois_num=True):
super(MultiClassNMS, self).__init__() super(MultiClassNMS, self).__init__()
self.score_threshold = score_threshold self.score_threshold = score_threshold
...@@ -418,6 +419,7 @@ class MultiClassNMS(object): ...@@ -418,6 +419,7 @@ class MultiClassNMS(object):
self.nms_threshold = nms_threshold self.nms_threshold = nms_threshold
self.normalized = normalized self.normalized = normalized
self.nms_eta = nms_eta self.nms_eta = nms_eta
self.return_index = return_index
self.return_rois_num = return_rois_num self.return_rois_num = return_rois_num
def __call__(self, bboxes, score, background_label=-1): def __call__(self, bboxes, score, background_label=-1):
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册