YOLO V2
Trained on
MS-COCO Data
YOLO (You Only Look Once) Version 2 is an object detection model published by Joseph Redmon and Ali Farhadi in December 2016. It is a single-stage architecture that goes straight from image pixels to bounding box coordinates and class probabilities. Compared to its predecessor, it introduces batch normalization, raises the image resolution and switches from direct coordinate prediction to anchor boxes' offsets. On an NVIDIA Titan X, it processes images at 40-90 FPS.
Number of layers: 106 |
Parameter count: 51,000,657 |
Trained size: 205 MB |
Examples
Resource retrieval
Get the pre-trained net:
Evaluation function
Write an evaluation function to scale the result to the input image size and suppress the least probable detections:
Label list
Define the label list for this model. Integers in the model’s output correspond to elements in the label list:
Basic usage
Obtain the detected bounding boxes with their corresponding classes and confidences for a given image:
Inspect which classes are detected:
Visualize the detection:
Network result
The network computes 845 bounding boxes, the probability of having an object in each box and the conditioned probability that the object is of any given class:
Visualize all the boxes predicted by the net scaled by their “objectness” measures:
Visualize all the boxes scaled by the probability that they contain a cat:
Superimpose the cat prediction on top of the scaled input received by the net:
Advanced visualization
Write a function to apply a custom styling to the result of the detection:
Visualize multiple objects, using a different color for each class:
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:
Export to MXNet
Export the net into a format that can be opened in MXNet:
Export also creates a net.params file containing parameters:
Get the size of the parameter file:
The size is similar to the byte count of the resource object:
Requirements
Wolfram Language
11.3
(March 2018)
or above
Resource History
Reference