Wolfram Neural Net Repository
Immediate Computable Access to Neural Net Models
Detect and localize objects in an image
Released in 2016, this model discretizes the output space of bounding boxes into a set of default boxes. At the time of prediction, scores are generated for each object and multiple feature maps with different resolutions are used to make predictions for objects of various sizes. This model processes images at 59 FPS on a NVIDIA Titan X.
Number of layers: 145 | Parameter count: 27,076,694 | Trained size: 109 MB |
This model achieves a mAP of 77.2% on PASCAL VOC2007.
Get the pre-trained net:
In[1]:= | ![]() |
Out[1]= | ![]() |
Write an evaluation function to scale the result to the input image size and suppress the least probable detections:
In[2]:= | ![]() |
Define the label list for this model. Integers in the model's output correspond to elements in the label list:
In[3]:= | ![]() |
In[4]:= | ![]() |
Obtain the detected bounding boxes with their corresponding classes and confidences for a given image:
In[5]:= | ![]() |
In[6]:= | ![]() |
Out[6]= | ![]() |
Inspect which classes are detected:
In[7]:= | ![]() |
Out[7]= | ![]() |
Visualize the detection:
In[8]:= | ![]() |
Out[8]= | ![]() |
The network computes 8,732 bounding boxes and the probability that the objects in each box are of any given class:
In[9]:= | ![]() |
Out[9]= | ![]() |
Visualize all the boxes predicted by the net scaled by their “objectness” measures:
In[10]:= | ![]() |
In[11]:= | ![]() |
Out[11]= | ![]() |
Visualize all the boxes scaled by the probability that they contain a bus:
In[12]:= | ![]() |
Out[12]= | ![]() |
In[13]:= | ![]() |
Out[13]= | ![]() |
Superimpose the bus prediction on top of the scaled input received by the net:
In[14]:= | ![]() |
Out[14]= | ![]() |
Write a function to apply a custom styling to the result of the detection:
In[15]:= | ![]() |
Visualize multiple objects, using a different color for each class:
In[16]:= | ![]() |
Out[16]= | ![]() |
Inspect the number of parameters of all arrays in the net:
In[17]:= | ![]() |
Out[17]= | ![]() |
Obtain the total number of parameters:
In[18]:= | ![]() |
Out[18]= | ![]() |
Obtain the layer type counts:
In[19]:= | ![]() |
Out[19]= | ![]() |
Display the summary graphic:
In[20]:= | ![]() |
Out[20]= | ![]() |
Wolfram Language 11.3 (March 2018) or above