Official Content

Detects faces that appear in an image.

Parameters

x

Configuration

The following table resumes the configuration properties (access credentials) you must set in order to use this AI task.

  PropertyKey
ProviderType Id Key SecretKey
Alibaba - 用户AccessKey 用户AccessKey
Amazon - Rekognition Rekognition
Baidu 视觉技术 视觉技术 视觉技术
Google - Cloud Vision API -
IBM - Visual Recognition
(deprecated)
-
Microsoft - Computer Vision -
MLKit ML Kit API ML Kit API -
SAP - Sandbox Environment
(deprecated)
-
Tencent 人脸检测与分析 人脸检测与分析 -

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
Alibaba
[{
	"label": "Face 1",
	"confidence": 1,
	"top": 432,
	"left": 445,
	"width": 93,
	"height": 129,
	"Info": [{
		"property": "EYEBROWS",
		"value": "[447.48,477.98,483.71,...,473.37]"
	}, {
		"property": "EYE",
		"value": "[498.56,467.67,528.86,...,476.46]"
	}, {
		"property": "NOSE",
		"value": "[462.70,475.86,465.71,...,474.96]"
	}, {
		"property": "MOUTH",
		"value": "[471.77,475.37,474.31,...,474.75]"
	}, {
		"property": "OUTER CONTOURS",
		"value": "[520.32,476.36,506.19,...,513.40]"
	}, {
		"property": "IRIS",
		"value": "[469.08,480.30,4.32,...,4.32]"
	}]
}]


GeneXusAI - Alibaba - DetectFaces
12956ms
Amazon
[{
    "label": "Female",
    "confidence": 0.999,
    "top": 433,
    "left": 453,
    "width": 92,
    "height": 131,
    "Info": [{
            "property": "Chinbottom",
            "value": "{
                'X': 0.58294,
                'Y': 0.65531
            }"
        }, {
            "property": "Eyeleft",
            "value": "{
                'X': 0.55245,
                'Y': 0.56365
            }"
        }, {
            "property": "Eyeright",
            "value": "{
                'X': 0.60476,
                'Y': 0.56093
            }"
        }, {
            "property": "Lefteyebrowleft",
            "value": "{
                'X': 0.53189,
                'Y': 0.55226
            }"
        }, {
            "property": "Lefteyebrowright",
            "value": "{
                'X': 0.56244,
                'Y': 0.54663
            }"
        }, {
            "property": "Lefteyebrowup",
            "value": "{
                'X': 0.54712,
                'Y': 0.54475
            }"
        }, {
            "property": "Lefteyedown",
            "value": "{
                'X': 0.55310,
                'Y': 0.56589
            }"
        }, {
            "property": "Lefteyeleft",
            "value": "{
                'X': 0.54364,
                'Y': 0.56383
            }"
        }, {
            "property": "Lefteyeright",
            "value": "{
                'X': 0.56287,
                'Y': 0.56350
            }"
        }, {
            "property": "Lefteyeup",
            "value": "{
                'X': 0.55249,
                'Y': 0.56091
            }"
        }, {
            "property": "Leftpupil",
            "value": "{
                'X': 0.55245,
                'Y': 0.56365
            }"
        }, {
            "property": "Midjawlineleft",
            "value": "{
                'X': 0.53448,
                'Y': 0.62530
            }"
        }, {
            "property": "Midjawlineright",
            "value": "{
                'X': 0.62797,
                'Y': 0.62041
            }"
        }, {
            "property": "Mouthdown",
            "value": "{
                'X': 0.58155,
                'Y': 0.62675
            }"
        }, {
            "property": "Mouthleft",
            "value": "{
                'X': 0.55958,
                'Y': 0.61821
            }"
        }, {
            "property": "Mouthright",
            "value": "{
                'X': 0.60299,
                'Y': 0.61592
            }"
        }, {
            "property": "Mouthup",
            "value": "{
                'X': 0.58079,
                'Y': 0.61035
            }"
        }, {
            "property": "Nose",
            "value": "{
                'X': 0.58007,
                'Y': 0.59092
            }"
        }, {
            "property": "Noseleft",
            "value": "{
                'X': 0.57044,
                'Y': 0.59809
            }"
        }, {
            "property": "Noseright",
            "value": "{
                'X': 0.58980,
                'Y': 0.59679
            }"
        }, {
            "property": "Righteyebrowleft",
            "value": "{
                'X': 0.59317,
                'Y': 0.54503
            }"
        }, {
            "property": "Righteyebrowright",
            "value": "{
                'X': 0.62474,
                'Y': 0.54750
            }"
        }, {
            "property": "Righteyebrowup",
            "value": "{
                'X': 0.60863,
                'Y': 0.54151
            }"
        }, {
            "property": "Righteyedown",
            "value": "{
                'X': 0.60381,
                'Y': 0.56324
            }"
        }, {
            "property": "Righteyeleft",
            "value": "{
                'X': 0.59385,
                'Y': 0.56188
            }"
        }, {
            "property": "Righteyeright",
            "value": "{
                'X': 0.61300,
                'Y': 0.56021
            }"
        }, {
            "property": "Righteyeup",
            "value": "{
                'X': 0.60393,
                'Y': 0.55823
            }"
        }, {
            "property": "Rightpupil",
            "value": "{
                'X': 0.60476,
                'Y': 0.56093
            }"
        }, {
            "property": "Upperjawlineleft",
            "value": "{
                'X': 0.52006,
                'Y': 0.56693
            }"
        }, {
            "property": "Upperjawlineright",
            "value": "{
                'X': 0.63647,
                'Y': 0.56082
            }"
        }, {
            "property": "Gender",
            "value": "Female"
        }, {
            "property": "Gender Score",
            "value": "0.750"
        }, {
            "property": "Age Min",
            "value": "26"
        }, {
            "property": "Age Max",
            "value": "43"
        }, {
            "property": "Beard",
            "value": "false"
        }, {
            "property": "Beard Score",
            "value": "0.995"
        }, {
            "property": "Eyeglasses",
            "value": "false"
        }, {
            "property": "Eyeglasses Score",
            "value": "0.986"
        }, {
            "property": "Eyes Open",
            "value": "true"
        }, {
            "property": "Eyes Open Score",
            "value": "1.000"
        }, {
            "property": "Mouth Open",
            "value": "true"
        }, {
            "property": "Mouth Open Score",
            "value": "0.999"
        }, {
            "property": "Mustache",
            "value": "false"
        }, {
            "property": "Mustache Score",
            "value": "0.999"
        }, {
            "property": "Smile",
            "value": "true"
        }, {
            "property": "Smile Score",
            "value": "0.999"
        }, {
            "property": "Sunglasses",
            "value": "true"
        }, {
            "property": "Sunglasses Score",
            "value": "0.986"
        }, {
            "property": "Emotion Angry",
            "value": "0.03148"
        }, {
            "property": "Emotion Calm",
            "value": "0.04797"
        }, {
            "property": "Emotion Confused",
            "value": "0.00000"
        }, {
            "property": "Emotion Disgusted",
            "value": "0.11313"
        }, {
            "property": "Emotion Happy",
            "value": "0.927"
        }, {
            "property": "Emotion Sad",
            "value": "0.00289"
        }, {
            "property": "Emotion Surprised",
            "value": "6.93511"
        }, {
            "property": "Pose Pitch",
            "value": "-0.20080"
        }, {
            "property": "Pose Roll",
            "value": "-4.16584"
        }, {
            "property": "Pose Yaw",
            "value": "-1.55775"
        }
    ]
}]

