Skip to content
This repository was archived by the owner on Jul 2, 2021. It is now read-only.

add MaskRCNN #781

Merged
merged 90 commits into from
Apr 23, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
90 commits
Select commit Hold shift + click to select a range
b3e8ac0
[wip] add mask_rcnn
yuyu2172 Feb 12, 2019
31ed235
Merge remote-tracking branch 'yuyu2172/coco-instances-dataset' into m…
yuyu2172 Feb 12, 2019
bcd68fa
misc
yuyu2172 Feb 12, 2019
64cc16c
Merge remote-tracking branch 'origin/master' into mask-rcnn
yuyu2172 Feb 12, 2019
f1d4e46
doc
yuyu2172 Feb 13, 2019
1e10d32
remove unnecessary print
yuyu2172 Feb 13, 2019
e468545
misc
yuyu2172 Feb 13, 2019
75fb3ff
misc
yuyu2172 Feb 13, 2019
43e8acc
handle the case when #RoI is 0
yuyu2172 Feb 15, 2019
a4319e0
delete mask option for MaskRCNN.prepare
yuyu2172 Feb 18, 2019
496dd93
use MultiprocessIterator
yuyu2172 Feb 18, 2019
a8fcf2a
train now works
yuyu2172 Feb 18, 2019
0d9ba65
some speed up
yuyu2172 Feb 19, 2019
97497ea
reduce copy
yuyu2172 Feb 19, 2019
1e38522
delete unnecessary
yuyu2172 Feb 19, 2019
c63c306
reuse prepare function
yuyu2172 Feb 19, 2019
bcf9de7
merge
yuyu2172 Feb 19, 2019
bb8fd68
don't use instance method
yuyu2172 Feb 19, 2019
d98997c
merge master
yuyu2172 Feb 19, 2019
45e77be
delete eval_coco
yuyu2172 Feb 19, 2019
c8b08a4
speed up _segm_wrt_bbox
yuyu2172 Feb 19, 2019
9ef9564
delete unnecessary
yuyu2172 Feb 19, 2019
9cc885a
use Conv2DActiv
yuyu2172 Feb 20, 2019
91b2b52
fix demo
yuyu2172 Feb 21, 2019
8dd3706
fix demo
yuyu2172 Feb 21, 2019
9f4c927
delete zerograd
yuyu2172 Feb 21, 2019
7e610d4
complete graph when n_roi == 0
yuyu2172 Feb 25, 2019
b5cb93a
flake8
yuyu2172 Feb 25, 2019
7e707d8
fix
yuyu2172 Feb 25, 2019
2d44d66
change mask_to_segm and divide mask loss by #RoI
yuyu2172 Mar 5, 2019
be4e8ad
use segm_size instead of mask_size
yuyu2172 Mar 5, 2019
2822789
fix mask_head
yuyu2172 Mar 6, 2019
6513e24
delete +1
yuyu2172 Mar 6, 2019
7e1e3ec
fix mask_to_segm and segm_to_mask
yuyu2172 Mar 6, 2019
c78925c
add test
yuyu2172 Mar 6, 2019
b181dfd
add mask_to_segm and segm_to_mask to doc
yuyu2172 Mar 6, 2019
f5adabc
fix test
yuyu2172 Mar 7, 2019
7f5a0b9
Merge remote-tracking branch 'yuyu2172/mask-rcnn-no-plus' into HEAD
yuyu2172 Mar 8, 2019
82e43b0
Merge remote-tracking branch 'origin/master' into mask-rcnn
yuyu2172 Mar 8, 2019
3d317ba
fix
yuyu2172 Mar 10, 2019
07daa2f
Merge remote-tracking branch 'origin/master' into HEAD
yuyu2172 Mar 15, 2019
80b8b6a
Head -> BboxHead
yuyu2172 Mar 15, 2019
fa96b48
merge Mask R-CNN to chainercv.links.model.fpn
yuyu2172 Mar 15, 2019
ffc87dd
fix variable names
yuyu2172 Mar 15, 2019
42ca5d2
update train_multi
yuyu2172 Mar 15, 2019
eeac6db
Mask R-CNN class
yuyu2172 Mar 15, 2019
20414c4
fix
yuyu2172 Mar 15, 2019
1c31a00
fix
yuyu2172 Mar 15, 2019
80401b1
fix tests
yuyu2172 Mar 15, 2019
3abe75d
fix train script
yuyu2172 Mar 15, 2019
3ce01cb
add test
yuyu2172 Mar 15, 2019
c8a1526
doc
yuyu2172 Mar 15, 2019
3bd6f32
flake8
yuyu2172 Mar 15, 2019
fd54af2
fix doc
yuyu2172 Mar 15, 2019
d905560
fix test_head
yuyu2172 Mar 15, 2019
e2a6f5e
add aws link
yuyu2172 Mar 20, 2019
3f62784
flake8
yuyu2172 Mar 20, 2019
ca47baf
update README
yuyu2172 Mar 20, 2019
1ad1070
fix tests
yuyu2172 Mar 26, 2019
b7eb0f2
merge
yuyu2172 Mar 26, 2019
49ffabe
stop using __call__
yuyu2172 Mar 26, 2019
2e3fa01
add example tests
yuyu2172 Mar 26, 2019
10988d0
update READMEs
yuyu2172 Mar 26, 2019
a057598
fix tests
yuyu2172 Mar 26, 2019
900cdf4
add instance_segmentation_tests of example_tests
yuyu2172 Mar 26, 2019
c5baa05
know correct resize backend
yuyu2172 Mar 27, 2019
423c243
change variable name
yuyu2172 Mar 27, 2019
111c8f8
*_loss -> *_head_loss
yuyu2172 Apr 3, 2019
5b01be4
merge
yuyu2172 Apr 3, 2019
1e949cc
delete mask_rcnn_tests
yuyu2172 Apr 3, 2019
3f265b8
fix missing future division
yuyu2172 Apr 3, 2019
9be25c7
make time limit longer
yuyu2172 Apr 4, 2019
cd2e4c3
fix name
yuyu2172 Apr 4, 2019
171d745
Merge branch 'fix-ssd-multinode' into pull/781
Hakuyume Apr 5, 2019
8f70d4f
update README
yuyu2172 Apr 10, 2019
a2d5e6d
change link
yuyu2172 Apr 10, 2019
ad31415
Merge remote-tracking branch 'origin/master' into mask-rcnn
yuyu2172 Apr 11, 2019
0820f5d
make timeout longer
yuyu2172 Apr 11, 2019
c02350d
reflect comments
yuyu2172 Apr 18, 2019
dd7f9fa
force cv2 in mask_utils
yuyu2172 Apr 19, 2019
9c6f944
change config.pbtxt
yuyu2172 Apr 19, 2019
f37010e
do not set min_size and max_size as public
yuyu2172 Apr 19, 2019
8226baf
merge
yuyu2172 Apr 19, 2019
ba5dee1
remove data-dir argument
yuyu2172 Apr 19, 2019
27c5236
fix test
yuyu2172 Apr 19, 2019
3a04c63
Merge remote-tracking branch 'origin/master' into mask-rcnn
yuyu2172 Apr 19, 2019
6acc48f
timeout to 3600
yuyu2172 Apr 19, 2019
4fbcb06
fix flake
yuyu2172 Apr 19, 2019
58ef6c7
fix bug
yuyu2172 Apr 20, 2019
6c4dc80
Merge remote-tracking branch 'origin/master' into HEAD
yuyu2172 Apr 23, 2019
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
24 changes: 12 additions & 12 deletions .pfnci/config.pbtxt
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ configs {
disk: 10
}
time_limit {
seconds: 1800
seconds: 3600
}
command: "sh .pfnci/tests.sh"
environment_variables {
Expand Down Expand Up @@ -73,7 +73,7 @@ configs {
disk: 10
}
time_limit {
seconds: 1800
seconds: 3600
}
command: "sh .pfnci/tests.sh"
environment_variables {
Expand Down Expand Up @@ -150,7 +150,7 @@ configs {
disk: 10
}
time_limit {
seconds: 1800
seconds: 3600
}
command: "sh .pfnci/tests.sh"
environment_variables {
Expand Down Expand Up @@ -200,7 +200,7 @@ configs {
disk: 10
}
time_limit {
seconds: 1800
seconds: 3600
}
command: "sh .pfnci/tests.sh"
environment_variables {
Expand Down Expand Up @@ -277,7 +277,7 @@ configs {
disk: 10
}
time_limit {
seconds: 1800
seconds: 3600
}
command: "sh .pfnci/tests.sh"
environment_variables {
Expand Down Expand Up @@ -327,7 +327,7 @@ configs {
disk: 10
}
time_limit {
seconds: 1800
seconds: 3600
}
command: "sh .pfnci/tests.sh"
environment_variables {
Expand Down Expand Up @@ -404,7 +404,7 @@ configs {
disk: 10
}
time_limit {
seconds: 1800
seconds: 3600
}
command: "sh .pfnci/tests.sh"
environment_variables {
Expand Down Expand Up @@ -454,7 +454,7 @@ configs {
disk: 10
}
time_limit {
seconds: 1800
seconds: 3600
}
command: "sh .pfnci/tests.sh"
environment_variables {
Expand Down Expand Up @@ -531,7 +531,7 @@ configs {
disk: 10
}
time_limit {
seconds: 1800
seconds: 3600
}
command: "sh .pfnci/tests.sh"
environment_variables {
Expand Down Expand Up @@ -581,7 +581,7 @@ configs {
disk: 10
}
time_limit {
seconds: 1800
seconds: 3600
}
command: "sh .pfnci/tests.sh"
environment_variables {
Expand Down Expand Up @@ -658,7 +658,7 @@ configs {
disk: 10
}
time_limit {
seconds: 1800
seconds: 3600
}
command: "sh .pfnci/tests.sh"
environment_variables {
Expand Down Expand Up @@ -708,7 +708,7 @@ configs {
disk: 10
}
time_limit {
seconds: 1800
seconds: 3600
}
command: "sh .pfnci/tests.sh"
environment_variables {
Expand Down
2 changes: 1 addition & 1 deletion .pfnci/gen_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ def test_config(python, chainer, optional, target):
if target == 'cpu':
value['requirement']['cpu'] = 6
value['requirement']['memory'] = 36
value['time_limit'] = {'seconds': 1800}
value['time_limit'] = {'seconds': 3600}
value['command'] = 'sh .pfnci/tests.sh'
elif target == 'gpu':
key += '.gpu'
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Supported tasks:
+ Image Classification ([ResNet](examples/resnet), [SENet](examples/senet), [VGG](examples/vgg))
+ Object Detection ([tutorial](http://chainercv.readthedocs.io/en/latest/tutorial/detection.html), [Faster R-CNN](examples/faster_rcnn), [FPN](examples/fpn), [SSD](examples/ssd), [YOLO](examples/yolo))
+ Semantic Segmentation ([SegNet](examples/segnet), [PSPNet](examples/pspnet))
+ Instance Segmentation ([FCIS](examples/fcis),)
+ Instance Segmentation ([FCIS](examples/fcis), [Mask R-CNN](examples/fpn))

# Guiding Principles
ChainerCV is developed under the following three guiding principles.
Expand Down
2 changes: 1 addition & 1 deletion chainercv/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,5 @@


global_config.cv_read_image_backend = 'cv2'
global_config.cv_resize_backend = 'cv2'
global_config.cv_resize_backend = None
global_config.cv_rotate_backend = 'cv2'
2 changes: 2 additions & 0 deletions chainercv/links/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
from chainercv.links.model.faster_rcnn.faster_rcnn_vgg import FasterRCNNVGG16 # NOQA
from chainercv.links.model.fpn.faster_rcnn_fpn_resnet import FasterRCNNFPNResNet101 # NOQA
from chainercv.links.model.fpn.faster_rcnn_fpn_resnet import FasterRCNNFPNResNet50 # NOQA
from chainercv.links.model.fpn.faster_rcnn_fpn_resnet import MaskRCNNFPNResNet101 # NOQA
from chainercv.links.model.fpn.faster_rcnn_fpn_resnet import MaskRCNNFPNResNet50 # NOQA
from chainercv.links.model.resnet import ResNet101 # NOQA
from chainercv.links.model.resnet import ResNet152 # NOQA
from chainercv.links.model.resnet import ResNet50 # NOQA
Expand Down
14 changes: 11 additions & 3 deletions chainercv/links/model/fpn/__init__.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,17 @@
from chainercv.links.model.fpn.bbox_head import bbox_head_loss_post # NOQA
from chainercv.links.model.fpn.bbox_head import bbox_head_loss_pre # NOQA
from chainercv.links.model.fpn.bbox_head import BboxHead # NOQA
from chainercv.links.model.fpn.faster_rcnn import FasterRCNN # NOQA
from chainercv.links.model.fpn.faster_rcnn_fpn_resnet import FasterRCNNFPNResNet # NOQA
from chainercv.links.model.fpn.faster_rcnn_fpn_resnet import FasterRCNNFPNResNet101 # NOQA
from chainercv.links.model.fpn.faster_rcnn_fpn_resnet import FasterRCNNFPNResNet50 # NOQA
from chainercv.links.model.fpn.faster_rcnn_fpn_resnet import MaskRCNNFPNResNet101 # NOQA
from chainercv.links.model.fpn.faster_rcnn_fpn_resnet import MaskRCNNFPNResNet50 # NOQA
from chainercv.links.model.fpn.fpn import FPN # NOQA
from chainercv.links.model.fpn.head import Head # NOQA
from chainercv.links.model.fpn.head import head_loss_post # NOQA
from chainercv.links.model.fpn.head import head_loss_pre # NOQA
from chainercv.links.model.fpn.mask_head import mask_head_loss_post # NOQA
from chainercv.links.model.fpn.mask_head import mask_head_loss_pre # NOQA
from chainercv.links.model.fpn.mask_head import MaskHead # NOQA
from chainercv.links.model.fpn.mask_utils import mask_to_segm # NOQA
from chainercv.links.model.fpn.mask_utils import segm_to_mask # NOQA
from chainercv.links.model.fpn.rpn import RPN # NOQA
from chainercv.links.model.fpn.rpn import rpn_loss # NOQA
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
from chainercv import utils


class Head(chainer.Chain):
"""Head network of Feature Pyramid Networks.
class BboxHead(chainer.Chain):
"""Bounding box head network of Feature Pyramid Networks.

Args:
n_class (int): The number of classes including background.
Expand All @@ -30,7 +30,7 @@ class Head(chainer.Chain):
std = (0.1, 0.2)

def __init__(self, n_class, scales):
super(Head, self).__init__()
super(BboxHead, self).__init__()

fc_init = {
'initialW': Caffe2FCUniform(),
Expand Down Expand Up @@ -212,10 +212,10 @@ def decode(self, rois, roi_indices, locs, confs,
return bboxes, labels, scores


def head_loss_pre(rois, roi_indices, std, bboxes, labels):
def bbox_head_loss_pre(rois, roi_indices, std, bboxes, labels):
"""Loss function for Head (pre).

This function processes RoIs for :func:`head_loss_post`.
This function processes RoIs for :func:`bbox_head_loss_post`.

Args:
rois (iterable of arrays): An iterable of arrays of
Expand Down Expand Up @@ -316,7 +316,8 @@ def head_loss_pre(rois, roi_indices, std, bboxes, labels):
return rois, roi_indices, gt_locs, gt_labels


def head_loss_post(locs, confs, roi_indices, gt_locs, gt_labels, batchsize):
def bbox_head_loss_post(
locs, confs, roi_indices, gt_locs, gt_labels, batchsize):
"""Loss function for Head (post).

Args:
Expand All @@ -325,11 +326,11 @@ def head_loss_post(locs, confs, roi_indices, gt_locs, gt_labels, batchsize):
confs (array): An iterable of arrays whose shape is
:math:`(R, n\_class)`.
roi_indices (list of arrays): A list of arrays returned by
:func:`head_locs_pre`.
:func:`bbox_head_locs_pre`.
gt_locs (list of arrays): A list of arrays returned by
:func:`head_locs_pre`.
:func:`bbox_head_locs_pre`.
gt_labels (list of arrays): A list of arrays returned by
:func:`head_locs_pre`.
:func:`bbox_head_locs_pre`.
batchsize (int): The size of batch.

Returns:
Expand Down
Loading