We use essential cookies for the website to function, as well as analytics cookies for analyzing and creating statistics of the website performance. To agree to the use of analytics cookies, click "Accept All". You can manage your preferences at any time by clicking "Cookie Settings" on the footer. More Information.

Only Essential Cookies
Accept All
ReferencesML KitAndroidcom.huawei.hms.mlsdk.imgsegClass SummaryMLImageSegmentationSetting

MLImageSegmentationSetting

Expand

Class Info

com.huawei.hms.mlsdk.imgseg.MLImageSegmentationSetting

Sets the image segmentation analyzer. Attributes of the analyzer MLImageSegmentationAnalyzer include:

  • Detection mode. Three modes are supported: human body detection mode (default), multiclass image detection mode, and hair detection mode.
  • Indicates whether fine detection is supported (for human body and multiclass image detection modes). This function is supported by default.
  • Types of returned results. By default, all results are returned.

Nested Class Summary

Expand

Qualifier and Type

Class Name and Description

static class

MLImageSegmentationSetting.Factory

Creates an instance of the image segmentation configurator to set image segmentation attributes.

Public Field Summary

Expand

Qualifier and Type

Field and Description

int

BODY_SEG

Detection mode 0: detection based on the portrait model

int

IMAGE_SEG

Detection mode 1: detection based on the multiclass image mode

int

HAIR_SEG

Detection mode 2: detection based on the hair model

Public Method Summary

Expand

Qualifier and Type

Method Name and Description

boolean

equals(Object target)

Determines whether the input instance is equal to the current instance.

int

getAnalyzerType()

Obtains the detection mode.

int

getScene()

Obtains results to be returned. Choose only necessary results to be returned to reduce the processing time of unnecessary capabilities.

int

hashCode()

Obtains the hash value of the current instance.

boolean

isExact()

Checks whether fine detection is supported.

Public Fields

BODY_SEG

Expand

Field

public static final int BODY_SEG

Detection mode 0: detection based on the portrait model

Constant value: 0

IMAGE_SEG

Expand

Field

public static final int IMAGE_SEG

Detection mode 1: detection based on the multiclass image mode

Constant value: 1

HAIR_SEG

Expand

Field

public static final int HAIR_SEG

Detection mode 2: detection based on the hair model

Constant value: 2

Public Methods

equals(Object target)

Expand

Method

public boolean equals(Object target)

Determines whether the input instance is equal to the current instance.

Parameters
Expand

Name

Description

target

Instance to be compared.

Returns
Expand

Type

Description

boolean

  • true: The two instances are equal.
  • false: The two instances are different.

getAnalyzerType()

Expand

Method

public int getAnalyzerType()

Obtains the detection mode.

Returns
Expand

Type

Description

int

Detection mode result.
  • 0: BODE_SEG indicates the human body detection mode (supports distinguishing between the human body and background).
  • 1: IMAGE_SEG indicates the multiclass image detection mode (supports classification of all objects in MLImageSegmentationClassification).
  • 2: HAIR_SEG indicates the hair detection mode.

getScene()

Expand

Method

public int getScene()

Obtains results to be returned. Choose only necessary results to be returned to reduce the processing time of unnecessary capabilities.

Returns
Expand

Type

Description

int

  • 0: all results
  • 1: pixel-level label information
  • 2: human body image with a transparent background

hashCode()

Expand

Method

public int hashCode()

Obtains the hash value of the current instance.

Returns
Expand

Type

Description

int

Hash value of the current instance.

isExact()

Expand

Method

public boolean isExact()

Checks whether fine detection is supported.

Returns
Expand

Type

Description

boolean

Whether fine detection is supported.
  • true: yes
  • false: no
Search in References
Enter a keyword.