diff --git a/configs/mot/jde/_base_/jde_reader_1088x608.yml b/configs/mot/jde/_base_/jde_reader_1088x608.yml index fc98fe374091513028f73a3b63734b8fdeeaf422..8855041a2f510b95c4cabe558814123cf696f465 100644 --- a/configs/mot/jde/_base_/jde_reader_1088x608.yml +++ b/configs/mot/jde/_base_/jde_reader_1088x608.yml @@ -4,7 +4,7 @@ TrainReader: - Decode: {} - AugmentHSV: {} - LetterBoxResize: {target_size: [608, 1088]} - - RandomAffine: {} + - MOTRandomAffine: {} - RandomFlip: {} - BboxXYXY2XYWH: {} - NormalizeBox: {} diff --git a/configs/mot/jde/jde_darknet53_30e_1088x608.yml b/configs/mot/jde/jde_darknet53_30e_1088x608.yml index 2549e2811cff8253d3976020370fde91615e8609..9aa2eaa96e50e1d5cd4267e36793fad2967514ad 100644 --- a/configs/mot/jde/jde_darknet53_30e_1088x608.yml +++ b/configs/mot/jde/jde_darknet53_30e_1088x608.yml @@ -44,3 +44,4 @@ JDEBBoxPostProcess: nms_threshold: 0.4 nms_top_k: 2000 normalized: true + return_index: true diff --git a/ppdet/data/source/mot.py b/ppdet/data/source/mot.py index e38432c9bb7618531901266510fb177df606bbb7..ba7e9d20552e89199bbfde536928b43afaab751a 100644 --- a/ppdet/data/source/mot.py +++ b/ppdet/data/source/mot.py @@ -214,6 +214,9 @@ class MOTDataSet(DetDataset): gt_class = labels[:, 0:1].astype('int32') gt_score = np.ones((len(labels), 1)).astype('float32') 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 = { 'im_file': img_file, diff --git a/ppdet/data/transform/operators.py b/ppdet/data/transform/operators.py index 2af79df1597a28d74dc5ce46d5ec6d5ddec15f5c..cc6218857884a5d64957eca079898787a2f8b210 100644 --- a/ppdet/data/transform/operators.py +++ b/ppdet/data/transform/operators.py @@ -2014,7 +2014,7 @@ class Rbox2Poly(BaseOperator): @register_op 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. Args: @@ -2075,7 +2075,7 @@ class Norm2PixelBbox(BaseOperator): @register_op -class RandomAffine(BaseOperator): +class MOTRandomAffine(BaseOperator): def __init__(self, degrees=(-5, 5), translate=(0.10, 0.10), @@ -2083,9 +2083,17 @@ class RandomAffine(BaseOperator): shear=(-2, 2), 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.translate = translate self.scale = scale diff --git a/ppdet/modeling/layers.py b/ppdet/modeling/layers.py index b6c13f38acac1e7dd87658f4a7355dea9054f198..b420d51fe27a31446263c57001d45cd4fd5226a9 100644 --- a/ppdet/modeling/layers.py +++ b/ppdet/modeling/layers.py @@ -410,6 +410,7 @@ class MultiClassNMS(object): nms_threshold=.5, normalized=True, nms_eta=1.0, + return_index=False, return_rois_num=True): super(MultiClassNMS, self).__init__() self.score_threshold = score_threshold @@ -418,6 +419,7 @@ class MultiClassNMS(object): self.nms_threshold = nms_threshold self.normalized = normalized self.nms_eta = nms_eta + self.return_index = return_index self.return_rois_num = return_rois_num def __call__(self, bboxes, score, background_label=-1):