huawei_ml 2.0.1+300

Flutter Android

HUAWEI Ml Kit plugin for Flutter. It provides diversified leading machine learning capabilities that are easy to use, helping you develop various AI apps.

Huawei ML Kit Flutter Plugin #

Table Of Contents #

  • Introduction
  • Installation Guide
  • API Reference
  • Configuration Description
  • Licensing and Terms

Introduction #

This plugin enables communication between Huawei ML SDK and Flutter platform. It allows your apps to easily leverage Huawei's long-term proven expertise in machine learning to support diverse artificial intelligence (AI) applications throughout a wide range of industries. Thanks to Huawei's technology accumulation, ML Kit provides diversified leading machine learning capabilities that are easy to use, helping you develop various AI apps.

Installation Guide #

  • Before you get started, you must register as a HUAWEI developer and complete identity verification on the HUAWEI Developer website. For details, please refer to Register a HUAWEI ID.

  • Create an app by referring to Creating an AppGallery Connect Project and Adding an App to the Project.

  • The data storage location determines the region where your app will connect to on-cloud services of ML Kit. To set the data storage location, go to Project Setting > General Information, click Set next to Data storage location under Project, and select a data storage location in the displayed dialog box. For details, please refer to Setting a Data Storage Location.

  • A signing certificate fingerprint is used to verify the authenticity of an app when it attempts to access an HMS Core (APK) through the HMS SDK. Before using the HMS Core (APK), you must locally generate a signing certificate fingerprint and configure it in AppGallery Connect. For details, please refer to Generating a Signing Certificate.

  • Sign in to AppGallery Connect and select My projects. After selecting your project, on the Project Setting page, set SHA-256 certificate fingerprint to the SHA-256 fingerprint. For details, please refer to Adding Fingerprint Certificate to AppGallery Connect.

  • In AppGallery Connect, on My projects page, find your project from the list and select it. Go to Project Settings > General Information > App information. Click agconnect-service.json to download configuration file.

  • Copy the agconnect-service.json file to the android/app directory of your project.

  • Open the build.gradle file in the android directory of your project.

    • Go to buildscript then configure the Maven repository address and agconnect plugin for the HMS SDK.

        buildscript {
            repositories {
                google()
                jcenter()
                maven { url 'https://developer.huawei.com/repo/' }
            }
      
            dependencies {
                /*
                 * <Other dependencies>
                 */
                classpath 'com.huawei.agconnect:agcp:1.3.1.300'
            }
        }
      
    • Go to allprojects then configure the Maven repository address for the HMS SDK.

        allprojects {
            repositories {
                google()
                jcenter()
                maven { url 'https://developer.huawei.com/repo/' }
            }
        }
      
  • Open the build.gradle file in the android/app directory.

    • Add apply plugin: 'com.huawei.agconnect' line after the apply plugin: 'com.android.application' line.

        apply plugin: 'com.android.application'
        apply plugin: 'com.huawei.agconnect'
        apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
      
    • Set your package name in defaultConfig > applicationId and set minSdkVersion to 19 or higher. Package name must match with the package_name entry in agconnect-services.json file.

        defaultConfig {
                applicationId "<package_name>"
                minSdkVersion 19
                /*
                 * <Other configurations>
                 */
            }
      
    • Copy the signature file that generated in Generating a Signing Certificate to android/app directory.

    • Configure the signature in android according to the signature file information.

        android {
            /*
             * <Other configurations>
             */
      
            signingConfigs {
                config {
                    storeFile file('<keystore_file>.jks')
                    storePassword '<keystore_password>'
                    keyAlias '<key_alias>'
                    keyPassword '<key_password>'
                }
            }
      
            buildTypes {
                debug {
                    signingConfig signingConfigs.config
                }
                release {
                    signingConfig signingConfigs.config
                    minifyEnabled true
                    shrinkResources true
                    proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
                }
            }
        }
      
  • On your Flutter project directory find and open your pubspec.yaml file and add library to dependencies to download the package from pub.dev.

      dependencies:
          huawei_ml: {library version}
    

    or

    if you downloaded the package from the HUAWEI Developer website, specify the library path on your local device.

      dependencies:
          huawei_ml:
              # Replace {library path} with actual library path of Huawei ML Kit Flutter Plugin.
              path: {library path}
    
  • Run following command to update package info.

      [project_path]> flutter pub get
    
  • Run following command to start the app.

      [project_path]> flutter run
    

