未验证 提交 a3bf27da 编写于 作者: C CodesFarmer 提交者: GitHub

keep the option 'num_classes' and 'with_background' consistent (#727)

上级 1b16f475
......@@ -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:
......
......@@ -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
......
......@@ -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
......
......@@ -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) / \
......
......@@ -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
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册