Thanks for tuning in to Google I/O. View all sessions on demandWatch on demand

tfm.vision.heads.MaskScoring

Creates a mask scoring layer.

This implements mask scoring layer from the paper:

Zhaojin Huang, Lichao Huang, Yongchao Gong, Chang Huang, Xinggang Wang. Mask Scoring R-CNN. (https://arxiv.org/pdf/1903.00241.pdf)

num_classes An int for number of classes.
fc_input_size A List of int for the input size of the fully connected layers.
num_convs Anint for number of conv layers.
num_filters An int for the number of filters for conv layers.
use_depthwise_convolution A bool, whether or not using depthwise convs.
fc_dims An int number of filters for each fully connected layers.
num_fcs An int for number of fully connected layers.
activation A str name of the activation function.
use_sync_bn A bool, whether or not to use sync batch normalization.
norm_momentum A float for the momentum in BatchNorm. Defaults to 0.99.
norm_epsilon A float for the epsilon value in BatchNorm. Defaults to 0.001.
kernel_regularizer A tf.keras.regularizers.Regularizer object for Conv2D. Default is None.
bias_regularizer A tf.keras.regularizers.Regularizer object for Conv2D.
**kwargs Additional keyword arguments to be passed.

Methods

call

View source

Forward pass mask scoring head.

Args
inputs A tf.Tensor of the shape [batch_size, width, size, num_classes], representing the segmentation logits.
training a bool indicating whether it is in training mode.

Returns
mask_scores A tf.Tensor of predicted mask scores [batch_size, num_classes].