Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
101 commits
Select commit Hold shift + click to select a range
108fc9e
set up the codebase skeleton (WIP)
hellock Sep 2, 2018
088919f
Update single base version
OceanPang Sep 12, 2018
0e0b924
Merge pull request #7 from open-mmlab/master
hellock Sep 18, 2018
7f9d2eb
fix extension to fit pytorch 0.4.1 api
hellock Sep 18, 2018
b04a015
add fp16 support for forwarding
hellock Sep 23, 2018
678f933
refactor DataContainer and datasets
hellock Sep 23, 2018
1e35964
adjust the structure of detectors
hellock Sep 23, 2018
879a6ae
bug fix and cleaning
hellock Sep 23, 2018
15e9d02
remove args from batch_processor
hellock Sep 23, 2018
904d875
modify distributed training api and use coalesced all_reduce
hellock Sep 24, 2018
9569fb5
fix typo
hellock Sep 24, 2018
e74c260
fix typo
hellock Sep 24, 2018
b7968de
modify MMDistributedDataParallel, no longer inherited from Distribute…
hellock Sep 24, 2018
d04fa0f
move _sync_param from forward to init
hellock Sep 24, 2018
b71a121
move from models to core
hellock Sep 25, 2018
0401ccc
refactor rpn target computing
hellock Sep 25, 2018
6564293
rm useless files
OceanPang Sep 25, 2018
427c890
add Faster RCNN & Mask RCNN training API and some test related
OceanPang Sep 25, 2018
782ba01
add simple & aug test for FasterRCNN & Mask RCNN
OceanPang Sep 25, 2018
afe5ce0
Merge pull request #1 from OceanPang/dev
hellock Sep 25, 2018
0683b50
mmdet.nn.parallel -> mmdet.core.parallel
hellock Sep 26, 2018
db9aaac
fix eval hooks
hellock Sep 26, 2018
5421859
remove comments
hellock Sep 26, 2018
d0fb2a8
suppress logging for processes whose rank > 0
hellock Sep 26, 2018
df14830
add a choice 'proposal_fast' to eval script
hellock Sep 27, 2018
143a837
bug fix for all_reduce when coalesce is False
hellock Sep 27, 2018
300f715
allow manually setting random seeds
hellock Sep 28, 2018
4c376e5
add git hash to version info
hellock Sep 30, 2018
9c65231
save mmdet version in checkpoint as meta info
hellock Sep 30, 2018
c136b5f
update training settings
hellock Sep 30, 2018
86dd997
Merge branch 'dev' of github.com:hellock/mmdetection into dev
hellock Sep 30, 2018
070c1ea
padded mask during maskrcnn test
OceanPang Oct 1, 2018
c20c2c8
minor modify
OceanPang Oct 1, 2018
2d34ceb
validate api transfer to hook
OceanPang Oct 1, 2018
0b031a8
rm val dataset
OceanPang Oct 1, 2018
323f430
Merge pull request #2 from OceanPang/dev
hellock Oct 1, 2018
65c3ebc
add min_pos_iou config field for train_cfg.rcnn
hellock Oct 3, 2018
830effc
add default result visualization for base detector
hellock Oct 3, 2018
111c27b
modify mask target computation
hellock Oct 4, 2018
8262d46
adapt to mmcv api changes
hellock Oct 4, 2018
7e3ed28
Merge branch 'dev' into mask-debug
hellock Oct 4, 2018
5055cdf
rename resnet style from fb/msra to pytorch/caffe
hellock Oct 5, 2018
f0cb1d1
some renaming
hellock Oct 5, 2018
98b20b9
Merge branch 'dev' into mask-debug
hellock Oct 5, 2018
5266dea
add with_* decorators for detector
hellock Oct 5, 2018
bb6ef3b
Merge branch 'dev' into mask-debug
hellock Oct 5, 2018
cedd8a8
remove useless loss
hellock Oct 5, 2018
a772bea
Merge branch 'dev' into mask-debug
hellock Oct 5, 2018
ec20935
bug fix
hellock Oct 5, 2018
1c8a70d
Merge branch 'dev' into mask-debug
hellock Oct 5, 2018
1ed2d35
vis results for Mask RCNN and update test thr from 0.001 to 0.05
hellock Oct 5, 2018
6b4613d
Merge branch 'dev' into mask-debug
hellock Oct 5, 2018
fdb4430
minor fix
hellock Oct 7, 2018
ea41922
renaming and refactoring for bbox methods
hellock Oct 7, 2018
bac4c32
fix setup.py to include .so files
hellock Oct 7, 2018
c47c448
fix flake8 error
hellock Oct 7, 2018
5686a37
some renaming
hellock Oct 7, 2018
a9f0220
rename bbox_ops/mask_ops to bbox/mask
hellock Oct 8, 2018
4c2e2c0
delete segms.py
hellock Oct 8, 2018
f8dab59
move config dir out of tools
hellock Oct 8, 2018
8b47a12
minor updates for train/test scripts
hellock Oct 8, 2018
3d2b79b
fix path issues
hellock Oct 8, 2018
82356fd
support chunk when reducing grads
hellock Oct 8, 2018
6e238d5
minor fix
hellock Oct 8, 2018
1200348
use nccl as the default comm backend
hellock Oct 8, 2018
63396a3
rename eval to evaluation, losses to loss
hellock Oct 8, 2018
01a03aa
move parallel module to mmcv
hellock Oct 8, 2018
630687f
rename config files
hellock Oct 8, 2018
7d343fd
Merge pull request #8 from hellock/dev
hellock Oct 8, 2018
839c74b
fix fast rcnn bugs
OceanPang Oct 10, 2018
b07edd6
fix test tools bugs
OceanPang Oct 10, 2018
763decc
add fast rcnn api & fix minor bugs
OceanPang Oct 10, 2018
35cec76
minor ifx
OceanPang Oct 10, 2018
d774325
revise fast test & fix aug test bug
OceanPang Oct 10, 2018
e8397e4
Merge pull request #10 from OceanPang/dev
hellock Oct 10, 2018
0e747be
update resnet backbone
hellock Oct 10, 2018
0af6352
import FastRCNN to higher level, update hooks
hellock Oct 10, 2018
ba927c9
setup travis
hellock Oct 10, 2018
1229095
fix flake8 error in python 2
hellock Oct 10, 2018
a6adf8f
minor fix
hellock Oct 10, 2018
14a7dfb
Merge pull request #11 from hellock/dev
hellock Oct 10, 2018
20762ce
bug fix for proposal evaluation
hellock Oct 10, 2018
7c2b814
add an argument to specify process per gpu
hellock Oct 10, 2018
d13997c
Merge pull request #12 from hellock/dev
hellock Oct 10, 2018
a2451b0
update fast rcnn configs
OceanPang Oct 11, 2018
15e538f
minor revision
OceanPang Oct 11, 2018
8e5bfd8
Merge pull request #14 from OceanPang/dev
hellock Oct 11, 2018
4c1da63
add high level api
myownskyW7 Oct 11, 2018
b4eb18d
high level api minor bugs fix
myownskyW7 Oct 11, 2018
2a43cc7
high level api minor bugs fix again
myownskyW7 Oct 11, 2018
0ee5654
minor fix for fast rcnn
hellock Oct 11, 2018
3c51dcc
Merge pull request #17 from hellock/dev
hellock Oct 11, 2018
c76a95e
reorganize the training api
hellock Oct 11, 2018
724abbc
remove useless method
hellock Oct 11, 2018
df2aab9
Merge pull request #16 from myownskyW7/dev
hellock Oct 11, 2018
2507eb6
rename api to apis
hellock Oct 12, 2018
abc440f
Merge pull request #18 from hellock/dev
hellock Oct 12, 2018
d6a724f
update inference api
hellock Oct 12, 2018
0444489
Merge branch 'dev' of github.com:open-mmlab/mmdetection into dev
hellock Oct 12, 2018
459d5eb
minor fix
hellock Oct 12, 2018
54b54d8
Merge pull request #19 from hellock/dev
hellock Oct 12, 2018
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -102,3 +102,8 @@ venv.bak/

