ecfc31e21d0c30b1f543aacb8619582b60a1bef7,gluoncv/model_zoo/mask_rcnn/rcnn_target.py,MaskTargetGenerator,hybrid_forward,#MaskTargetGenerator#Any#Any#Any#Any#Any#,30
Before Change
pooled_mask = pooled_mask.reshape((-3, 0, 0))
// duplicate to C * (N, MS, MS)
mask_target = []
mask_mask = []
for cid in range(1, self._num_classes + 1):
// boolean array (N,) -> (N, 1, 1)
same_cid = (cls_target == cid).reshape((-1, 1, 1))
// keep orig targets
mask_target.append(pooled_mask)
// but mask out the one not belong to this class [N, MS, MS]
mask_mask.append(F.broadcast_mul(F.ones_like(pooled_mask), same_cid))
// (C, N, MS, MS) -> (N, C, MS, MS)
mask_targets.append(F.stack(*mask_target, axis=0).transpose((1, 0, 2, 3)))
mask_masks.append(F.stack(*mask_mask, axis=0).transpose((1, 0, 2, 3)))
// B * (N, C, MS, MS) -> (B, N, C, MS, MS)
mask_targets = F.stack(*mask_targets, axis=0)
After Change
pooled_mask = pooled_mask.reshape((-3, 0, 0))
// (N,) -> (C, 1) -> (C, N, 1, 1)
cls_target = F.expand_dims(cls_target, 0)
same_cids = F.broadcast_equal(cls_target, cids)
same_cids = same_cids.reshape((-2, 1, 1))
// (N, MS, MS) -> (C, N, 1, 1) -> (C, N, MS, MS)
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 4
Instances
Project Name: dmlc/gluon-cv
Commit Name: ecfc31e21d0c30b1f543aacb8619582b60a1bef7
Time: 2019-08-29
Author: spanev@nvidia.com
File Name: gluoncv/model_zoo/mask_rcnn/rcnn_target.py
Class Name: MaskTargetGenerator
Method Name: hybrid_forward
Project Name: tensorpack/tensorpack
Commit Name: 82a8953e5cc49d98826f9a621c7bc8f13d8314b7
Time: 2019-08-26
Author: ppwwyyxx@users.noreply.github.com
File Name: examples/FasterRCNN/modeling/model_frcnn.py
Class Name:
Method Name: fastrcnn_losses
Project Name: NifTK/NiftyNet
Commit Name: ac2a794577087259da7200eefc792dbba40f8600
Time: 2017-11-02
Author: wenqi.li@ucl.ac.uk
File Name: niftynet/contrib/sampler_pairwise/sampler_pairwise.py
Class Name: PairwiseSampler
Method Name: layer_op