GeneXusAI - Amazon - DetectFaces
13358ms
Baidu
[{
	"label": "ae42f274912d3657c3cfa897c8926c6e",
	"confidence": 1,
	"top": 465,
	"left": 445,
	"width": 93,
	"height": 97,
	"Info": [{
		"property": "age",
		"value": "42.00000"
	}, {
		"property": "angle",
		"value": "{\"yaw\":-4.62,\"pitch\":7.57,\"roll\":-5.07}"
	}, {
		"property": "beauty",
		"value": "31.02000"
	}, {
		"property": "emotion",
		"value": "happy"
	}, {
		"property": "emotion_prob",
		"value": "0.96000"
	}, {
		"property": "expression_type",
		"value": "laugh"
	}, {
		"property": "expression_prob",
		"value": "0.79000"
	}, {
		"property": "eye_status_right",
		"value": "0.84000"
	}, {
		"property": "eye_status_left",
		"value": "0.76000"
	}, {
		"property": "face_shape_type",
		"value": "oval"
	}, {
		"property": "face_shape_prob",
		"value": "0.71000"
	}, {
		"property": "face_type",
		"value": "human"
	}, {
		"property": "face_type_prob",
		"value": "1.00000"
	}, {
		"property": "gender_type",
		"value": "male"
	}, {
		"property": "gender_prob",
		"value": "1.00000"
	}, {
		"property": "glasses_type",
		"value": "sun"
	}, {
		"property": "glasses_prob",
		"value": "1.00000"
	}, {
		"property": "landmark",
		"value": "[{\"x\":470.77,\"y\":479.85},{\"x\":513.36,\"y\":478.42},
				  {\"x\":493.39,\"y\":501.79},{\"x\":493.57,\"y\":525.86}]"
	}, {
		"property": "landmark72",
		"value": "[{\"x\":445.58,\"y\":482.51},{\"x\":446.52,\"y\":498.29},
				  ...,{\"x\":481.9,\"y\":530.19}]" // 72 points
	}, {
		"property": "quality_blur",
		"value": "0.00000"
	}, {
		"property": "quality_completness",
		"value": "1.00000"
	}, {
		"property": "quality_illumination",
		"value": "97.00000"
	}, {
		"property": "quality_occlusion",
		"value": "{\"left_eye\":0.97,\"right_eye\":0.99,\"nose\":0.06,
				   \"mouth\":0,\"left_cheek\":0.08,\"right_cheek\":0.03,
				   \"chin_contour\":0}"
	}, {
		"property": "race_type",
		"value": "white"
	}, {
		"property": "race_prob",
		"value": "0.82000"
	}]
}]


GeneXusAI - Baidu - DetectFaces
8777ms
Google
[{
    "label": "Face 1",
    "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
[{
    "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
[{
    "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
MLKit
[{
    "label": "Face 0",
    "confidence": 1,
    "top": 526,
    "left": 525,
    "width": 166,
    "height": 166,
    "Info": [{
            "property": "headEulerAngleY",
            "value": "0.88256"
        }, {
            "property": "headEulerAngleZ",
            "value": "3.53871"
        }, {
            "property": "mouth_bottom",
            "value": "{\"x\":612.50885,\"y\":661.9244,\"z\":0}"
        }, {
            "property": "left_cheek",
            "value": "{\"x\":569.5672,\"y\":628.5785,\"z\":0}"
        }, {
            "property": "left_ear",
            "value": "{\"x\":548.04095,\"y\":618.70416,\"z\":0}"
        }, {
            "property": "left_eye",
            "value": "{\"x\":578.9588,\"y\":593.5154,\"z\":0}"
        }, {
            "property": "mouth_left",
            "value": "{\"x\":583.2742,\"y\":646.3744,\"z\":0}"
        }, {
            "property": "nose_base",
            "value": "{\"x\":609.38715,\"y\":620.6021,\"z\":0}"
        }, {
            "property": "right_cheek",
            "value": "{\"x\":648.24866,\"y\":624.0488,\"z\":0}"
        }, {
            "property": "right_ear",
            "value": "{\"x\":666.8486,\"y\":611.39087,\"z\":0}"
        }, {
            "property": "right_eye",
            "value": "{\"x\":634.9697,\"y\":590.8573,\"z\":0}"
        }, {
            "property": "mouth_right",
            "value": "{\"x\":634.4048,\"y\":644.6298,\"z\":0}"
        }
    ]
}]
GeneXusAI - Microsoft - DetectFaces
1966ms
SAP
[{
    "label": "Face 1",
    "confidence": 1.0,
    "top": 555,
    "left": 540,
    "width": 129,
    "height": 129
}]

GeneXusAI - SAP - DetectFaces
17681ms
Tencent
[{
    "label": "2916682081710921705",
    "confidence": 1,
    "top": 442,
    "left": 432,
    "width": 118,
    "height": 118,
    "Info": [{
            "property": "AGE",
            "value": "0.230"
        }, {
            "property": "GENDER",
            "value": "0.990"
        }, {
            "property": "EXPRESSION",
            "value": "0.970"
        }, {
            "property": "BEAUTY",
            "value": "0.810"
        }, {
            "property": "GLASS",
            "value": "1.0"
        }, {
            "property": "PITCH",
            "value": "2.0"
        }, {
            "property": "YAW",
            "value": "8.0"
        }, {
            "property": "ROLL",
            "value": "0.0"
        }, {
            "property": "FACE PROFILE",
            "value": "[{
            	'x': 449,
            	'y': 477
            }, {
            	'x': 448,
            	'y': 487
            }, {
            	'x': 448,
            	'y': 498
            }, {
            	'x': 449,
            	'y': 508
            }, {
            	'x': 451,
            	'y': 519
            }, {
            	'x': 454,
            	'y': 529
            }, {
            	'x': 459,
            	'y': 538
            }, {
            	'x': 466,
            	'y': 546
            }, {
            	'x': 474,
            	'y': 553
            }, {
            	'x': 483,
            	'y': 558
            }, {
            	'x': 494,
            	'y': 561
            }, {
            	'x': 504,
            	'y': 559
            }, {
            	'x': 513,
            	'y': 554
            }, {
            	'x': 521,
            	'y': 548
            }, {
            	'x': 527,
            	'y': 540
            }, {
            	'x': 533,
            	'y': 532
            }, {
            	'x': 537,
            	'y': 522
            }, {
            	'x': 539,
            	'y': 512
            }, {
            	'x': 541,
            	'y': 502
            }, {
            	'x': 542,
            	'y': 492
            }, {
            	'x': 542,
            	'y': 483
            }]"
        }, {
            "property": "FACE LEFT EYE",
            "value": "[{
            		'x': 476,
            		'y': 483
            	}, {
            		'x': 473,
            		'y': 484
            	}, {
            		'x': 469,
            		'y': 484
            	}, {
            		'x': 465,
            		'y': 483
            	}, {
            		'x': 462,
            		'y': 482
            	}, {
            		'x': 465,
            		'y': 483
            	}, {
            		'x': 469,
            		'y': 483
            	}, {
            		'x': 473,
            		'y': 483
            	}
            ]"
        }, {
            "property": "FACE RIGHT EYE",
            "value": "[{
            		'x': 503,
            		'y': 483
            	}, {
            		'x': 507,
            		'y': 485
            	}, {
            		'x': 512,
            		'y': 485
            	}, {
            		'x': 516,
            		'y': 484
            	}, {
            		'x': 520,
            		'y': 481
            	}, {
            		'x': 516,
            		'y': 479
            	}, {
            		'x': 511,
            		'y': 478
            	}, {
            		'x': 506,
            		'y': 479
            	}
            ]"
        }, {
            "property": "FACE LEFT EYEBROW",
            "value": "[{
            		'x': 450,
            		'y': 477
            	}, {
            		'x': 458,
            		'y': 475
            	}, {
            		'x': 466,
            		'y': 473
            	}, {
            		'x': 474,
            		'y': 471
            	}, {
            		'x': 482,
            		'y': 469
            	}, {
            		'x': 474,
            		'y': 464
            	}, {
            		'x': 464,
            		'y': 464
            	}, {
            		'x': 454,
            		'y': 468
            	}
            ]"
        }, {
            "property": "FACE RIGHT EYEBROW",
            "value": "[{
            		'x': 528,
            		'y': 471
            	}, {
            		'x': 519,
            		'y': 470
            	}, {
            		'x': 511,
            		'y': 470
            	}, {
            		'x': 503,
            		'y': 469
            	}, {
            		'x': 494,
            		'y': 469
            	}, {
            		'x': 502,
            		'y': 463
            	}, {
            		'x': 512,
            		'y': 462
            	}, {
            		'x': 521,
            		'y': 464
            	}
            ]"
        }, {
            "property": "FACE MOUTH",
            "value": "[{
            		'x': 470,
            		'y': 523
            	}, {
            		'x': 476,
            		'y': 530
            	}, {
            		'x': 485,
            		'y': 535
            	}, {
            		'x': 495,
            		'y': 536
            	}, {
            		'x': 504,
            		'y': 534
            	}, {
            		'x': 511,
            		'y': 528
            	}, {
            		'x': 515,
            		'y': 520
            	}, {
            		'x': 508,
            		'y': 516
            	}, {
            		'x': 500,
            		'y': 514
            	}, {
            		'x': 494,
            		'y': 515
            	}, {
            		'x': 487,
            		'y': 514
            	}, {
            		'x': 478,
            		'y': 517
            	}, {
            		'x': 478,
            		'y': 527
            	}, {
            		'x': 486,
            		'y': 529
            	}, {
            		'x': 494,
            		'y': 530
            	}, {
            		'x': 502,
            		'y': 528
            	}, {
            		'x': 509,
            		'y': 525
            	}, {
            		'x': 508,
            		'y': 519
            	}, {
            		'x': 501,
            		'y': 518
            	}, {
            		'x': 494,
            		'y': 518
            	}, {
            		'x': 486,
            		'y': 519
            	}, {
            		'x': 478,
            		'y': 521
            	}
            ]"
        }, {
            "property": "FACE NOSE",
            "value": "[{
            		'x': 494,
            		'y': 502
            	}, {
            		'x': 491,
            		'y': 480
            	}, {
            		'x': 488,
            		'y': 486
            	}, {
            		'x': 486,
            		'y': 491
            	}, {
            		'x': 483,
            		'y': 497
            	}, {
            		'x': 478,
            		'y': 503
            	}, {
            		'x': 486,
            		'y': 507
            	}, {
            		'x': 494,
            		'y': 509
            	}, {
            		'x': 501,
            		'y': 506
            	}, {
            		'x': 508,
            		'y': 501
            	}, {
            		'x': 503,
            		'y': 495
            	}, {
            		'x': 499,
            		'y': 490
            	}, {
            		'x': 495,
            		'y': 485
            	}
            ]"
        }
    ]
}]

GeneXusAI - Tencent - DetectFaces
10026ms

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).
  • IBM provider: Deprecated as of September 12 (2019). Check IBM Visual Recognition's Release Notes.

Scope

Generators: .NET, Java, Android, Apple, Angular
Connectivity: Online

Availability

This procedure is available as of GeneXus 16.



Last update: February 2024 | © GeneXus. All rights reserved. GeneXus Powered by Globant