aws_ai 0.0.3

  • README.md
  • CHANGELOG.md
  • Example
  • Installing
  • Versions
  • 48

aws_ai

Flutter package to wrap Amazon artificial intelligence (AI) services, which provide flutter community developers with the ability to add intelligence to their applications through an API call to pre-trained services rather than developing and training their own models. Amazon AI services are :

  • Amazon Rekognition : built on technology used by Amazon Prime Photos to analyze billions of images daily, is a service that makes it easy to add image analysis to your applications. With Rekognition, you can detect objects, scenes, and faces in images, as well as search and compare faces between images.
  • Amazon Translate : a neural machine translation service that delivers fast, high-quality, and affordable language translation.
  • Amazon Polly (still not implemented): a service that turns text into lifelike speech. Polly lets you create applications that speak in over two dozen languages with a wide variety of natural sounding male and female voices to enable you to build entirely new categories of speech-enabled products.
  • Amazon Lex (still not implemented) : uses the same technology as Amazon Alexa to provide advanced deep learning functionalities of automatic speech recognition (ASR) and natural language understanding (NLU) to enable you to build applications with conversational interfaces, commonly called chatbots.

Translate

Sample Code

import 'package:aws_ai/src/TranslateHandler.dart';

TranslateHandler translate = new TranslateHandler(accessKey, secretKey, region); 
String output = await translate.translate(Languages.auto, Languages.fr, "اسمي محمد");

Output will be a String contains JSON object with below format

{
   "SourceLanguageCode": "string",
   "TargetLanguageCode": "string",
   "TranslatedText": "string"
}

"TranslatedText" will be in UTF8 format.

Rekognition

  • Face comparison (compareFaces)

    Sample Code
import 'package:aws_ai/src/RekognitionHandler.dart';

File sourceImagefile, targetImagefile; //load source and target images in those File objects
String accessKey, secretKey, region ; //load your aws account info in those variables

RekognitionHandler rekognition = new RekognitionHandler(accessKey, secretKey, region); 
Future<String> labelsArray = rekognition.compareFaces(sourceImagefile, targetImagefile);

Output will be a String contains JSON object with below format

{
 "FaceMatches": [
    {
       "Face": {
          "BoundingBox": {
             "Height": "number",
             "Left": "number",
             "Top": "number",
             "Width": "number"
          },
          "Confidence": "number",
          "Landmarks": [
             {
                "Type": "string",
                "X": "number",
                "Y": "number"
             }
          ],
          "Pose": {
             "Pitch": "number",
             "Roll": "number",
             "Yaw": "number"
          },
          "Quality": {
             "Brightness": "number",
             "Sharpness": "number"
          }
       },
       "Similarity": "number"
    }
 ],
 "SourceImageFace": {
    "BoundingBox": {
       "Height": "number",
       "Left": "number",
       "Top": "number",
       "Width": "number"
    },
    "Confidence": "number"
 },
 "SourceImageOrientationCorrection": "string",
 "TargetImageOrientationCorrection": "string",
 "UnmatchedFaces": [
    {
       "BoundingBox": {
          "Height": "number",
          "Left": "number",
          "Top": "number",
          "Width": "number"
       },
       "Confidence": "number",
       "Landmarks": [
          {
             "Type": "string",
             "X": "number",
             "Y": "number"
          }
       ],
       "Pose": {
          "Pitch": "number",
          "Roll": "number",
          "Yaw": "number"
       },
       "Quality": {
          "Brightness": "number",
          "Sharpness": "number"
       }
    }
 ]
}
  • Facial analysis (detectFaces)

    Sample Code
import 'package:aws_ai/src/RekognitionHandler.dart';

File sourceImagefile; //load source image in this File object
String accessKey, secretKey, region ; //load your aws account info in those variables

RekognitionHandler rekognition = new RekognitionHandler(accessKey, secretKey, region);
Future<String> labelsArray = rekognition.detectFaces(sourceImagefile);

Output will be a String contains JSON object with below format

