Copyright | (c) 2013-2018 Brendan Hay |
---|---|
License | Mozilla Public License, v. 2.0. |
Maintainer | Brendan Hay <brendan.g.hay+amazonka@gmail.com> |
Stability | auto-generated |
Portability | non-portable (GHC extensions) |
Safe Haskell | None |
Language | Haskell2010 |
Detects instances of real-world entities within an image (JPEG or PNG) provided as input. This includes objects like flower, tree, and table; events like wedding, graduation, and birthday party; and concepts like landscape, evening, and nature. For an example, see 'images-s3' .
You pass the input image as base64-encoded image bytes or as a reference to an image in an Amazon S3 bucket. If you use the Amazon CLI to call Amazon Rekognition operations, passing image bytes is not supported. The image must be either a PNG or JPEG formatted file.
For each object, scene, and concept the API returns one or more labels. Each label provides the object name, and the level of confidence that the image contains the object. For example, suppose the input image has a lighthouse, the sea, and a rock. The response will include all three labels, one for each object.
{Name: lighthouse, Confidence: 98.4629}
{Name: rock,Confidence: 79.2097}
{Name: sea,Confidence: 75.061}
In the preceding example, the operation returns one label for each of the three objects. The operation can also return multiple labels for the same object in the image. For example, if the input image shows a flower (for example, a tulip), the operation might return the following three labels.
{Name: flower,Confidence: 99.0562}
{Name: plant,Confidence: 99.0562}
{Name: tulip,Confidence: 99.0562}
In this example, the detection algorithm more precisely identifies the flower as a tulip.
In response, the API returns an array of labels. In addition, the response also includes the orientation correction. Optionally, you can specify MinConfidence
to control the confidence threshold for the labels returned. The default is 50%. You can also add the MaxLabels
parameter to limit the number of labels returned.
This is a stateless API operation. That is, the operation does not persist any data.
This operation requires permissions to perform the rekognition:DetectLabels
action.
- detectLabels :: Image -> DetectLabels
- data DetectLabels
- dlMinConfidence :: Lens' DetectLabels (Maybe Double)
- dlMaxLabels :: Lens' DetectLabels (Maybe Natural)
- dlImage :: Lens' DetectLabels Image
- detectLabelsResponse :: Int -> DetectLabelsResponse
- data DetectLabelsResponse
- dlrsLabels :: Lens' DetectLabelsResponse [Label]
- dlrsOrientationCorrection :: Lens' DetectLabelsResponse (Maybe OrientationCorrection)
- dlrsResponseStatus :: Lens' DetectLabelsResponse Int
Creating a Request
:: Image | |
-> DetectLabels |
Creates a value of DetectLabels
with the minimum fields required to make a request.
Use one of the following lenses to modify other fields as desired:
dlMinConfidence
- Specifies the minimum confidence level for the labels to return. Amazon Rekognition doesn't return any labels with confidence lower than this specified value. IfMinConfidence
is not specified, the operation returns labels with a confidence values greater than or equal to 50 percent.dlMaxLabels
- Maximum number of labels you want the service to return in the response. The service returns the specified number of highest confidence labels.dlImage
- The input image as base64-encoded bytes or an S3 object. If you use the AWS CLI to call Amazon Rekognition operations, passing base64-encoded image bytes is not supported.
data DetectLabels Source #
See: detectLabels
smart constructor.
Request Lenses
dlMinConfidence :: Lens' DetectLabels (Maybe Double) Source #
Specifies the minimum confidence level for the labels to return. Amazon Rekognition doesn't return any labels with confidence lower than this specified value. If MinConfidence
is not specified, the operation returns labels with a confidence values greater than or equal to 50 percent.
dlMaxLabels :: Lens' DetectLabels (Maybe Natural) Source #
Maximum number of labels you want the service to return in the response. The service returns the specified number of highest confidence labels.
dlImage :: Lens' DetectLabels Image Source #
The input image as base64-encoded bytes or an S3 object. If you use the AWS CLI to call Amazon Rekognition operations, passing base64-encoded image bytes is not supported.
Destructuring the Response
Creates a value of DetectLabelsResponse
with the minimum fields required to make a request.
Use one of the following lenses to modify other fields as desired:
dlrsLabels
- An array of labels for the real-world objects detected.dlrsOrientationCorrection
- The orientation of the input image (counter-clockwise direction). If your application displays the image, you can use this value to correct the orientation. If Amazon Rekognition detects that the input image was rotated (for example, by 90 degrees), it first corrects the orientation before detecting the labels.dlrsResponseStatus
- -- | The response status code.
data DetectLabelsResponse Source #
See: detectLabelsResponse
smart constructor.
Response Lenses
dlrsLabels :: Lens' DetectLabelsResponse [Label] Source #
An array of labels for the real-world objects detected.
dlrsOrientationCorrection :: Lens' DetectLabelsResponse (Maybe OrientationCorrection) Source #
The orientation of the input image (counter-clockwise direction). If your application displays the image, you can use this value to correct the orientation. If Amazon Rekognition detects that the input image was rotated (for example, by 90 degrees), it first corrects the orientation before detecting the labels.
dlrsResponseStatus :: Lens' DetectLabelsResponse Int Source #
- - | The response status code.