Module Name | U2Net |
---|---|
Category | Image segmentation |
Network | U^2Net |
Dataset | - |
Fine-tuning supported or not | No |
Module Size | 254MB |
Data indicators | - |
Latest update date | 2021-02-26 |
-
-
Network architecture:
-
For more information, please refer to: U2Net
-
-
- paddlepaddle >= 2.0.0
- paddlehub >= 2.0.0
-
-
$ hub install U2Net
-
In case of any problems during installation, please refer to:Windows_Quickstart | Linux_Quickstart | Mac_Quickstart
-
-
import cv2 import paddlehub as hub model = hub.Module(name='U2Net') result = model.Segmentation( images=[cv2.imread('/PATH/TO/IMAGE')], paths=None, batch_size=1, input_size=320, output_dir='output', visualization=True)
-
def Segmentation( images=None, paths=None, batch_size=1, input_size=320, output_dir='output', visualization=False):
-
Prediction API, obtaining segmentation result.
-
Parameter
- images (list[np.ndarray]) : Image data, ndarray.shape is in the format [H, W, C], BGR.
- paths (list[str]) : Image path.
- batch_size (int) : Batch size.
- input_size (int) : Input image size, default is 320.
- output_dir (str) : Save path of images, 'output' by default.
- visualization (bool) : Whether to save the results as picture files.
-
Return
- results (list[np.ndarray]): The list of segmentation results.
-
-
1.0.0
First release