API Reference #

This section does not cover all of the API, to read more, visit Huawei Developer.

MlTextClient #

Methods

Return TypeMethodDescription
Future<MlText>analyzeLocally(MlTextSettings settings)Sets LocalTextAnalyzer, starts the analyze operation by using current Frame and returns the result.
Future<MlText>analyzeRemotely(MlTextSettings settings)Sets RemoteTextAnalyzer, starts the analyze operation and returns the result.
Future<List<MlTextBlock>>analyzeWithSparseArray(MlTextSettings settings)Makes a synchronous call and returns a list of MlTextBlock objects.
Future<MlTextAnalyzer>getAnalyzerInfo()Returns analyzer information.
Future<String>stopAnalyzer()Closes the analyzer.

Data Types

MlText
PropertiesTypeDescription
stringValueStringObtains the string value of recognized text.
blocksMlTextBlockObtains the MlTextBlock object.
MlTextSettings
PropertiesTypeDescription
ocrModeintSets the detection mode.
languageStringSets the language
pathStringSets the image path.
languageListList<String>Sets the language list.
borderTypeStringSets the border type.
textDensitySceneintSets the text density scene.
MlTextAnalyzer
PropertiesTypeDescription
analyzeTypeintObtains analyze type.
isAvailableboolChecks whether analyzer is available or not.
MlTextBlock
PropertiesTypeDescription
contentsMlTextContentsObtains the lower-level text object contained in the current text object.
borderMlBorderObtains the axis-aligned bounding rectangle of the text.
vertexesMlCoordinatePointsObtains the corner points of the text bounding box.
stringValueStringObtains the text value of the block.
possibilitydynamicObtains the confidence of the detection result.
languageStringObtains the recognized language.
languageListList<dynamic>Obtains the list of recognized languages
MlTextContents
PropertiesTypeDescription
borderMlBorderObtains the axis-aligned bounding rectangle of the text.
vertexesMlCoordinatePointsObtains the corner points of the text bounding box.
contentsContentsObtains the lower-level text object contained in the current text object.
stringValueStringObtains the text value of the block.
rotationDegreedynamicObtains the roll angle of the current text line relative to the horizontal position.
isVerticalboolDetermines whether the text in the current text line is in a vertical layout.
languageStringObtains the recognized language.
possibilitydynamicObtains the confidence of the detection result.
languageListList<dynamic>Obtains the list of recognized languages
Contents
PropertiesTypeDescription
borderMlBorderObtains the axis-aligned bounding rectangle of the text.
vertexesMlCoordinatePointsObtains the corner points of the text bounding box.
stringValueStringObtains the text value of the block.
languageStringObtains the recognized language.
possibilitydynamicObtains the confidence of the detection result.
languageListList<dynamic>Obtains the list of recognized languages
MlTextLanguage
PropertiesTypeValueDescription
EnglishStringenValue for English.
ChineseStringzhValue for Chinese.
JapaneseStringjaValue for Japanese.
KoreanStringkoValue for Korean.
RussianStringruValue for Russian.
GermanStringdeValue for German.
FrenchStringfrValue for French.
ItalianStringitValue for Italian.
PortugueseStringptValue for Portuguese.
SpanishStringesValue for Spanish.
RomanceLanguagesStringrmValue for RomanceLanguages.
PolishStringplValue for Polish.
NorwegianStringnoValue for Norwegian.
SwedishStringsvValue for Swedish.
DanishStringdaValue for Danish.
TurkishStringtrValue for Turkish.
FinnishStringfiValue for Finnish.
ThaiStringthValue for Thai.
ArabicStringarValue for Arabic.
HindiStringhiValue for Hindi.
MlTextOcrMode
PropertiesTypeValueDescription
OCR_DETECT_MODEint1Value for detection mode in text recognition.
MlTextDensityScene
PropertiesTypeValueDescription
OCR_COMPACT_SCENEint2dense text recognition
OCR_LOOSE_SCENEint1sparse text recognition

MlDocumentClient #

Methods

