Wolfram Neural Net Repository
Immediate Computable Access to Neural Net Models
Estimate the depth map of an image
Released in 2016, this neural net was trained to predict the relative depth map from a single image using a novel technique based on sparse ordinal annotations. Each training example only needs to be annotated with a pair of points and its relative distance to the camera. After training, the net is able to reconstruct the full depth map. Its architecture is based on the "hourglass" design.
Number of layers: 501 | Parameter count: 5,385,185 | Trained size: 23 MB |
This model achieves 22.14% WHDR (Weighted Human Disagreement Rate) error on the Depth in the Wild dataset with all weights set to 1.
Get the pre-trained net:
In[1]:= | ![]() |
Out[1]= | ![]() |
Obtain the depth map of an image:
In[2]:= | ![]() |
Out[2]= | ![]() |
Show the depth map:
In[3]:= | ![]() |
Out[3]= | ![]() |
Get an image:
In[4]:= | ![]() |
In[5]:= | ![]() |
Obtain the depth map:
In[6]:= | ![]() |
Out[6]= | ![]() |
Visualize a 3D model using the depth map:
In[7]:= | ![]() |
Out[7]= | ![]() |
The recommended way to deal with image sizes and aspect ratios is to resample the depth map after the net evaluation. Get an image:
In[8]:= | ![]() |
Obtain the dimensions of the image:
In[9]:= | ![]() |
Out[9]= | ![]() |
Obtain the depth map
In[10]:= | ![]() |
Out[10]= | ![]() |
Resample the depth map and visualize it:
In[11]:= | ![]() |
Out[11]= | ![]() |
Inspect the number of parameters of all arrays in the net:
In[12]:= | ![]() |
Out[12]= | ![]() |
Obtain the total number of parameters:
In[13]:= | ![]() |
Out[13]= | ![]() |
Obtain the layer type counts:
In[14]:= | ![]() |
Out[14]= | ![]() |
Display the summary graphic:
In[15]:= | ![]() |
Out[15]= | ![]() |
Wolfram Language 11.2 (September 2017) or above