Skip to content

Latest commit

 

History

History
96 lines (69 loc) · 2.64 KB

File metadata and controls

96 lines (69 loc) · 2.64 KB

U2Net

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

I. Basic Information

  • Application Effect Display

    • Sample results:

  • Module Introduction

    • Network architecture:


    • For more information, please refer to: U2Net

II. Installation

III. Module API Prediction

  • 1、Prediction Code Example

    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)
  • 2、API

    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.

IV. Release Note

  • 1.0.0

    First release