# mypy
.mypy_cache/

# cython generated cpp
mmdet/ops/nms/*.cpp
mmdet/version.py
data
13 changes: 13 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
dist: trusty
language: python

install:
- pip install flake8

python:
- "2.7"
- "3.5"
- "3.6"

script:
- flake8
22 changes: 22 additions & 0 deletions compile.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#!/usr/bin/env bash

PYTHON=${PYTHON:-"python"}

echo "Building roi align op..."
cd mmdet/ops/roi_align
if [ -d "build" ]; then
rm -r build
fi
$PYTHON setup.py build_ext --inplace

echo "Building roi pool op..."
cd ../roi_pool
if [ -d "build" ]; then
rm -r build
fi
$PYTHON setup.py build_ext --inplace

echo "Building nms op..."
cd ../nms
make clean
make PYTHON=${PYTHON}
132 changes: 132 additions & 0 deletions configs/fast_mask_rcnn_r50_fpn_1x.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,132 @@
# model settings
model = dict(
type='FastRCNN',
pretrained='modelzoo://resnet50',
backbone=dict(
type='ResNet',
depth=50,
num_stages=4,
out_indices=(0, 1, 2, 3),
frozen_stages=1,
style='pytorch'),
neck=dict(
type='FPN',
in_channels=[256, 512, 1024, 2048],
out_channels=256,
num_outs=5),
bbox_roi_extractor=dict(
type='SingleRoIExtractor',
roi_layer=dict(type='RoIAlign', out_size=7, sample_num=2),
out_channels=256,
featmap_strides=[4, 8, 16, 32]),
bbox_head=dict(
type='SharedFCRoIHead',
num_fcs=2,
in_channels=256,
fc_out_channels=1024,
roi_feat_size=7,
num_classes=81,
target_means=[0., 0., 0., 0.],
target_stds=[0.1, 0.1, 0.2, 0.2],
reg_class_agnostic=False),
mask_roi_extractor=dict(
type='SingleRoIExtractor',
roi_layer=dict(type='RoIAlign', out_size=14, sample_num=2),
out_channels=256,
featmap_strides=[4, 8, 16, 32]),
mask_head=dict(
type='FCNMaskHead',
num_convs=4,
in_channels=256,
conv_out_channels=256,
num_classes=81))
# model training and testing settings
train_cfg = dict(
rcnn=dict(
mask_size=28,
pos_iou_thr=0.5,
neg_iou_thr=0.5,
crowd_thr=1.1,
roi_batch_size=512,
add_gt_as_proposals=True,
pos_fraction=0.25,
pos_balance_sampling=False,
neg_pos_ub=512,
neg_balance_thr=0,
min_pos_iou=0.5,
pos_weight=-1,
debug=False))
test_cfg = dict(
rcnn=dict(
score_thr=0.05, max_per_img=100, nms_thr=0.5, mask_thr_binary=0.5))
# dataset settings
dataset_type = 'CocoDataset'
data_root = 'data/coco/'
img_norm_cfg = dict(
mean=[123.675, 116.28, 103.53], std=[58.395, 57.12, 57.375], to_rgb=True)
data = dict(
imgs_per_gpu=2,
workers_per_gpu=2,
train=dict(
type=dataset_type,
ann_file=data_root + 'annotations/instances_train2017.json',
img_prefix=data_root + 'train2017/',
img_scale=(1333, 800),
img_norm_cfg=img_norm_cfg,
size_divisor=32,
proposal_file=data_root + 'proposals/rpn_r50_fpn_1x_train2017.pkl',
flip_ratio=0.5,
with_mask=True,
with_crowd=True,
with_label=True),
val=dict(
type=dataset_type,
ann_file=data_root + 'annotations/instances_val2017.json',
img_prefix=data_root + 'val2017/',
img_scale=(1333, 800),
img_norm_cfg=img_norm_cfg,
proposal_file=data_root + 'proposals/rpn_r50_fpn_1x_val2017.pkl',
size_divisor=32,
flip_ratio=0,
with_mask=True,
with_crowd=True,
with_label=True),
test=dict(
type=dataset_type,
ann_file=data_root + 'annotations/instances_val2017.json',
img_prefix=data_root + 'val2017/',
img_scale=(1333, 800),
img_norm_cfg=img_norm_cfg,
proposal_file=data_root + 'proposals/rpn_r50_fpn_1x_val2017.pkl',
size_divisor=32,
flip_ratio=0,
with_mask=False,
with_label=False,
test_mode=True))
# optimizer
optimizer = dict(type='SGD', lr=0.02, momentum=0.9, weight_decay=0.0001)
optimizer_config = dict(grad_clip=dict(max_norm=35, norm_type=2))
# learning policy
lr_config = dict(
policy='step',
warmup='linear',
warmup_iters=500,
warmup_ratio=1.0 / 3,
step=[8, 11])
checkpoint_config = dict(interval=1)
# yapf:disable
log_config = dict(
interval=50,
hooks=[
dict(type='TextLoggerHook'),
# dict(type='TensorboardLoggerHook')
])
# yapf:enable
# runtime settings
total_epochs = 12
dist_params = dict(backend='nccl')
log_level = 'INFO'
work_dir = './work_dirs/fast_mask_rcnn_r50_fpn_1x'
load_from = None
resume_from = None
workflow = [('train', 1)]
118 changes: 118 additions & 0 deletions configs/fast_rcnn_r50_fpn_1x.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@
# model settings
model = dict(
type='FastRCNN',
pretrained='modelzoo://resnet50',
backbone=dict(
type='ResNet',
depth=50,
num_stages=4,
out_indices=(0, 1, 2, 3),
frozen_stages=1,
style='pytorch'),
neck=dict(
type='FPN',
in_channels=[256, 512, 1024, 2048],
out_channels=256,
num_outs=5),
bbox_roi_extractor=dict(
type='SingleRoIExtractor',
roi_layer=dict(type='RoIAlign', out_size=7, sample_num=2),
out_channels=256,
featmap_strides=[4, 8, 16, 32]),
bbox_head=dict(
type='SharedFCRoIHead',
num_fcs=2,
in_channels=256,
fc_out_channels=1024,
roi_feat_size=7,
num_classes=81,
target_means=[0., 0., 0., 0.],
target_stds=[0.1, 0.1, 0.2, 0.2],
reg_class_agnostic=False))
# model training and testing settings
train_cfg = dict(
rcnn=dict(
pos_iou_thr=0.5,
neg_iou_thr=0.5,
crowd_thr=1.1,
roi_batch_size=512,
add_gt_as_proposals=True,
pos_fraction=0.25,
pos_balance_sampling=False,
neg_pos_ub=512,
neg_balance_thr=0,
min_pos_iou=0.5,
pos_weight=-1,
debug=False))
test_cfg = dict(rcnn=dict(score_thr=0.05, max_per_img=100, nms_thr=0.5))
# dataset settings
dataset_type = 'CocoDataset'
data_root = 'data/coco/'
img_norm_cfg = dict(
mean=[123.675, 116.28, 103.53], std=[58.395, 57.12, 57.375], to_rgb=True)
data = dict(
imgs_per_gpu=2,
workers_per_gpu=2,
train=dict(
type=dataset_type,
ann_file=data_root + 'annotations/instances_train2017.json',
img_prefix=data_root + 'train2017/',
img_scale=(1333, 800),
img_norm_cfg=img_norm_cfg,
size_divisor=32,
proposal_file=data_root + 'proposals/rpn_r50_fpn_1x_train2017.pkl',
flip_ratio=0.5,
with_mask=False,
with_crowd=True,
with_label=True),
val=dict(
type=dataset_type,
ann_file=data_root + 'annotations/instances_val2017.json',
img_prefix=data_root + 'val2017/',
img_scale=(1333, 800),
img_norm_cfg=img_norm_cfg,
proposal_file=data_root + 'proposals/rpn_r50_fpn_1x_val2017.pkl',
size_divisor=32,
flip_ratio=0,
with_mask=False,
with_crowd=True,
with_label=True),
test=dict(
type=dataset_type,
ann_file=data_root + 'annotations/instances_val2017.json',
img_prefix=data_root + 'val2017/',
img_scale=(1333, 800),
img_norm_cfg=img_norm_cfg,
proposal_file=data_root + 'proposals/rpn_r50_fpn_1x_val2017.pkl',
size_divisor=32,
flip_ratio=0,
with_mask=False,
with_label=False,
test_mode=True))
# optimizer
optimizer = dict(type='SGD', lr=0.02, momentum=0.9, weight_decay=0.0001)
optimizer_config = dict(grad_clip=dict(max_norm=35, norm_type=2))
# learning policy
lr_config = dict(
policy='step',
warmup='linear',
warmup_iters=500,
warmup_ratio=1.0 / 3,
step=[8, 11])
checkpoint_config = dict(interval=1)
# yapf:disable
log_config = dict(
interval=50,
hooks=[
dict(type='TextLoggerHook'),
# dict(type='TensorboardLoggerHook')
])
# yapf:enable
# runtime settings
total_epochs = 12
dist_params = dict(backend='nccl')
log_level = 'INFO'
work_dir = './work_dirs/fast_rcnn_r50_fpn_1x'
load_from = None
resume_from = None
workflow = [('train', 1)]
Loading