diff --git a/configs/anchor_free/fcos_dcn_r50_fpn_1x.yml b/configs/anchor_free/fcos_dcn_r50_fpn_1x.yml index 7a4d770cd24188a57ba39430026545f0cd9a0d40..1cbedb53ef3b80becf8758ed1482d7faf482a146 100644 --- a/configs/anchor_free/fcos_dcn_r50_fpn_1x.yml +++ b/configs/anchor_free/fcos_dcn_r50_fpn_1x.yml @@ -8,7 +8,7 @@ save_dir: output pretrain_weights: https://paddle-imagenet-models-name.bj.bcebos.com/ResNet50_cos_pretrained.tar metric: COCO weights: output/fcos_dcn_r50_fpn_1x/model_final -num_classes: 81 +num_classes: 80 FCOS: backbone: ResNet @@ -32,7 +32,7 @@ FPN: has_extra_convs: true FCOSHead: - num_classes: 81 + num_classes: 80 fpn_stride: [8, 16, 32, 64, 128] num_convs: 4 norm_type: "gn" @@ -81,7 +81,7 @@ TrainReader: image_dir: train2017 anno_path: annotations/instances_train2017.json dataset_dir: dataset/coco - with_background: true + with_background: false sample_transforms: - !DecodeImage to_rgb: true @@ -111,7 +111,7 @@ TrainReader: norm_reg_targets: True batch_size: 2 shuffle: true - worker_num: 16 + worker_num: 4 use_process: false EvalReader: @@ -144,9 +144,9 @@ EvalReader: - !PadBatch pad_to_stride: 128 use_padded_im_info: true - batch_size: 8 + batch_size: 1 shuffle: false - worker_num: 2 + worker_num: 1 use_process: false TestReader: diff --git a/configs/anchor_free/fcos_r50_fpn_1x.yml b/configs/anchor_free/fcos_r50_fpn_1x.yml index 5ce9b7ce7da4f05bf5db65cb523e34ceb891e0e1..9729ced122bcfc55863a7e42f4a69f8a6c7dd39e 100644 --- a/configs/anchor_free/fcos_r50_fpn_1x.yml +++ b/configs/anchor_free/fcos_r50_fpn_1x.yml @@ -8,7 +8,7 @@ save_dir: output pretrain_weights: https://paddle-imagenet-models-name.bj.bcebos.com/ResNet50_cos_pretrained.tar metric: COCO weights: output/fcos_r50_fpn_1x/model_final -num_classes: 81 +num_classes: 80 FCOS: backbone: ResNet @@ -31,7 +31,7 @@ FPN: has_extra_convs: true FCOSHead: - num_classes: 81 + num_classes: 80 fpn_stride: [8, 16, 32, 64, 128] num_convs: 4 norm_type: "gn" @@ -80,7 +80,7 @@ TrainReader: image_dir: train2017 anno_path: annotations/instances_train2017.json dataset_dir: dataset/coco - with_background: true + with_background: false sample_transforms: - !DecodeImage to_rgb: true @@ -110,7 +110,7 @@ TrainReader: norm_reg_targets: True batch_size: 2 shuffle: true - worker_num: 16 + worker_num: 4 use_process: false EvalReader: @@ -143,7 +143,7 @@ EvalReader: - !PadBatch pad_to_stride: 128 use_padded_im_info: true - batch_size: 8 + batch_size: 1 shuffle: false worker_num: 2 use_process: false diff --git a/configs/anchor_free/fcos_r50_fpn_multiscale_2x.yml b/configs/anchor_free/fcos_r50_fpn_multiscale_2x.yml index f9369e31385c1619a87c075c7087ed32b0065501..5b215da1937502ae0e8ac9b032435cc45392a702 100644 --- a/configs/anchor_free/fcos_r50_fpn_multiscale_2x.yml +++ b/configs/anchor_free/fcos_r50_fpn_multiscale_2x.yml @@ -8,7 +8,7 @@ save_dir: output pretrain_weights: https://paddle-imagenet-models-name.bj.bcebos.com/ResNet50_cos_pretrained.tar metric: COCO weights: output/fcos_r50_fpn_multiscale_2x/model_final -num_classes: 81 +num_classes: 80 FCOS: backbone: ResNet @@ -31,7 +31,7 @@ FPN: has_extra_convs: true FCOSHead: - num_classes: 81 + num_classes: 80 fpn_stride: [8, 16, 32, 64, 128] num_convs: 4 norm_type: "gn" @@ -80,7 +80,7 @@ TrainReader: image_dir: train2017 anno_path: annotations/instances_train2017.json dataset_dir: dataset/coco - with_background: true + with_background: false sample_transforms: - !DecodeImage to_rgb: true @@ -110,7 +110,7 @@ TrainReader: norm_reg_targets: True batch_size: 2 shuffle: true - worker_num: 16 + worker_num: 4 use_process: false EvalReader: @@ -143,7 +143,7 @@ EvalReader: - !PadBatch pad_to_stride: 128 use_padded_im_info: true - batch_size: 8 + batch_size: 1 shuffle: false worker_num: 2 use_process: false diff --git a/ppdet/data/transform/batch_operators.py b/ppdet/data/transform/batch_operators.py index 5510465ac2860d82f378cab1f11d9d48d3a66a44..8da0b1e3573f0c0f571211fb66997334bae92cdf 100644 --- a/ppdet/data/transform/batch_operators.py +++ b/ppdet/data/transform/batch_operators.py @@ -439,7 +439,7 @@ class Gt2FCOSTarget(BaseOperator): points2gtarea[is_match_current_level == 0] = self.INF points2min_area = points2gtarea.min(axis=1) points2min_area_ind = points2gtarea.argmin(axis=1) - labels = gt_class[points2min_area_ind] + labels = gt_class[points2min_area_ind] + 1 labels[points2min_area == self.INF] = 0 reg_targets = reg_targets[range(xs.shape[0]), points2min_area_ind] ctn_targets = np.sqrt((reg_targets[:, [0, 2]].min(axis=1) / \ diff --git a/ppdet/modeling/anchor_heads/fcos_head.py b/ppdet/modeling/anchor_heads/fcos_head.py index 9b5c4b3c02f343e580af157448213c1ee0db16a0..a08e02976365ae8395c6f898f9f28492cee3e679 100644 --- a/ppdet/modeling/anchor_heads/fcos_head.py +++ b/ppdet/modeling/anchor_heads/fcos_head.py @@ -50,7 +50,7 @@ class FCOSHead(object): __shared__ = ['num_classes'] def __init__(self, - num_classes=81, + num_classes=80, fpn_stride=[8, 16, 32, 64, 128], prior_prob=0.01, num_convs=4, @@ -65,7 +65,7 @@ class FCOSHead(object): keep_top_k=100, nms_threshold=0.45, background_label=-1).__dict__): - self.num_classes = num_classes - 1 + self.num_classes = num_classes self.fpn_stride = fpn_stride[::-1] self.prior_prob = prior_prob self.num_convs = num_convs