Return TypeMethodDescription
Future<MlDocument>getDocumentAnalyzeInformation(MlDocumentSettings settings)Sets DocumentAnalyzer, starts the analyze operation by using current Frame and returns the result.
Future<String>closeAnalyzer()Closes the analyzer.

Data Types

MlDocument
PropertiesTypeDescription
stringValueStringObtains the detected text content.
blocksMlDocumentBlocksRepresents a detected text block.
MlDocumentSettings
PropertiesTypeDescription
borderTypeStringSets the border type.
pathStringSets the image path.
languageListList<String>Sets the language list.
MlDocumentBlocks
PropertiesTypeDescription
stringValueStringObtains the detected text content.
possibilitydynamicObtains the detection result confidence.
borderMlBorderObtains the text block bounding box.
sectionsMlDocumentSectionsRepresents a detected section.
intervalMlDocumentIntervalRepresents a text interval.
MlDocumentSections
PropertiesTypeDescription
stringValueStringObtains the detected text content.
possibilitydynamicObtains the detection result confidence.
borderMlBorderObtains the text block bounding box.
languageListList<dynamic>Obtains the detected languages.
lineListMlDocumentLineListRepresents a detected line.
wordListMlDocumentWordListRepresents a detected word.
intervalMlDocumentIntervalRepresents a text interval.
MlDocumentLineList
PropertiesTypeDescription
stringValueStringObtains the detected text content.
possibilitydynamicObtains the detection result confidence.
borderMlBorderObtains the text block bounding box.
languageListList<dynamic>Obtains the detected languages.
wordListMlDocumentWordListRepresents a detected word.
intervalMlDocumentIntervalRepresents a text interval.
pointsMlCoordinatePointsObtains the corner points of a line bounding box.
MlDocumentWordList
PropertiesTypeDescription
stringValueStringObtains the detected text content.
possibilitydynamicObtains the detection result confidence.
borderMlBorderObtains the text block bounding box.
languageListList<dynamic>Obtains the detected languages.
intervalMlDocumentIntervalRepresents a text interval.
characterListMlDocumentCharacterListRepresents a detected character.
MlDocumentCharacterList
PropertiesTypeDescription
stringValueStringObtains the detected text content.
possibilitydynamicObtains the detection result confidence.
borderMlBorderObtains the text block bounding box.
languageListList<dynamic>Obtains the detected languages.
intervalMlDocumentIntervalRepresents a text interval.
MlDocumentInterval
PropertiesTypeDescription
intervalTypedynamicObtains the type of the detected text interval.
isTextFollowedboolDetermines whether there is text after the text interval.

MlBankcardClient #

Methods

Return TypeMethodDescription
Future<MlBankcard>analyzeBankcard(MlBankcardSettings settings)Sets Bank Card Recognition Analyzer, starts the analyze operation by using current Frame and returns the result.
Future<MlBankcard>captureBankcard(MlBankcardSettings settings)Starts capture activity and returns the capture result.
Future<String>stopAnalyzer()Closes the analyzer.

Data Types

MlBankcard
PropertiesTypeDescription
expireStringObtains the card's expire date
numberStringObtains the card number
StringissuerObtains the issuing bank.
retCodeintObtains the ret code
tipsCodeintObtains the tips code
originalBitmapdynamicObtains image path generated from bitmap.
numberBitmapdynamicObtains bankcard number image path generated from bitmap.
typedynamicObtains the bankcard type.
MlBankcardSettings
PropertiesTypeDescription
pathStringSets the image path.
langTypeStringSets the language type.
orientationintSets the orientation.

MlGeneralCardClient #

Methods

Return TypeMethodDescription
Future<MlGeneralCard>getResultWithCapturing(MlGeneralCardSettings settings)Starts capture activity and returns result.
Future<MlGeneralCard>getResultWithTakingPicture(MlGeneralCardSettings settings)Starts activity to take picture and returns the result.
Future<MlGeneralCard>getResultWithLocalImage(MlGeneralCardSettings settings)Sets General Card Recognition Analyzer, starts the analyze operation by using current Frame and returns the result.

Data Types

MlGeneralCard
PropertiesTypeDescription
textStringGeneral card recognition result.
cardBitmapUriStringObtains image path generated from bitmap.
MlGeneralCardSettings
PropertiesTypeDescription
pathStringSets the image path.
languageStringSets the language.
tipTextStringSets the tip text in capture activity.
orientationintSets the orientation.
scanBoxCornerColorintSets the scan box corner color in capture activity.
tipTextColorintSets the tip text color in capture activity.
backButtonResIdintSets the back button res id in capture activity.
photoButtonResIdintSets the photo button res id in capture activity.