{
 "FaceDetails": [
    {
       "AgeRange": {
          "High": "number",
          "Low": "number"
       },
       "Beard": {
          "Confidence": "number",
          "Value": "boolean"
       },
       "BoundingBox": {
          "Height": "number",
          "Left": "number",
          "Top": "number",
          "Width": "number"
       },
       "Confidence": "number",
       "Emotions": [
          {
             "Confidence": "number",
             "Type": "string"
          }
       ],
       "Eyeglasses": {
          "Confidence": "number",
          "Value": "boolean"
       },
       "EyesOpen": {
          "Confidence": "number",
          "Value": "boolean"
       },
       "Gender": {
          "Confidence": "number",
          "Value": "string"
       },
       "Landmarks": [
          {
             "Type": "string",
             "X": "number",
             "Y": "number"
          }
       ],
       "MouthOpen": {
          "Confidence": "number",
          "Value": "boolean"
       },
       "Mustache": {
          "Confidence": "number",
          "Value": "boolean"
       },
       "Pose": {
          "Pitch": "number",
          "Roll": "number",
          "Yaw": "number"
       },
       "Quality": {
          "Brightness": "number",
          "Sharpness": "number"
       },
       "Smile": {
          "Confidence": "number",
          "Value": "boolean"
       },
       "Sunglasses": {
          "Confidence": "number",
          "Value": "boolean"
       }
    }
 ],
 "OrientationCorrection": "string"
}
  • Unsafe image detection (detectModerationLabels)

    Sample Code
import 'package:aws_ai/src/RekognitionHandler.dart';

File sourceImagefile; //load source image in this File object
String accessKey, secretKey, region ; //load your aws account info in those variables

RekognitionHandler rekognition = new RekognitionHandler(accessKey, secretKey, region);
Future<String> labelsArray = rekognition.detectModerationLabels(sourceImagefile);

Output will be a String contains JSON object with below format

{
 "ModerationLabels": [
    {
       "Confidence": "number",
       "Name": "string",
       "ParentName": "string"
    }
 ]
}
  • Celebrity recognition (recognizeCelebrities)

    Sample Code
import 'package:aws_ai/src/RekognitionHandler.dart';

File sourceImagefile; //load source image in this File object
String accessKey, secretKey, region ; //load your aws account info in those variables

RekognitionHandler rekognition = new RekognitionHandler(accessKey, secretKey, region);
Future<String> labelsArray = rekognition.recognizeCelebrities(sourceImagefile);

Output will be a String contains JSON object with below format

{
    "CelebrityFaces": [
      {
         "Face": {
            "BoundingBox": {
               "Height": "number",
               "Left": "number",
               "Top": "number",
               "Width": "number"
            },
            "Confidence": "number",
            "Landmarks": [
               {
                  "Type": "string",
                  "X": "number",
                  "Y": "number"
               }
            ],
            "Pose": {
               "Pitch": "number",
               "Roll": "number",
               "Yaw": "number"
            },
            "Quality": {
               "Brightness": "number",
               "Sharpness": "number"
            }
         },
         "Id": "string",
         "MatchConfidence": "number",
         "Name": "string",
         "Urls": [ "string" ]
      }
    ],
    "OrientationCorrection": "string",
    "UnrecognizedFaces": [
      {
         "BoundingBox": {
            "Height": "number",
            "Left": "number",
            "Top": "number",
            "Width": "number"
         },
         "Confidence": "number",
         "Landmarks": [
            {
               "Type": "string",
               "X": "number",
               "Y": "number"
            }
         ],
         "Pose": {
            "Pitch": "number",
            "Roll": "number",
            "Yaw": "number"
         },
         "Quality": {
            "Brightness": "number",
            "Sharpness": "number"
         }
      }
    ]
    }
  • Text in image (detectText)

    Sample Code
import 'package:aws_ai/src/RekognitionHandler.dart';

File sourceImagefile; //load source image in this File object
String accessKey, secretKey, region ; //load your aws account info in those variables

RekognitionHandler rekognition = new RekognitionHandler(accessKey, secretKey, region);
Future<String> labelsArray = rekognition.detectText(sourceImagefile);

