U2-Net Portrait Generator
Trained on
APDrawing Data
This model is an art-oriented spinoff of the original U2-Net project for semantic segmentation. While still taking an image and outputting probabilities for a binary mask, the output of this model is interpreted as pixel values for a grayscale artistic portrait version of the input image, which is assumed to depict a human.
Examples
Resource retrieval
Get the pre-trained net:
Basic usage
Get a face image:
Obtain the portrait version of the image:
Adapt to aspect ratios
The net resizes the image to 320x320 before processing and outputs an image of the same size, hence non-square images will result in distorted outputs:
For this reason, it is advised to manually extract a square crop before feeding the image to the net:
Alternatively, it’s also possible to manually resize the output image to the dimensions of the original image:
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:
Resource History
Reference