Wolfram Neural Net Repository
Immediate Computable Access to Neural Net Models
Segment an image of a driving scenario into semantic component classes
Released in 2017, this architecure combines the technique of dilated convolutions with the paradigm of residual networks, outperforming their nonrelated counterparts in image classification and semantic segmentation.
Number of layers: 86 | Parameter count: 15,994,691 | Trained size: 64 MB |
This model achieves 68% mean IoU accuracy on the Cityscapes dataset.
Get the pre-trained net:
In[1]:= | ![]() |
Out[1]= | ![]() |
Write an evaluation function to handle net reshaping and resampling of input and output:
In[2]:= | ![]() |
Define the label list for this model. Integers in the model’s output correspond to elements in the label list:
In[3]:= | ![]() |
Obtain a segmentation mask for a given image:
In[4]:= | ![]() |
Inspect which classes are detected:
In[5]:= | ![]() |
Out[5]= | ![]() |
In[6]:= | ![]() |
Out[6]= | ![]() |
Visualize the mask:
In[7]:= | ![]() |
Out[7]= | ![]() |
Associate classes to colors using the standard Cityscapes palette:
In[8]:= | ![]() |
Out[8]= | ![]() |
In[9]:= | ![]() |
Write a function to overlap the image and the mask with a legend:
In[10]:= | ![]() |
Inspect the results:
In[11]:= | ![]() |
Out[11]= | ![]() |
In[12]:= | ![]() |
Out[12]= | ![]() |
In[13]:= | ![]() |
Out[13]= | ![]() |
Inspect the number of parameters of all arrays in the net:
In[14]:= | ![]() |
Out[14]= | ![]() |
Obtain the total number of parameters:
In[15]:= | ![]() |
Out[15]= | ![]() |
Obtain the layer type counts:
In[16]:= | ![]() |
Out[16]= | ![]() |
Display the summary graphic:
In[17]:= | ![]() |
Out[17]= | ![]() |
Export the net into a format that can be opened in MXNet:
In[18]:= | ![]() |
Out[18]= | ![]() |
Export also creates a net.params file containing parameters:
In[19]:= | ![]() |
Out[19]= | ![]() |
Get the size of the parameter file:
In[20]:= | ![]() |
Out[20]= | ![]() |
The size is similar to the byte count of the resource object:
In[21]:= | ![]() |
Out[21]= | ![]() |
Represent the MXNet net as a graph:
In[22]:= | ![]() |
Out[22]= | ![]() |
Wolfram Language 11.3 (March 2018) or above