aws_ai 0.0.1

  • README.md
  • CHANGELOG.md
  • Installing
  • Versions
  • 41

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 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.

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] - 20 OCT 2018.

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

Use this package as a library

1. Depend on it

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


dependencies:
  aws_ai: ^0.0.1

2. Install it

You can install packages from the command line:

with pub:


$ pub get

with Flutter:


$ flutter packages get

Alternatively, your editor might support pub get or 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]
53
Health:
Code health derived from static analysis. [more]
9
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
60
Overall:
Weighted score of the above. [more]
41
Learn more about scoring.

We analyzed this package on May 8, 2019, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.3.0
  • pana: 0.12.15
  • Flutter: 1.5.8

Platforms

Detected platforms:

Low code quality prevents platform classification.

Health issues and suggestions

Fix lib/src/Signature.dart. (-89.99 points)

Analysis of lib/src/Signature.dart failed with 8 errors, including:

line 4 col 8: Target of URI doesn't exist: 'package:crypto/crypto.dart'.

line 5 col 8: Target of URI doesn't exist: 'package:crypto/src/digest_sink.dart'.

line 121 col 26: Undefined class 'Hmac'.

line 121 col 31: Undefined name 'sha256'.

line 146 col 18: Undefined class 'DigestSink'.

Document public APIs. (-1 points)

9 out of 9 API elements have no dartdoc comment.Providing good documentation for libraries, classes, functions, and other API elements improves code readability and helps developers find and use your API.

Format lib/aws_ai.dart.

Run flutter format to format lib/aws_ai.dart.

Format lib/src/RekognitionHandler.dart.

Run flutter format to format lib/src/RekognitionHandler.dart.

Maintenance issues and suggestions

Fix platform conflicts. (-20 points)

Low code quality prevents platform classification.

Maintain an example. (-10 points)

Create a short demo in the example/ directory to show how to use this package.

Common filename patterns include main.dart, example.dart, and aws_ai.dart. Packages with multiple examples should provide example/README.md.

For more information see the pub package layout conventions.

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

While nothing is inherently wrong with versions of 0.0.*, it might mean 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.2.0
flutter 0.0.0
http ^0.11.3+17 0.11.3+17 0.12.0+2
intl ^0.15.7 0.15.8
path ^1.6.2 1.6.2
Transitive dependencies
charcode 1.1.2
collection 1.14.11
http_parser 3.1.3
meta 1.1.6 1.1.7
sky_engine 0.0.99
source_span 1.5.5
string_scanner 1.0.4
term_glyph 1.1.0
typed_data 1.1.6
vector_math 2.0.8
Dev dependencies
flutter_test