-
Notifications
You must be signed in to change notification settings - Fork 0
/
mask_rcnn_r50_caffe_fpn_mstrain-poly_3x_nucleus.py
76 lines (71 loc) · 2.6 KB
/
mask_rcnn_r50_caffe_fpn_mstrain-poly_3x_nucleus.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
# The new config inherits a base config to highlight the necessary modification
_base_ = '../mask_rcnn/mask_rcnn_r50_caffe_fpn_mstrain-poly_1x_coco.py'
# We also need to change the num_classes in head to match the dataset's annotation
model = dict(
roi_head=dict(
bbox_head=dict(num_classes=1),
mask_head=dict(num_classes=1)),
backbone=dict(
with_cp=True
),
# train_cfg=dict(
# rpn=dict(
# assigner=dict(
# type='MaxIoUAssigner',
# gpu_assign_thr=1000)),
# rcnn=dict(
# assigner=dict(
# type='MaxIoUAssigner',
# gpu_assign_thr=1000))
# )
)
# Modify dataset related settings
dataset_type = 'CocoDataset'
classes = ('nucleus',)
runner = dict(type='EpochBasedRunner', max_epochs=200)
test_pipelines = [
dict(type='LoadImageFromFile'),
dict(
type='MultiScaleFlipAug',
img_scale=(1333, 800),
flip=False,
transforms=[
dict(type='Resize', keep_ratio=True),
dict(type='RandomFlip'),
dict(type='Normalize', mean=[0, 0, 0], std=[1, 1, 1]),
dict(type='Pad', size_divisor=32),
dict(type='DefaultFormatBundle'),
dict(type='Collect', keys=['img']),
])
]
data = dict(
samples_per_gpu=1,
workers_per_gpu=1,
train=dict(
img_prefix='/work/zchin31415/nucleus_data/all_train/',
classes=classes,
ann_file='/work/zchin31415/nucleus_data/annotations/instance_all_train.json'),
val=dict(
img_prefix='/work/zchin31415/nucleus_data/all_train',
classes=classes,
ann_file='/work/zchin31415/nucleus_data/annotations/instance_all_train.json'),
test=dict(
img_prefix='/work/zchin31415/nucleus_data/test',
classes=classes,
ann_file='/work/zchin31415/nucleus_data/annotations/instance_test.json'),
pipelines=[
dict(type='LoadImageFromFile'),
dict(
type='MultiScaleFlipAug',
img_scale=(1333, 800),
flip=False,
transforms=[
dict(type='Resize', keep_ratio=True),
dict(type='RandomFlip'),
dict(type='Normalize', mean=[0, 0, 0], std=[1, 1, 1]),
dict(type='Pad', size_divisor=32),
dict(type='DefaultFormatBundle'),
dict(type='Collect', keys=['img']),
])
])
load_from = '/home/zchin31415/mmdet-nucleus-instance-segmentation/mmdetection/checkpoints/mask_rcnn_r50_caffe_fpn_mstrain-poly_3x_coco_bbox_mAP-0.408__segm_mAP-0.37_20200504_163245-42aa3d00.pth'