MlTranslatorClient #

Methods

Return TypeMethodDescription
Future<String>getTranslateResult(MlTranslatorSettings settings)Returns translate result.
Future<String>stopTranslator()Stops translator.

Data Types

MlTranslatorSettings
PropertiesTypeDescription
targetLangCodeStringSets the target language.
sourceLangCodeStringSets the source language.
sourceTextStringSets the text to be translated.
MlTranslateLanguageOptions
PropertiesTypeValueDescription
EnglishStringenValue for English.
ChineseStringzhValue for Chinese.
FrenchStringfrValue for French.
ArabicStringarValue for Arabic.
ThaiStringthValue for Thai.
SpanishStringesValue for Spanish.
TurkishStringtrValue for Turkish.
PortugueseStringptValue for Portuguese.
JapaneseStringjaValue for Japanese.
GermanStringdeValue for German.
ItalianStringitValue for Italian.
RussianStringruValue for Russian.
PolishStringplValue for Polish.
SwedishStringsvValue for Swedish.
FinnishStringfiValue for Finnish.
NorwegianStringnoValue for Norwegian.
DanishStringdaValue for Danish.
KoreanStringkoValue for Korean.
MalayStringmsValue for Malay.

MlLangDetectionClient #

Methods

Return TypeMethodDescription
Future<String>getFirstBestDetect(MlLangDetectionSettings settings)Returns confident detection result.
Future<MlDetectedLanguage>getProbabilityDetect(MlLangDetectionSettings settings)Returns possible detection result.
Future<String>stopDetection()Stops detection.

Data Types

MlDetectedLanguage
PropertiesTypeDescription
langCodeStringObtains the language code in the language detection result.
probabilitydynamicObtains the confidence of the language detection result.
hashcodedynamicCalculates the hash value of the language detection result instance.
MlLangDetectionSettings
PropertiesTypeDescription
sourceTextStringSets the text to be used to detect language.
trustedThresholddoubleSets the minimum confidence threshold for language detection.

MlTextToSpeechClient #

Methods

Return TypeMethodDescription
FuturegetSpeechFromText(MlTextToSpeechSettings settings)Starts the speech.
Future<bool>pauseSpeech()Pauses the speech.
Future<bool>resumeSpeech()Resumes the speech.
Future<String>stopTextToSpeech()Stops text to speech.

Data Types

MlTextToSpeechSettings
PropertiesTypeDescription
textStringSets the text to be converted to speech.
languageStringSets the language.
personStringSets the sex & nation of speech.
speeddoubleSets the speed of speech.
volumedoubleSets the volume of speech.
queingModeintSets the queing mode.
MlTtsLanguage
PropertiesTypeValueDescription
TTS_EN_USStringen-USValue for English.
TTS_ZH_HANSStringzh-HansValue for Chinese.
MlTtsPerson
PropertiesTypeValueDescription
TTS_SPEAKER_FEMALE_ENStringFemale-enSets the speaker as an English female.
TTS_SPEAKER_FEMALE_ZHStringFemale-zhSets the speaker as an Chinese female.
TTS_SPEAKER_MALE_ENStringMale-enSets the speaker as an English male.
TTS_SPEAKER_MALE_ZHStringMale-zhSets the speaker as an Chinese male.
MlTtsQueuingMode
PropertiesTypeValueDescription
QUEUE_APPENDint0If playback pauses, the playback is resumed and the task is added to the queue for execution in sequence. If there is no playback, the audio synthesis task is executed immediately.
QUEUE_FLUSHint1The ongoing audio synthesis task and playback are stopped immediately, all audio synthesis tasks in the queue are cleared, and the current audio synthesis task is executed immediately and played.

MlAsrClient #

Methods

Return TypeMethodDescription
Future<String>getTextFromSpeech(MLAsrSettings settings)Returns text from speech.
Future<String>stopRecognition()Stops the recognition.

Data Types

MLAsrSettings
PropertiesTypeDescription
languageStringSets the language.
featureintSets feature to return the recognition result along with the speech.
MLAsrFeature
PropertiesTypeValueDescription
FEATURE_WORD_FLUXint11Recognizes and returns texts through onRecognizingResults.
FEATURE_ALL_IN_ONEint12After the recognition is complete, texts are returned through onResults.
MLAsrLanguage
PropertiesTypeValueDescription
chineseStringzh-CNValue for Chinese.
englishStringen-USValue for English.
frenchStringfr-FRValue for French.

MlAftClient #

Methods

Return TypeMethodDescription
Future<String>getAudioTranscriptionResult(MLAftSettings settings)Returns text from audio file.

Data Types

MLAftSettings
PropertiesTypeDescription
pathStringSets the audio file path.
languageStringSets the language.
MLAftLanguage
PropertiesTypeValueDescription
chineseStringzhValue for Chinese.
englishStringen-USValue for English.

MlImageClassificationClient #

Methods

Return TypeMethodDescription
Future<List<MlImageClassification>>getDefaultClassificationResult(String path)Obtains classification result with default parameters.
Future<List<MlImageClassification>>getLocalClassificationResult(MlImageClassificationSettings settings)Sets Image Classification Analyzer, starts the analyze operation by using current Frame and returns the result.
Future<List<MlImageClassification>>getRemoteClassificationResult(MlImageClassificationSettings settings)Sets Image Classification Analyzer, starts the analyze operation by using current Frame and returns the result.
Future<List<MlImageClassification>>getAnalyzeFrameClassificationResult(MlImageClassificationSettings settings)Returns result by using analyze frame.
Future<String>closeAnalyzer()Closes the analyzer.

Data Types

MlImageClassification
PropertiesTypeDescription
classificationIdentityStringObtains the classification ID.
nameStringObtains the classification name.
possibilitydynamicObtains the classification confidence.
MlImageClassificationSettings
PropertiesTypeDescription
pathStringSets the image path.
minAcceptablePossibilitydoubleSets the confidence threshold.
largestNumberOfReturnsintSets the max return count.

MlObjectClient #

Methods

Return TypeMethodDescription
Future<MlObject>getObjectAnalyzerInformation(MlObjectSettings settings)Creates the analyzer, analyzes the current frame, returns the result.
Future<String>stopAnalyzer()Stops the analyzer.

Data Types

MlObject
PropertiesTypeDescription
borderMlBorderObtains the axis-aligned bounding rectangle of an object.
typeIdentityintObtains the object classification result.
typePossibilitydynamicObtains the object detection confidence.
MlObjectSettings
PropertiesTypeDescription
pathStringSets the image path.
allowMultiResultsboolSets the multi-object detection.
allowClassificationboolSets whether to support detection result classification or not.

MlLandMarkClient #

Methods

Return TypeMethodDescription
Future<MlLandmark>getDefaultLandmarkAnalyzeInformation(String path)Starts recognition with default parameters and returns the result.
Future<MlLandmark>getLandmarkAnalyzeInformation(MlLandMarkSettings settings)Creates the analyzer, analyzes the frame, returns the result.
Future<String>stopAnalyzer()Stops the analyzer.

Data Types

MlLandmark
PropertiesTypeDescription
borderMlBorderObtains the axis-aligned bounding rectangle of an object.
landmarkStringObtains the landmark description.
landmarkIdentityStringObtains the landmark identity.
possibilitydynamicObtains the result confidence.
positionPositionObtains landmark location information.
MlLandmarkSettings
PropertiesTypeDescription
pathStringSets the image path.
patternTypeintSets the recognition pattern type.
largestNumberOfReturnsintSets max return count.
Position
PropertiesTypeDescription
latdynamicObtains the latitude
lngdynamicObtains the longitude
LandmarkAnalyzerPattern
PropertiesTypevalueDescription
STEADY_PATTERNint1Stable mode.
NEWEST_PATTERNint2Newest mode.

MlImageSegmentationClient #

Methods

Return TypeMethodDescription
Future<MlImageSegmentationResult>getDefaultSegmentation(String path)Starts analyzing with default parameters and returns the result.
Future<MlImageSegmentationResult>getSegmentation(MlImageSegmentationSettings settings)Creates the analyzer, analyzes the frame, returns the result.
Future<List<MlImageSegmentationResult>>getSparseSegmentation(MlImageSegmentationSettings settings)Returns result by using analyze frame.
Future<String>stopSegmentation()Stops segmentation.

