DetectFaces procedure

Official Content
This documentation is valid for:

Detects faces that appear in an image.

Parameters

x

Configuration

The following table resumes the configuration properties that you must set before calling this AI task.

Property Google Cloud AI IBM Watson Microsoft Azure SAP Leonardo
Key For Cloud Vision API For Visual Recognition For Computer Vision -

Sample

Taking the following image input, the table below shows how faces are identified for each provider (as a JSON structure) and the time it takes for processing it.

GeneXusAI - Image module - Sample

Provider Output Benchmark
Google Cloud AI
[{
    "label": "",
    "confidence": 0.9711827,
    "top": 499,
    "left": 517,
    "width": 181,
    "height": 210,
    "Info": [{
            "property": "Angle",
            "value": "-3.24046"
        }, {
            "property": "PanAngle",
            "value": "0.92209"
        }, {
            "property": "TitlAngle",
            "value": "4.52504"
        }, {
            "property": "LandmarkingConfidence",
            "value": "0.46889"
        }, {
            "property": "left_eye",
            "value": "{\"x\":580.1488,\"y\":592.61914,\"z\":-0.0009537811}"
        }, {
            "property": "right_eye",
            "value": "{\"x\":634.6278,\"y\":589.59705,\"z\":0.87478584}"
        }, {
        ...
        }, {
            "property": "chin_left_gonion",
            "value": "{\"x\":554.4516,\"y\":659.24805,\"z\":39.453327}"
        }, {
            "property": "chin_right_gonion",
            "value": "{\"x\":666.07837,\"y\":653.048,\"z\":41.252846}"
        }
    ]
}]

GeneXusAI - Google - DetectFaces
929ms
IBM Watson
[{
    "label": "MALE",
    "confidence": 0.903327775,
    "top": 556,
    "left": 537,
    "width": 127,
    "height": 145,
    "Info": [{
        "property": "Gender",
        "value": "MALE"
    }, {
        "property": "Gender Score",
        "value": "0.90615"
    }, {
        "property": "Age Min",
        "value": "26.00000"
    }, {
        "property": "Age Max",
        "value": "29.00000"
    }, {
        "property": "Age Score",
        "value": "0.90051"
    }]
}]
GeneXusAI - IBM - DetectFaces
8682ms
Microsoft Azure
[{
    "label": "Male",
    "confidence": 1.0,
    "top": 545,
    "left": 539,
    "width": 133,
    "height": 133,
    "Info": [{
        "property": "Age",
        "value": "33.00000"
    },
    {
        "property": "Gender",
        "value": "Male"
    }]
}]
GeneXusAI - Microsoft - DetectFaces
3412ms
SAP Leonardo
[{
    "label": "Face 1",
    "confidence": 1.0,
    "top": 555,
    "left": 540,
    "width": 129,
    "height": 129
}]
GeneXusAI - SAP - DetectFaces
17681ms

Notes

  • The label assigned for a face depends on the provider used. Additional information can be found on the OutputRegion.Info field if it is given by the provider.
  • Maximum image file size is 10MB.
  • GeneXusAI does not provide support for drawing a rectangle over an image. This action is the responsibility of the developer.
    TIP: For Web applications, a good alternative can be combining HTML5 Canvas control with JavaScript with User Control object. On the other hand, for Smart Devices you could use Image Map control on which you can set the processed image as background and 'draw' square regions (i.e. set a border color on the table item of the grid).

Scope

Platforms Web(.NET,.NETCore,Java), SmartDevices(Android,iOS)
Connectivity Online

Availability

This procedure is available as of GeneXus 16.

Was this page helpful?
What Is This?
Your feedback about this content is important. Let us know what you think.