diff --git a/configs/anchor_free/fcos_dcn_r50_fpn_1x.yml b/configs/anchor_free/fcos_dcn_r50_fpn_1x.yml index 1cbedb53ef3b80becf8758ed1482d7faf482a146..aa9ef34dae277e682a5e09fe86a6744d5402b3de 100644 --- a/configs/anchor_free/fcos_dcn_r50_fpn_1x.yml +++ b/configs/anchor_free/fcos_dcn_r50_fpn_1x.yml @@ -75,7 +75,7 @@ OptimizerBuilder: TrainReader: inputs_def: - fields: ['image', 'gt_bbox', 'gt_class', 'gt_score', 'im_info'] + fields: ['image', 'im_info', 'fcos_target'] dataset: !COCODataSet image_dir: train2017 diff --git a/configs/anchor_free/fcos_r50_fpn_1x.yml b/configs/anchor_free/fcos_r50_fpn_1x.yml index 9729ced122bcfc55863a7e42f4a69f8a6c7dd39e..1654d2a0836fa4a4d417833c2842aaf0e5d0c3b1 100644 --- a/configs/anchor_free/fcos_r50_fpn_1x.yml +++ b/configs/anchor_free/fcos_r50_fpn_1x.yml @@ -74,7 +74,7 @@ OptimizerBuilder: TrainReader: inputs_def: - fields: ['image', 'gt_bbox', 'gt_class', 'gt_score', 'im_info'] + fields: ['image', 'im_info', 'fcos_target'] dataset: !COCODataSet image_dir: train2017 diff --git a/configs/anchor_free/fcos_r50_fpn_multiscale_2x.yml b/configs/anchor_free/fcos_r50_fpn_multiscale_2x.yml index 5b215da1937502ae0e8ac9b032435cc45392a702..47078bf76cf3fb52ec5ff8d263606b54f4e23d4c 100644 --- a/configs/anchor_free/fcos_r50_fpn_multiscale_2x.yml +++ b/configs/anchor_free/fcos_r50_fpn_multiscale_2x.yml @@ -74,7 +74,7 @@ OptimizerBuilder: TrainReader: inputs_def: - fields: ['image', 'gt_bbox', 'gt_class', 'gt_score', 'im_info'] + fields: ['image', 'im_info', 'fcos_target'] dataset: !COCODataSet image_dir: train2017 diff --git a/ppdet/modeling/architectures/fcos.py b/ppdet/modeling/architectures/fcos.py index bb81a7e3de30bdc9fbbdbe018eb7e1f2c88ab6f0..af96fe76bdd64908b5496f53c874212735f0da36 100644 --- a/ppdet/modeling/architectures/fcos.py +++ b/ppdet/modeling/architectures/fcos.py @@ -107,7 +107,7 @@ class FCOS(object): 'is_difficult': {'shape': [None, 1], 'dtype': 'int32', 'lod_level': 1} } # yapf: disable - if 'gt_bbox' in fields: + if 'fcos_target' in fields: targets_def = { 'labels0': {'shape': [None, None, None, 1], 'dtype': 'int32', 'lod_level': 0}, 'reg_target0': {'shape': [None, None, None, 4], 'dtype': 'float32', 'lod_level': 0}, @@ -152,16 +152,15 @@ class FCOS(object): def build_inputs( self, image_shape=[3, None, None], - fields=[ - 'image', 'im_shape', 'im_id', 'gt_bbox', 'gt_class', 'is_crowd' - ], # for-train + fields=['image', 'im_info', 'fcos_target'], # for-train use_dataloader=True, iterable=False): inputs_def = self._inputs_def(image_shape, fields) - if "gt_bbox" in fields: + if "fcos_target" in fields: for i in range(len(self.fcos_head.fpn_stride)): fields.extend( ['labels%d' % i, 'reg_target%d' % i, 'centerness%d' % i]) + fields.remove('fcos_target') feed_vars = OrderedDict([(key, fluid.data( name=key, shape=inputs_def[key]['shape'],