Skip to content
This repository has been archived by the owner on Nov 21, 2023. It is now read-only.

The mask-rcnn structure graph is the same as faster-rcnn? #614

Closed
lilichu opened this issue Aug 13, 2018 · 1 comment
Closed

The mask-rcnn structure graph is the same as faster-rcnn? #614

lilichu opened this issue Aug 13, 2018 · 1 comment

Comments

@lilichu
Copy link

lilichu commented Aug 13, 2018

hi!
I output the structure graph of mask-rcnn, but I find it is the same as the structure graph of faster-rcnn.

The net such as the following:

INFO net.py: 250: _[mask]_roi_feat_shuffled   : (13, 256, 14, 14)    => _[mask]_roi_feat            : (13, 256, 14, 14)    ------- (op: BatchPermutation)
INFO net.py: 250: mask_rois_idx_restore_int32 : (13,)                => _[mask]_roi_feat            : (13, 256, 14, 14)    ------|
INFO net.py: 250: _[mask]_roi_feat            : (13, 256, 14, 14)    => _[mask]_fcn1                : (13, 256, 14, 14)    ------- (op: Conv)
INFO net.py: 250: _[mask]_fcn1                : (13, 256, 14, 14)    => _[mask]_fcn1                : (13, 256, 14, 14)    ------- (op: Relu)
INFO net.py: 250: _[mask]_fcn1                : (13, 256, 14, 14)    => _[mask]_fcn2                : (13, 256, 14, 14)    ------- (op: Conv)
INFO net.py: 250: _[mask]_fcn2                : (13, 256, 14, 14)    => _[mask]_fcn2                : (13, 256, 14, 14)    ------- (op: Relu)
INFO net.py: 250: _[mask]_fcn2                : (13, 256, 14, 14)    => _[mask]_fcn3                : (13, 256, 14, 14)    ------- (op: Conv)
INFO net.py: 250: _[mask]_fcn3                : (13, 256, 14, 14)    => _[mask]_fcn3                : (13, 256, 14, 14)    ------- (op: Relu)
INFO net.py: 250: _[mask]_fcn3                : (13, 256, 14, 14)    => _[mask]_fcn4                : (13, 256, 14, 14)    ------- (op: Conv)
INFO net.py: 250: _[mask]_fcn4                : (13, 256, 14, 14)    => _[mask]_fcn4                : (13, 256, 14, 14)    ------- (op: Relu)
INFO net.py: 250: _[mask]_fcn4                : (13, 256, 14, 14)    => conv5_mask                  : (13, 256, 28, 28)    ------- (op: ConvTranspose)
INFO net.py: 250: conv5_mask                  : (13, 256, 28, 28)    => conv5_mask                  : (13, 256, 28, 28)    ------- (op: Relu)
INFO net.py: 250: conv5_mask                  : (13, 256, 28, 28)    => mask_fcn_logits             : (13, 13, 28, 28)     ------- (op: Conv)
INFO net.py: 250: mask_fcn_logits             : (13, 13, 28, 28)     => loss_mask                   : ()                   ------- (op: SigmoidCrossEntropyLoss)
INFO net.py: 250: masks_int32                 : (13, 10192)          => loss_mask                   : ()                   ------|

After roi_feat, it should be fcn1, fcn2, fcn3, fcn4... But why does the output of structure graph not contain these?
The structure graph of mask-rcnn is such as:
image
the graph is the same as faster-rcnn. Thanks!

@lilichu lilichu changed the title The mask-rcnn structure graph? The mask-rcnn structure graph is the same as faster-rcnn? Aug 13, 2018
@gadcam
Copy link
Contributor

gadcam commented Aug 13, 2018

@lilichu As far as I understand it, the structure is coded in two separate nets :

  • model.net which should really look like a Faster R-CNN
  • model.mask_net which implements the mask specific parts
  • OR model.keypoint_net in the case of a keypoint net

I think you should try to print the model.mask_net part.

See

# Inference uses a cascade of box predictions, then mask predictions.
# This requires separate nets for box and mask prediction.
# So we extract the mask prediction net, store it as its own network,
# then restore model.net to be the bbox-only network
model.mask_net, blob_mask = c2_utils.SuffixNet(
'mask_net', model.net, len(bbox_net.op), blob_mask
)

You can also check the function run_model_pb in #449 to get a quick idea of how the full prediction looks like in practice.
https://github.com/facebookresearch/Detectron/pull/449/files#diff-077e2ae71af52724d94c3522525d2e7fR524

@ir413 ir413 closed this as completed Aug 17, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants