detectProtectiveEquipment method
- required Image image,
- ProtectiveEquipmentSummarizationAttributes? summarizationAttributes,
Detects Personal Protective Equipment (PPE) worn by people detected in an image. Amazon Rekognition can detect the following types of PPE.
- Face cover
- Hand cover
- Head cover
DetectProtectiveEquipment
detects PPE worn by up to 15
persons detected in an image.
For each person detected in the image the API returns an array of body parts (face, head, left-hand, right-hand). For each body part, an array of detected items of PPE is returned, including an indicator of whether or not the PPE covers the body part. The API returns the confidence it has in each detection (person, PPE, body part and body part coverage). It also returns a bounding box (BoundingBox) for each detected person and each detected item of PPE.
You can optionally request a summary of detected PPE items with the
SummarizationAttributes
input parameter. The summary provides
the following information.
- The persons detected as wearing all of the types of PPE that you specify.
- The persons detected as not wearing all of the types PPE that you specify.
- The persons detected where PPE adornment could not be determined.
This operation requires permissions to perform the
rekognition:DetectProtectiveEquipment
action.
May throw InvalidS3ObjectException. May throw InvalidParameterException. May throw ImageTooLargeException. May throw AccessDeniedException. May throw InternalServerError. May throw ThrottlingException. May throw ProvisionedThroughputExceededException. May throw InvalidImageFormatException.
Parameter image
:
The image in which you want to detect PPE on detected persons. The image
can be passed as image bytes or you can reference an image stored in an
Amazon S3 bucket.
Parameter summarizationAttributes
:
An array of PPE types that you want to summarize.
Implementation
Future<DetectProtectiveEquipmentResponse> detectProtectiveEquipment({
required Image image,
ProtectiveEquipmentSummarizationAttributes? summarizationAttributes,
}) async {
ArgumentError.checkNotNull(image, 'image');
final headers = <String, String>{
'Content-Type': 'application/x-amz-json-1.1',
'X-Amz-Target': 'RekognitionService.DetectProtectiveEquipment'
};
final jsonResponse = await _protocol.send(
method: 'POST',
requestUri: '/',
exceptionFnMap: _exceptionFns,
// TODO queryParams
headers: headers,
payload: {
'Image': image,
if (summarizationAttributes != null)
'SummarizationAttributes': summarizationAttributes,
},
);
return DetectProtectiveEquipmentResponse.fromJson(jsonResponse.body);
}