Data Types

MlImageSegmentationResult
PropertiesTypeDescription
foregroundUridynamicObtains the image uri that is generated with foreground bitmap.
grayscaleUridynamicObtains the image uri that is generated with grayscale bitmap.
originalUridynamicObtains the image uri that is generated with original bitmap.
MlImageSegmentationSettings
PropertiesTypeDescription
pathStringSets the image path.
analyzerTypeintSets the analyzer type.
sceneintSets the scene.
exactModeboolSets to whether the fine detection is supported or not.
ImgSegmentationAnalyzerType
PropertiesTypevalueDescription
BODY_SEGint0Detection based on the human body model.
IMAGE_SEGint1detection based on the multi class image model.
ImgSegmentationScene
PropertiesTypevalueDescription
ALLint0All results.
MASK_ONLYint1Only mask results.
FOREGROUND_ONLYint2Only foreground results.
GRAYSCALE_ONLYint3Only grayscale results.

MlProductVisionSearchClient #

Methods

Return TypeMethodDescription
Future<MlProductVisionSearch>getProductVisionSearchResult(MlProductVisionSearchSettings settings)Creates the analyzer, analyzes the current frame, returns the result.
Future<String>stopAnalyzer()Stops the analyzer.

Data Types

MlProductVisionSearch
PropertiesTypeDescription
typeStringObtains the product type.
borderMlBorderObtains the axis-aligned bounding rectangle of an object.
productListProductListObtains the product list.
MlProductVisionSearchSettings
PropertiesTypeDescription
pathStringSets the image path.
largestNumberOfReturnsintSets the max return count.
regionintSets the region.
ProductList
PropertiesTypeDescription
possibilitydynamicObtains the result confident.
productIdStringObtains the product id.
imageListImageListObtains the image list.
ImageList
PropertiesTypeDescription
possibilitydynamicObtains the result confident.
productIdStringObtains the product id.
imageIdStringObtains the image id.
ProductVisionRegion
PropertiesTypevalueDescription
REGION_DR_UNKNOWNint1001Unknown region.
REGION_DR_CHINAint1002China region.
REGION_DR_AFILAint1003Asia, Africa and Latin America regions.
REGION_DR_EUROPEint1004Europe region.
REGION_DR_RUSSIAint1005Russia region.

MlFaceClient #

Methods

Return TypeMethodDescription
Future<MlFace>getDefaultFaceAnalyzeInformation(String path)Creates analyzer with default parameters and return the result.
Future<MlFace>getAsyncAnalyzeInformation(MlFaceSettings settings)Creates the analyzer, analyzes the frame, returns the result.
Future<List<MlFace>>getAnalyzeFrameInformation(String path)Returns result by using analyze frame.
Future<MlFaceAnalyzer>getAnalyzerInfo()Returns analyzer info.
Future<String>closeAnalyzer()Closes the analyzer.

Data Types

