Resource retrieval
Get the pre-trained net:
NetModel parameters
This model consists of a family of individual nets, each identified by a specific parameter combination. Inspect the available parameters:
Pick a non-default net by specifying the parameters:
Pick a non-default uninitialized net:
Evaluation function
Write an evaluation function to scale the result to the input image size and suppress the least probable detections:
Basic usage
Obtain the detected bounding boxes with their corresponding classes and confidences for a given image:
The model's output is an Association containing the detected "Boxes", "Classes" and "Masks":
The "Boxes" key is a list of Rectangle expressions corresponding to the bounding boxes of the detected objects:
The "Classes" key contains the classes of the detected objects:
The "Masks" key contains segmentation masks for the detected objects:
Visualize the boxes labeled with their assigned classes:
Visualize the masks labeled with their assigned classes:
Network result
The network computes eight thousand four hundred bounding boxes, the probability that the objects in each box are of any given class, 32 160x160 prototyped segmentation masks and mask weights for each bounding box:
Visualize prototyped masks:
Every box is then assigned a mask, computed by taking linear combinations of the prototyped masks with the associated weights. Values are normalized to lie between 0 and 1 with a LogisticSigmoid:
Filter out masks whose detection probabilities are small and visualize the others:
Scale the boxes and apply non-maximum suppression for the final reduction. Use the result to filter the masks and visualize them:
Remove the padding from the masks, scale them to the original image size, binarize them and use the scaled boxes to isolate the region of interest:
Remove any detections outside the boxes:
Visualize the bounding boxes scaled by their class probabilities:
Visualize all the boxes scaled by the probability that they contain a person:
Superimpose the person predictions on top of the input received by the net:
Net information
Inspect the number of parameters of all arrays in the net:
Obtain the total number of parameters:
Obtain the layer type counts:
Display the summary graphic: