Skip to main content
Version: 3.20.2

Flutter Processing Block sample

The sample demonstrates Face SDK plugin for Flutter and includes the following features:

  • Face detection in an image
  • Image quality assessment

Requirements

  • Flutter 3.3.0 ≤ versions ≤ 3.16.3
  • Dart 2.17.0 ≤ versions ≤ 3.2.3
  • Android Studio for Android or XCode for iOS
  • Android or iOS device

Start a sample

  1. To run the sample, install the "flutter" component using the Face SDK installer or the maintenancetool utility:

    • If Face SDK is not installed, follow the installation instructions in Getting Started. You must select the "flutter" component in the "Select Components" section.

    • If the Face SDK is installed without the "flutter " component (the flutter directory is not in the root directory of the Face SDK), use the maintenancetool utility and install the "flutter" component, by selecting it in the "Select Components" section.

  2. Connect your Android or iOS device to your computer.

  3. Run the script examples/flutter/scripts/processing_block.sh or examples/flutter/scripts/processing_block.bat.

  4. Copy the lib folder from the flutter directory to examples/flutter/processing_block_demo/assets.

  5. Build and run the sample using the console or via Android Studio (see below).

Run from Console

To run the sample from the console, go to the examples/flutter/processing_block_demo directory and execute the commands:

flutter pub get
flutter pub upgrade
flutter run
Troubleshooting
  • Use a stable version of Flutter at least 3.3.0. To select and download a distribution Flutter for your OS, follow this link.

  • Add the path to the bin directory of the Flutter distribution to the PATH environment variable. Instructions for adding an environment variable for Linux and macOS is available here, for Windows - here.

Run via Android Studio

  • Open the examples/flutter/processing_block_demo folder in Android Studio.
  • In Android Studio:
    • Open the processing_block_demo/pubspec.yaml file and click the "Pub get" button.
    • Click "Run" button.
Troubleshooting
  • Use a stable version of Flutter at least 3.3.0. Use a stable version of Flutter at least 3.3.0. To select and download a distribution Flutter for your OS, follow this link.

  • Specify the path to the Flutter distribution in the Android Studio settings: "File" > "Settings" > "Languages & Frameworks" > "Flutter".

  • Install the Flutter and Dart plugins in Android Studio. The list of installed plugins and the Marketplace for installing them are available in Android Studio settings: "File" > "Settings" > "Plugins".

Function Description

After the sample is launched, you'll see the start screen and a button with image selection from the gallery on the device screen. You need to wait until the end of initialization and press the gallery image selection button to enter the image quality evaluation mode.

Image Selection

The gallery opens to select an image.

Image Quality Assessment

After selecting an image, faces in this image will be detected with quality assessment for each face.