MlFace
PropertiesTypeDescription
opennessOfLeftEyedynamicObtains openness of the left eye.
opennessOfRightEyedynamicObtains openness of the right eye.
tracingIdentitydynamicObtains tracing identity.
possibilityOfSmilingdynamicObtains possibility of smiling.
rotationAngleXdynamicObtains the rotation angle X.
rotationAngleYdynamicObtains the rotation angle Y.
rotationAngleZdynamicObtains the rotation angle Z.
widthdynamicObtains the width.
heightdynamicObtains the height.
borderMlBorderObtains the axis-aligned bounding rectangle of an object.
allPointsAllPointsObtains all key position points of a complete face shape. A total of 855 points are included.
keyPointsKeyPointsObtains all 12 facial key-points.
faceShapeListFaceShapeListObtains all 14 key facial shapes.
featuresFeaturesObtains all facial features.
emotionsEmotionsObtains all facial expressions.
MlFaceSettings
PropertiesTypeDescription
pathStringSets the image path.
keyPointTypeintSets the key point type.
featureTypeintSets the feature type.
shapeTypeintSets the shape type.
performanceTypeintSets the performance type.
tracingAllowedboolSets to tracing allowed true or not.
MlFaceAnalyzer
PropertiesTypeDescription
isAvailableboolChecks whether the analyzer is available.
MlFacePerformanceType
PropertiesTypevalueDescription
TYPE_PRECISIONint1Sets the speed and precision of the detector.
TYPE_SPEEDint2Sets the speed and precision of the detector.
AllPoints
PropertiesTypeDescription
xdynamicObtains x points.
ydynamicObtains y points.
KeyPoints
PropertiesTypeDescription
typeintObtains the key point type.
pointsPointsObtains the points.
coordinatePointMlCoordinatePointsObtains coordinates of points.
Points
PropertiesTypeDescription
xdynamicObtains the x value of point.
ydynamicObtains the y value of point.
zdynamicObtains the z value of point.
FaceShapeList
PropertiesTypeDescription
faceShapeTypeintObtains the face shape type.
pointsPointsObtains the points.
Features
PropertiesTypeDescription
sunGlassProbabilitydynamicObtains sun glasses wearing probability.
sexProbabilitydynamicObtains the sex probability.
rightEyeOpenProbabilitydynamicObtains the right eye open probability.
leftEyeOpenProbabilitydynamicObtains the left eye open probability.
moustacheProbabilitydynamicObtains the moustache probability.
hatProbabilitydynamicObtains the hat wearing probability.
ageintObtains age.
Emotions
PropertiesTypeDescription
surpriseProbabilitydynamicObtains surprise probability.
smilingProbabilitydynamicObtains smiling probability.
sadProbabilitydynamicObtains sad probability.
neutralProbabilitydynamicObtains neutral probability.
fearProbabilitydynamicObtains fear probability.
disgustProbabilitydynamicObtains disgust probability.
angryProbabilitydynamicObtains angry probability.

MlPermissionClient #

Methods

Return TypeMethodDescription
Future<bool>checkCameraPermission()Checks if camera permission is granted or not.
Future<bool>checkInternetPermission()Checks if internet permission is granted or not.
Future<bool>checkWriteExternalStoragePermission()Checks if write external storage permission is granted or not.
Future<bool>checkReadExternalStoragePermission()Checks if read external storage permission is granted or not.
Future<bool>checkRecordAudioPermission()Checks if record audio permission is granted or not.
Future<bool>checkAccessNetworkStatePermission()Checks if access network state permission is granted or not.
Future<bool>checkAccessWifiStatePermission()Checks if record access wifi state permission is granted or not.
FuturerequestCameraPermission()Requests camera permission.
FuturerequestInternetPermission()Requests internet permission.
FuturerequestStoragePermission()Requests storage permission.
FuturerequestRecordAudioPermission()Requests record audio permission.
FuturerequestConnectionStatePermission()Requests connection state permission.

Common Classes #

MlBorder
PropertiesTypeDescription
bottomdynamicObtains the bottom value.
topdynamicObtains the top value.
leftdynamicObtains the left value.
rightdynamicObtains the right value.
exactCenterXdynamicObtains the exactCenterX value.
centerXdynamicObtains the centerX value.
centerYdynamicObtains the centerY value.
describeContentsdynamicObtains the describeContents value.
heightdynamicObtains the height
widthdynamicObtains the width
CardOrientation
PropertiesTypeValueDescription
ORIENTATION_AUTOint0Auto orientation
ORIENTATION_LANDSCAPEint1Landscape
ORIENTATION_PORTRAITint2Portrait
MlTextBorderType
PropertiesTypeValueDescription
ARCStringARCReturn the corner points of a polygon border in an arc.
NGONStringNGONReturn the coordinates of the four corner points of the quadrilateral.
MlCoordinatePoints
PropertiesTypeDescription
xdynamicObtains the x point
ydynamicObtains the y point
describeContentsdynamicObtains describe contents value

Configuration Description #

No

Licensing And Terms #

Huawei ML Kit Flutter Plugin uses the Apache 2.0 license.

1
likes
80
pub points
33%
popularity

Publisher

developer.huawei.com

HUAWEI Ml Kit plugin for Flutter. It provides diversified leading machine learning capabilities that are easy to use, helping you develop various AI apps.

Homepage
Repository (GitHub)
View/report issues

Documentation

API reference

License

Apache 2.0 (LICENSE)

Dependencies

flutter

More

Packages that depend on huawei_ml