Output will be a String contains JSON object with below format

{
 "TextDetections": [
    {
       "Confidence": "number",
       "DetectedText": "string",
       "Geometry": {
          "BoundingBox": {
             "Height": "number",
             "Left": "number",
             "Top": "number",
             "Width": "number"
          },
          "Polygon": [
             {
                "X": "number",
                "Y": "number"
             }
          ]
       },
       "Id": "number",
       "ParentId": "number",
       "Type": "string"
    }
 ]
}
  • Object and scene detection (detectLabels)

    Sample Code
import 'package:aws_ai/src/RekognitionHandler.dart';

File sourceImagefile; //load source image in this File object
String accessKey, secretKey, region ; //load your aws account info in those variables

RekognitionHandler rekognition = new RekognitionHandler(accessKey, secretKey, region);
Future<String> labelsArray = rekognition.detectLabels(sourceImagefile);

Output will be a String contains JSON object with below format

{
 "Labels": [
    {
       "Confidence": "number",
       "Name": "string"
    }
 ],
 "OrientationCorrection": "string"
}

[0.0.1] - 16 OCT 2018.

  • Initial Open Source release.
  • Support many AWS Rekognition APIs :
  • compareFaces
  • detectFaces
  • detectModerationLabels
  • recognizeCelebrities
  • detectText
  • detectLabels

[0.0.3] - 18 OCT 2018.

  • Support AWS Translate API

example/example.dart

import 'package:aws_ai/src/RekognitionHandler.dart';
import 'package:aws_ai/src/TranslateHandler.dart';
import 'dart:async';
import 'dart:io';

main() async {

  File sourceImagefile; //load source image in this File object
  String  accessKey = "",
          secretKey = "",
          region    = "" ;

  RekognitionHandler rekognition = new RekognitionHandler(accessKey, secretKey, region);
  String labelsArray = await rekognition.detectLabels(sourceImagefile);
  print(labelsArray);



  TranslateHandler translate = new TranslateHandler(accessKey, secretKey, region);
  String output = await translate.translate(Languages.ar, Languages.en, "اسمي محمد");
  print(output);
}

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:


dependencies:
  aws_ai: ^0.0.3

2. Install it

You can install packages from the command line:

with Flutter:


$ flutter packages get

Alternatively, your editor might support flutter packages get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:


import 'package:aws_ai/aws_ai.dart';
  
Version Uploaded Documentation Archive
0.0.3 Oct 18, 2018 Go to the documentation of aws_ai 0.0.3 Download aws_ai 0.0.3 archive
0.0.2 Oct 17, 2018 Go to the documentation of aws_ai 0.0.2 Download aws_ai 0.0.2 archive
0.0.1 Oct 16, 2018 Go to the documentation of aws_ai 0.0.1 Download aws_ai 0.0.1 archive
Popularity:
Describes how popular the package is relative to other packages. [more]
0
Health:
Code health derived from static analysis. [more]
100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
90
Overall:
Weighted score of the above. [more]
48
Learn more about scoring.

We analyzed this package on Nov 14, 2018, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.0.0
  • pana: 0.12.6
  • Flutter: 0.11.3

Platforms

Detected platforms: Flutter

References Flutter, and has no conflicting libraries.

Maintenance suggestions

Package is pre-v0.1 release. (-10 points)

While there is nothing inherently wrong with versions of 0.0.*, it usually means that the author is still experimenting with the general direction of the API.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.0.0-dev.68.0 <3.0.0
async ^2.0.8 2.0.8
crypto ^2.0.6 2.0.6
flutter 0.0.0
http ^0.11.3+17 0.11.3+17 0.12.0
intl ^0.15.7 0.15.7
path ^1.6.2 1.6.2
Transitive dependencies
charcode 1.1.2
collection 1.14.11
convert 2.0.2
http_parser 3.1.3
meta 1.1.6
sky_engine 0.0.99
source_span 1.4.1
string_scanner 1.0.4
typed_data 1.1.6
vector_math 2.0.8
Dev dependencies
flutter_test