tfm.vision.maskrcnn_model.MaskRCNNModel

The Mask R-CNN(-RS) and Cascade RCNN-RS models.

backbone tf.keras.Model, the backbone network.
decoder tf.keras.Model, the decoder network.
rpn_head the RPN head.
detection_head the detection head or a list of heads.
roi_generator the ROI generator.
roi_sampler a single ROI sampler or a list of ROI samplers for cascade detection heads.
roi_aligner the ROI aligner.
detection_generator the detection generator.
mask_head the mask head.
mask_sampler the mask sampler.
mask_roi_aligner the ROI alginer for mask prediction.
class_agnostic_bbox_pred if True, perform class agnostic bounding box prediction. Needs to be True for Cascade RCNN models.
cascade_class_ensemble if True, ensemble classification scores over all detection heads.
min_level Minimum level in output feature maps.
max_level Maximum level in output feature maps.
num_scales A number representing intermediate scales added on each level. For instances, num_scales=2 adds one additional intermediate anchor scales [2^0, 2^0.5] on each level.
aspect_ratios A list representing the aspect raito anchors added on each level. The number indicates the ratio of width to height. For instances, aspect_ratios=[1.0, 2.0, 0.5] adds three anchors on each scale level.
anchor_size A number representing the scale of size of the base anchor to the feature stride 2^level.
**kwargs keyword arguments to be passed.

checkpoint_items Returns a dictionary of items to be additionally checkpointed.

Methods

call

View source

Calls the model on new inputs and returns the outputs as tensors.

In this case call() just reapplies all ops in the graph to the new inputs (e.g. build a new computational graph from the provided inputs).

Args
inputs Input tensor, or dict/list/tuple of input tensors.
training Boolean or boolean scalar tensor, indicating whether to run the Network in training mode or inference mode.
mask A mask or list of masks. A mask can be either a boolean tensor or None (no mask). For more details, check the guide here.

Returns
A tensor if there is a single output, or a list of tensors if there are more than one outputs.