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

[WIP] Support Mask R-CNN w/ keypoints #810

Open
wants to merge 123 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
123 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
e19c8d0
COCOPointDataset
yuyu2172 Feb 14, 2019
1d97870
add vis_coco_point
yuyu2172 Feb 15, 2019
43e8acc
handle the case when #RoI is 0
yuyu2172 Feb 15, 2019
a65ec8f
Merge remote-tracking branch 'yuyu2172/point-data' into vis-coco-point
yuyu2172 Feb 16, 2019
cb2ad16
fix some bug
yuyu2172 Feb 16, 2019
a4319e0
delete mask option for MaskRCNN.prepare
yuyu2172 Feb 18, 2019
496dd93
use MultiprocessIterator
yuyu2172 Feb 18, 2019
183229c
change url link
yuyu2172 Feb 18, 2019
8417559
add eval_point_coco
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
2e18bf6
COCOPointDataset -> COCOKeypointDataset
yuyu2172 Feb 19, 2019
847d2cb
Merge remote-tracking branch 'yuyu2172/vis-coco-point' into HEAD
yuyu2172 Feb 19, 2019
8ad8a74
vis_coco_point -> vis_keypoint_coco
yuyu2172 Feb 19, 2019
a48b2ba
change representation of coco_keypoint_names
yuyu2172 Feb 19, 2019
deb9f9c
add doc
yuyu2172 Feb 20, 2019
98301e3
add test for vis_keypoint_coco
yuyu2172 Feb 20, 2019
262f7ea
Merge remote-tracking branch 'yuyu2172/point-data' into eval-point-coco
yuyu2172 Feb 20, 2019
b63254e
change name and add test
yuyu2172 Feb 20, 2019
b1f6454
update doc
yuyu2172 Feb 20, 2019
9cc885a
use Conv2DActiv
yuyu2172 Feb 20, 2019
5ffd8b3
change interface of point/transforms
yuyu2172 Feb 21, 2019
e44e91f
Merge remote-tracking branch 'yuyu2172/change-cub' into HEAD
yuyu2172 Feb 21, 2019
45bd712
fix variable name
yuyu2172 Feb 21, 2019
2608094
change variable names
yuyu2172 Feb 21, 2019
716043e
flake8 and test
yuyu2172 Feb 21, 2019
f1b5aca
Merge branch 'point-data' into HEAD
yuyu2172 Feb 21, 2019
3320b39
fix class name
yuyu2172 Feb 21, 2019
97c3e7f
Merge remote-tracking branch 'yuyu2172/mask-rcnn' into keypoint-rcnn
yuyu2172 Feb 21, 2019
a467173
fix class name
yuyu2172 Feb 21, 2019
91b2b52
fix demo
yuyu2172 Feb 21, 2019
71576f5
Merge remote-tracking branch 'yuyu2172/mask-rcnn' into keypoint-rcnn
yuyu2172 Feb 21, 2019
8dd3706
fix demo
yuyu2172 Feb 21, 2019
7191dc0
demo works
yuyu2172 Feb 21, 2019
62cb5e8
eval
yuyu2172 Feb 21, 2019
18af5fb
flake8
yuyu2172 Feb 21, 2019
a9405fb
Merge remote-tracking branch 'yuyu2172/change-cub' into point-data
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
9a26065
use bilinear interpolation with kernel size 4
yuyu2172 Mar 4, 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
f78c42d
merge
yuyu2172 Mar 6, 2019
acf73a6
add keypoint_loss
yuyu2172 Mar 6, 2019
6cf5637
wip
yuyu2172 Mar 6, 2019
c045eae
fix broken flake8
yuyu2172 Mar 7, 2019
ac18d36
fix mistake
yuyu2172 Mar 7, 2019
33a189f
Merge remote-tracking branch 'yuyu2172/point-transform' into keypoint…
yuyu2172 Mar 7, 2019
781792b
fix the order of data
yuyu2172 Mar 7, 2019
163f919
Merge branch 'point-data' into keypoint-rcnn
yuyu2172 Mar 7, 2019
c6639f7
fix assertion
yuyu2172 Mar 7, 2019
665f34b
fix
yuyu2172 Mar 7, 2019
df8c274
fix test
yuyu2172 Mar 7, 2019
f5adabc
fix test
yuyu2172 Mar 7, 2019
24492f7
filter invalid
yuyu2172 Mar 7, 2019
f922836
add balanced sampling for KeypointHead
yuyu2172 Mar 8, 2019
7ec9a18
remove invalid box
yuyu2172 Mar 8, 2019
1d6f599
multiscale training
yuyu2172 Mar 8, 2019
b8fa344
add eval_keypoint_detection_multi
yuyu2172 Mar 8, 2019
a94cca4
fix
yuyu2172 Mar 8, 2019
2b0b8a4
fix
yuyu2172 Mar 8, 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
a2796c1
Merge branch 'mask-rcnn' into keypoint-rcnn
yuyu2172 Mar 8, 2019
e964fae
do not use bg sample
yuyu2172 Mar 8, 2019
afb6e2a
add shared_mem option
yuyu2172 Mar 8, 2019
3d317ba
fix
yuyu2172 Mar 10, 2019
902d090
fix
yuyu2172 Mar 10, 2019
d65f257
Merge remote-tracking branch 'yuyu2172/point-data' into HEAD
yuyu2172 Mar 10, 2019
8145849
fix order of bbox and label
yuyu2172 Mar 10, 2019
8da807e
merge
yuyu2172 Mar 10, 2019
e5c80fe
fix order
yuyu2172 Mar 10, 2019
d50227c
change order
yuyu2172 Mar 10, 2019
6c9d3bc
do not update bilinear interpolation layer
yuyu2172 Mar 10, 2019
553f901
fix reporter
yuyu2172 Mar 10, 2019
ae06789
fix ignore logic
yuyu2172 Mar 10, 2019
b0c733e
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
0840f0c
merge
yuyu2172 Mar 15, 2019
462726f
merge to fpn
yuyu2172 Mar 15, 2019
8694df5
fix
yuyu2172 Mar 15, 2019
b3d3b4e
fix
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
a0528e9
merge
yuyu2172 Mar 15, 2019
e71c322
fix
yuyu2172 Mar 15, 2019
8c9816c
merge train
yuyu2172 Mar 15, 2019
ee08fbb
fix
yuyu2172 Mar 15, 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
Prev Previous commit
fix
  • Loading branch information
yuyu2172 committed Mar 15, 2019
commit ee08fbb6fed67c92157163775c16f0a8f3ad4d32
13 changes: 8 additions & 5 deletions examples/fpn/train_multi.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import argparse
import multiprocessing
import numpy as np
import random
import PIL

import chainer
@@ -51,10 +52,11 @@

class TrainChain(chainer.Chain):

def __init__(self, model):
def __init__(self, model, mode):
super(TrainChain, self).__init__()
with self.init_scope():
self.model = model
self.mode = mode

def __call__(self, imgs, bboxes, labels, masks=None,
points=None, visibles=None):
@@ -99,7 +101,7 @@ def __call__(self, imgs, bboxes, labels, masks=None,
roi_indices, head_gt_locs, head_gt_labels, B)

mask_loss = 0
if masks is not None:
if self.mode == 'instance_segmentation':
# For reducing unnecessary CPU/GPU copy, `masks` is kept in CPU.
pad_masks = [
np.zeros(
@@ -127,7 +129,7 @@ def __call__(self, imgs, bboxes, labels, masks=None,
mask_loss = 0 * F.sum(segms)

point_loss = 0
if points is not None:
if self.mode == 'keypoint':
points = [self.xp.array(point) for point in points]
visibles = [self.xp.array(visible) for visible in visibles]

@@ -190,8 +192,9 @@ def __call__(self, in_data):
bbox, img.shape[1:], x_flip=x_flip)

# Scaling and mean subtraction
min_size = random.choice(self.min_size)
img, scale = scale_img(
img, self.min_size, self.max_size)
img, min_size, self.max_size)
img -= self.mean
bbox = bbox * scale

@@ -284,7 +287,7 @@ def main():
n_point=len(coco_keypoint_names[0]))

model.use_preset('evaluate')
train_chain = TrainChain(model)
train_chain = TrainChain(model, mode)
chainer.cuda.get_device_from_id(device).use()
train_chain.to_gpu()