rekognition

package
v1.10.46-0...-ad2c5a3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 14, 2017 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package rekognition provides the client and types for making API requests to Amazon Rekognition.

This is the Amazon Rekognition API reference.

See rekognition package documentation for more information. https://docs.aws.amazon.com/sdk-for-go/api/service/rekognition/

Using the Client

To Amazon Rekognition with the SDK use the New function to create a new service client. With that client you can make API requests to the service. These clients are safe to use concurrently.

See the SDK's documentation for more information on how to use the SDK. https://docs.aws.amazon.com/sdk-for-go/api/

See aws.Config documentation for more information on configuring SDK clients. https://docs.aws.amazon.com/sdk-for-go/api/aws/#Config

See the Amazon Rekognition client Rekognition for more information on creating client for this service. https://docs.aws.amazon.com/sdk-for-go/api/service/rekognition/#New

Index

Examples

Constants

View Source
const (
	// AttributeDefault is a Attribute enum value
	AttributeDefault = "DEFAULT"

	// AttributeAll is a Attribute enum value
	AttributeAll = "ALL"
)
View Source
const (
	// EmotionNameHappy is a EmotionName enum value
	EmotionNameHappy = "HAPPY"

	// EmotionNameSad is a EmotionName enum value
	EmotionNameSad = "SAD"

	// EmotionNameAngry is a EmotionName enum value
	EmotionNameAngry = "ANGRY"

	// EmotionNameConfused is a EmotionName enum value
	EmotionNameConfused = "CONFUSED"

	// EmotionNameDisgusted is a EmotionName enum value
	EmotionNameDisgusted = "DISGUSTED"

	// EmotionNameSurprised is a EmotionName enum value
	EmotionNameSurprised = "SURPRISED"

	// EmotionNameCalm is a EmotionName enum value
	EmotionNameCalm = "CALM"

	// EmotionNameUnknown is a EmotionName enum value
	EmotionNameUnknown = "UNKNOWN"
)
View Source
const (
	// GenderTypeMale is a GenderType enum value
	GenderTypeMale = "Male"

	// GenderTypeFemale is a GenderType enum value
	GenderTypeFemale = "Female"
)
View Source
const (
	// LandmarkTypeEyeLeft is a LandmarkType enum value
	LandmarkTypeEyeLeft = "eyeLeft"

	// LandmarkTypeEyeRight is a LandmarkType enum value
	LandmarkTypeEyeRight = "eyeRight"

	// LandmarkTypeNose is a LandmarkType enum value
	LandmarkTypeNose = "nose"

	// LandmarkTypeMouthLeft is a LandmarkType enum value
	LandmarkTypeMouthLeft = "mouthLeft"

	// LandmarkTypeMouthRight is a LandmarkType enum value
	LandmarkTypeMouthRight = "mouthRight"

	// LandmarkTypeLeftEyeBrowLeft is a LandmarkType enum value
	LandmarkTypeLeftEyeBrowLeft = "leftEyeBrowLeft"

	// LandmarkTypeLeftEyeBrowRight is a LandmarkType enum value
	LandmarkTypeLeftEyeBrowRight = "leftEyeBrowRight"

	// LandmarkTypeLeftEyeBrowUp is a LandmarkType enum value
	LandmarkTypeLeftEyeBrowUp = "leftEyeBrowUp"

	// LandmarkTypeRightEyeBrowLeft is a LandmarkType enum value
	LandmarkTypeRightEyeBrowLeft = "rightEyeBrowLeft"

	// LandmarkTypeRightEyeBrowRight is a LandmarkType enum value
	LandmarkTypeRightEyeBrowRight = "rightEyeBrowRight"

	// LandmarkTypeRightEyeBrowUp is a LandmarkType enum value
	LandmarkTypeRightEyeBrowUp = "rightEyeBrowUp"

	// LandmarkTypeLeftEyeLeft is a LandmarkType enum value
	LandmarkTypeLeftEyeLeft = "leftEyeLeft"

	// LandmarkTypeLeftEyeRight is a LandmarkType enum value
	LandmarkTypeLeftEyeRight = "leftEyeRight"

	// LandmarkTypeLeftEyeUp is a LandmarkType enum value
	LandmarkTypeLeftEyeUp = "leftEyeUp"

	// LandmarkTypeLeftEyeDown is a LandmarkType enum value
	LandmarkTypeLeftEyeDown = "leftEyeDown"

	// LandmarkTypeRightEyeLeft is a LandmarkType enum value
	LandmarkTypeRightEyeLeft = "rightEyeLeft"

	// LandmarkTypeRightEyeRight is a LandmarkType enum value
	LandmarkTypeRightEyeRight = "rightEyeRight"

	// LandmarkTypeRightEyeUp is a LandmarkType enum value
	LandmarkTypeRightEyeUp = "rightEyeUp"

	// LandmarkTypeRightEyeDown is a LandmarkType enum value
	LandmarkTypeRightEyeDown = "rightEyeDown"

	// LandmarkTypeNoseLeft is a LandmarkType enum value
	LandmarkTypeNoseLeft = "noseLeft"

	// LandmarkTypeNoseRight is a LandmarkType enum value
	LandmarkTypeNoseRight = "noseRight"

	// LandmarkTypeMouthUp is a LandmarkType enum value
	LandmarkTypeMouthUp = "mouthUp"

	// LandmarkTypeMouthDown is a LandmarkType enum value
	LandmarkTypeMouthDown = "mouthDown"

	// LandmarkTypeLeftPupil is a LandmarkType enum value
	LandmarkTypeLeftPupil = "leftPupil"

	// LandmarkTypeRightPupil is a LandmarkType enum value
	LandmarkTypeRightPupil = "rightPupil"
)
View Source
const (
	// OrientationCorrectionRotate0 is a OrientationCorrection enum value
	OrientationCorrectionRotate0 = "ROTATE_0"

	// OrientationCorrectionRotate90 is a OrientationCorrection enum value
	OrientationCorrectionRotate90 = "ROTATE_90"

	// OrientationCorrectionRotate180 is a OrientationCorrection enum value
	OrientationCorrectionRotate180 = "ROTATE_180"

	// OrientationCorrectionRotate270 is a OrientationCorrection enum value
	OrientationCorrectionRotate270 = "ROTATE_270"
)
View Source
const (

	// ErrCodeAccessDeniedException for service response error code
	// "AccessDeniedException".
	//
	// You are not authorized to perform the action.
	ErrCodeAccessDeniedException = "AccessDeniedException"

	// ErrCodeImageTooLargeException for service response error code
	// "ImageTooLargeException".
	//
	// The input image size exceeds the allowed limit. For more information, see
	// limits.
	ErrCodeImageTooLargeException = "ImageTooLargeException"

	// ErrCodeInternalServerError for service response error code
	// "InternalServerError".
	//
	// Amazon Rekognition experienced a service issue. Try your call again.
	ErrCodeInternalServerError = "InternalServerError"

	// ErrCodeInvalidImageFormatException for service response error code
	// "InvalidImageFormatException".
	//
	// The provided image format is not supported.
	ErrCodeInvalidImageFormatException = "InvalidImageFormatException"

	// ErrCodeInvalidPaginationTokenException for service response error code
	// "InvalidPaginationTokenException".
	//
	// Pagination token in the request is not valid.
	ErrCodeInvalidPaginationTokenException = "InvalidPaginationTokenException"

	// ErrCodeInvalidParameterException for service response error code
	// "InvalidParameterException".
	//
	// Input parameter violated a constraint. Validate your parameter before calling
	// the API operation again.
	ErrCodeInvalidParameterException = "InvalidParameterException"

	// ErrCodeInvalidS3ObjectException for service response error code
	// "InvalidS3ObjectException".
	//
	// Amazon Rekognition is unable to access the S3 object specified in the request.
	ErrCodeInvalidS3ObjectException = "InvalidS3ObjectException"

	// ErrCodeProvisionedThroughputExceededException for service response error code
	// "ProvisionedThroughputExceededException".
	//
	// The number of requests exceeded your throughput limit. If you want to increase
	// this limit, contact Amazon Rekognition.
	ErrCodeProvisionedThroughputExceededException = "ProvisionedThroughputExceededException"

	// ErrCodeResourceAlreadyExistsException for service response error code
	// "ResourceAlreadyExistsException".
	//
	// A collection with the specified ID already exists.
	ErrCodeResourceAlreadyExistsException = "ResourceAlreadyExistsException"

	// ErrCodeResourceNotFoundException for service response error code
	// "ResourceNotFoundException".
	//
	// Collection specified in the request is not found.
	ErrCodeResourceNotFoundException = "ResourceNotFoundException"

	// ErrCodeThrottlingException for service response error code
	// "ThrottlingException".
	//
	// Amazon Rekognition is temporarily unable to process the request. Try your
	// call again.
	ErrCodeThrottlingException = "ThrottlingException"
)
View Source
const (
	ServiceName = "rekognition" // Service endpoint prefix API calls made to.
	EndpointsID = ServiceName   // Service ID for Regions and Endpoints metadata.
)

Service information constants

Variables

This section is empty.

Functions

This section is empty.

Types

type AgeRange

type AgeRange struct {

	// The highest estimated age.
	High *int64 `type:"integer"`

	// The lowest estimated age.
	Low *int64 `type:"integer"`
	// contains filtered or unexported fields
}

Structure containing the estimated age range, in years, for a face.

Rekognition estimates an age-range for faces detected in the input image. Estimated age ranges can overlap; a face of a 5 year old may have an estimated range of 4-6 whilst the face of a 6 year old may have an estimated range of 4-8.

func (AgeRange) GoString

func (s AgeRange) GoString() string

GoString returns the string representation

func (*AgeRange) SetHigh

func (s *AgeRange) SetHigh(v int64) *AgeRange

SetHigh sets the High field's value.

func (*AgeRange) SetLow

func (s *AgeRange) SetLow(v int64) *AgeRange

SetLow sets the Low field's value.

func (AgeRange) String

func (s AgeRange) String() string

String returns the string representation

type Beard

type Beard struct {

	// Level of confidence in the determination.
	Confidence *float64 `type:"float"`

	// Boolean value that indicates whether the face has beard or not.
	Value *bool `type:"boolean"`
	// contains filtered or unexported fields
}

Indicates whether or not the face has a beard, and the confidence level in the determination.

func (Beard) GoString

func (s Beard) GoString() string

GoString returns the string representation

func (*Beard) SetConfidence

func (s *Beard) SetConfidence(v float64) *Beard

SetConfidence sets the Confidence field's value.

func (*Beard) SetValue

func (s *Beard) SetValue(v bool) *Beard

SetValue sets the Value field's value.

func (Beard) String

func (s Beard) String() string

String returns the string representation

type BoundingBox

type BoundingBox struct {

	// Height of the bounding box as a ratio of the overall image height.
	Height *float64 `type:"float"`

	// Left coordinate of the bounding box as a ratio of overall image width.
	Left *float64 `type:"float"`

	// Top coordinate of the bounding box as a ratio of overall image height.
	Top *float64 `type:"float"`

	// Width of the bounding box as a ratio of the overall image width.
	Width *float64 `type:"float"`
	// contains filtered or unexported fields
}

Identifies the bounding box around the object or face. The left (x-coordinate) and top (y-coordinate) are coordinates representing the top and left sides of the bounding box. Note that the upper-left corner of the image is the origin (0,0).

The top and left values returned are ratios of the overall image size. For example, if the input image is 700x200 pixels, and the top-left coordinate of the bounding box is 350x50 pixels, the API returns a left value of 0.5 (350/700) and a top value of 0.25 (50/200).

The width and height values represent the dimensions of the bounding box as a ratio of the overall image dimension. For example, if the input image is 700x200 pixels, and the bounding box width is 70 pixels, the width returned is 0.1.

The bounding box coordinates can have negative values. For example, if Amazon Rekognition is able to detect a face that is at the image edge and is only partially visible, the service can return coordinates that are outside the image bounds and, depending on the image edge, you might get negative values or values greater than 1 for the left or top values.

func (BoundingBox) GoString

func (s BoundingBox) GoString() string

GoString returns the string representation

func (*BoundingBox) SetHeight

func (s *BoundingBox) SetHeight(v float64) *BoundingBox

SetHeight sets the Height field's value.

func (*BoundingBox) SetLeft

func (s *BoundingBox) SetLeft(v float64) *BoundingBox

SetLeft sets the Left field's value.

func (*BoundingBox) SetTop

func (s *BoundingBox) SetTop(v float64) *BoundingBox

SetTop sets the Top field's value.

func (*BoundingBox) SetWidth

func (s *BoundingBox) SetWidth(v float64) *BoundingBox

SetWidth sets the Width field's value.

func (BoundingBox) String

func (s BoundingBox) String() string

String returns the string representation

type Celebrity

type Celebrity struct {

	// Provides information about the celebrity's face, such as its location on
	// the image.
	Face *ComparedFace `type:"structure"`

	// A unique identifier for the celebrity.
	Id *string `type:"string"`

	// The confidence, in percentage, that Rekognition has that the recognized face
	// is the celebrity.
	MatchConfidence *float64 `type:"float"`

	// The name of the celebrity.
	Name *string `type:"string"`

	// An array of URLs pointing to additional information about the celebrity.
	// If there is no additional information about the celebrity, this list is empty.
	Urls []*string `type:"list"`
	// contains filtered or unexported fields
}

Provides information about a celebrity recognized by the operation.

func (Celebrity) GoString

func (s Celebrity) GoString() string

GoString returns the string representation

func (*Celebrity) SetFace

func (s *Celebrity) SetFace(v *ComparedFace) *Celebrity

SetFace sets the Face field's value.

func (*Celebrity) SetId

func (s *Celebrity) SetId(v string) *Celebrity

SetId sets the Id field's value.

func (*Celebrity) SetMatchConfidence

func (s *Celebrity) SetMatchConfidence(v float64) *Celebrity

SetMatchConfidence sets the MatchConfidence field's value.

func (*Celebrity) SetName

func (s *Celebrity) SetName(v string) *Celebrity

SetName sets the Name field's value.

func (*Celebrity) SetUrls

func (s *Celebrity) SetUrls(v []*string) *Celebrity

SetUrls sets the Urls field's value.

func (Celebrity) String

func (s Celebrity) String() string

String returns the string representation

type CompareFacesInput

type CompareFacesInput struct {

	// The minimum level of confidence in the face matches that a match must meet
	// to be included in the FaceMatches array.
	SimilarityThreshold *float64 `type:"float"`

	// The source image, either as bytes or as an S3 object.
	//
	// SourceImage is a required field
	SourceImage *Image `type:"structure" required:"true"`

	// The target image, either as bytes or as an S3 object.
	//
	// TargetImage is a required field
	TargetImage *Image `type:"structure" required:"true"`
	// contains filtered or unexported fields
}

func (CompareFacesInput) GoString

func (s CompareFacesInput) GoString() string

GoString returns the string representation

func (*CompareFacesInput) SetSimilarityThreshold

func (s *CompareFacesInput) SetSimilarityThreshold(v float64) *CompareFacesInput

SetSimilarityThreshold sets the SimilarityThreshold field's value.

func (*CompareFacesInput) SetSourceImage

func (s *CompareFacesInput) SetSourceImage(v *Image) *CompareFacesInput

SetSourceImage sets the SourceImage field's value.

func (*CompareFacesInput) SetTargetImage

func (s *CompareFacesInput) SetTargetImage(v *Image) *CompareFacesInput

SetTargetImage sets the TargetImage field's value.

func (CompareFacesInput) String

func (s CompareFacesInput) String() string

String returns the string representation

func (*CompareFacesInput) Validate

func (s *CompareFacesInput) Validate() error

Validate inspects the fields of the type to determine if they are valid.

type CompareFacesMatch

type CompareFacesMatch struct {

	// Provides face metadata (bounding box and confidence that the bounding box
	// actually contains a face).
	Face *ComparedFace `type:"structure"`

	// Level of confidence that the faces match.
	Similarity *float64 `type:"float"`
	// contains filtered or unexported fields
}

Provides information about a face in a target image that matches the source image face analysed by CompareFaces. The Face property contains the bounding box of the face in the target image. The Similarity property is the confidence that the source image face matches the face in the bounding box.

func (CompareFacesMatch) GoString

func (s CompareFacesMatch) GoString() string

GoString returns the string representation

func (*CompareFacesMatch) SetFace

SetFace sets the Face field's value.

func (*CompareFacesMatch) SetSimilarity

func (s *CompareFacesMatch) SetSimilarity(v float64) *CompareFacesMatch

SetSimilarity sets the Similarity field's value.

func (CompareFacesMatch) String

func (s CompareFacesMatch) String() string

String returns the string representation

type CompareFacesOutput

type CompareFacesOutput struct {

	// An array of faces in the target image that match the source image face. Each
	// CompareFacesMatch object provides the bounding box, the confidence level
	// that the bounding box contains a face, and the similarity score for the face
	// in the bounding box and the face in the source image.
	FaceMatches []*CompareFacesMatch `type:"list"`

	// The face in the source image that was used for comparison.
	SourceImageFace *ComparedSourceImageFace `type:"structure"`

	// The orientation of the source image (counterclockwise direction). If your
	// application displays the source image, you can use this value to correct
	// image orientation. The bounding box coordinates returned in SourceImageFace
	// represent the location of the face before the image orientation is corrected.
	//
	// If the source image is in .jpeg format, it might contain exchangeable image
	// (Exif) metadata that includes the image's orientation. If the Exif metadata
	// for the source image populates the orientation field, the value of OrientationCorrection
	// is null and the SourceImageFace bounding box coordinates represent the location
	// of the face after Exif metadata is used to correct the orientation. Images
	// in .png format don't contain Exif metadata.
	SourceImageOrientationCorrection *string `type:"string" enum:"OrientationCorrection"`

	// The orientation of the target image (in counterclockwise direction). If your
	// application displays the target image, you can use this value to correct
	// the orientation of the image. The bounding box coordinates returned in FaceMatches
	// and UnmatchedFaces represent face locations before the image orientation
	// is corrected.
	//
	// If the target image is in .jpg format, it might contain Exif metadata that
	// includes the orientation of the image. If the Exif metadata for the target
	// image populates the orientation field, the value of OrientationCorrection
	// is null and the bounding box coordinates in FaceMatches and UnmatchedFaces
	// represent the location of the face after Exif metadata is used to correct
	// the orientation. Images in .png format don't contain Exif metadata.
	TargetImageOrientationCorrection *string `type:"string" enum:"OrientationCorrection"`

	// An array of faces in the target image that did not match the source image
	// face.
	UnmatchedFaces []*ComparedFace `type:"list"`
	// contains filtered or unexported fields
}

func (CompareFacesOutput) GoString

func (s CompareFacesOutput) GoString() string

GoString returns the string representation

func (*CompareFacesOutput) SetFaceMatches

func (s *CompareFacesOutput) SetFaceMatches(v []*CompareFacesMatch) *CompareFacesOutput

SetFaceMatches sets the FaceMatches field's value.

func (*CompareFacesOutput) SetSourceImageFace

SetSourceImageFace sets the SourceImageFace field's value.

func (*CompareFacesOutput) SetSourceImageOrientationCorrection

func (s *CompareFacesOutput) SetSourceImageOrientationCorrection(v string) *CompareFacesOutput

SetSourceImageOrientationCorrection sets the SourceImageOrientationCorrection field's value.

func (*CompareFacesOutput) SetTargetImageOrientationCorrection

func (s *CompareFacesOutput) SetTargetImageOrientationCorrection(v string) *CompareFacesOutput

SetTargetImageOrientationCorrection sets the TargetImageOrientationCorrection field's value.

func (*CompareFacesOutput) SetUnmatchedFaces

func (s *CompareFacesOutput) SetUnmatchedFaces(v []*ComparedFace) *CompareFacesOutput

SetUnmatchedFaces sets the UnmatchedFaces field's value.

func (CompareFacesOutput) String

func (s CompareFacesOutput) String() string

String returns the string representation

type ComparedFace

type ComparedFace struct {

	// Bounding box of the face.
	BoundingBox *BoundingBox `type:"structure"`

	// Level of confidence that what the bounding box contains is a face.
	Confidence *float64 `type:"float"`

	// An array of facial landmarks.
	Landmarks []*Landmark `type:"list"`

	// Indicates the pose of the face as determined by its pitch, roll, and yaw.
	Pose *Pose `type:"structure"`

	// Identifies face image brightness and sharpness.
	Quality *ImageQuality `type:"structure"`
	// contains filtered or unexported fields
}

Provides face metadata for target image faces that are analysed by CompareFaces and RecognizeCelebrities.

func (ComparedFace) GoString

func (s ComparedFace) GoString() string

GoString returns the string representation

func (*ComparedFace) SetBoundingBox

func (s *ComparedFace) SetBoundingBox(v *BoundingBox) *ComparedFace

SetBoundingBox sets the BoundingBox field's value.

func (*ComparedFace) SetConfidence

func (s *ComparedFace) SetConfidence(v float64) *ComparedFace

SetConfidence sets the Confidence field's value.

func (*ComparedFace) SetLandmarks

func (s *ComparedFace) SetLandmarks(v []*Landmark) *ComparedFace

SetLandmarks sets the Landmarks field's value.

func (*ComparedFace) SetPose

func (s *ComparedFace) SetPose(v *Pose) *ComparedFace

SetPose sets the Pose field's value.

func (*ComparedFace) SetQuality

func (s *ComparedFace) SetQuality(v *ImageQuality) *ComparedFace

SetQuality sets the Quality field's value.

func (ComparedFace) String

func (s ComparedFace) String() string

String returns the string representation

type ComparedSourceImageFace

type ComparedSourceImageFace struct {

	// Bounding box of the face.
	BoundingBox *BoundingBox `type:"structure"`

	// Confidence level that the selected bounding box contains a face.
	Confidence *float64 `type:"float"`
	// contains filtered or unexported fields
}

Type that describes the face Amazon Rekognition chose to compare with the faces in the target. This contains a bounding box for the selected face and confidence level that the bounding box contains a face. Note that Amazon Rekognition selects the largest face in the source image for this comparison.

func (ComparedSourceImageFace) GoString

func (s ComparedSourceImageFace) GoString() string

GoString returns the string representation

func (*ComparedSourceImageFace) SetBoundingBox

SetBoundingBox sets the BoundingBox field's value.

func (*ComparedSourceImageFace) SetConfidence

SetConfidence sets the Confidence field's value.

func (ComparedSourceImageFace) String

func (s ComparedSourceImageFace) String() string

String returns the string representation

type CreateCollectionInput

type CreateCollectionInput struct {

	// ID for the collection that you are creating.
	//
	// CollectionId is a required field
	CollectionId *string `min:"1" type:"string" required:"true"`
	// contains filtered or unexported fields
}

func (CreateCollectionInput) GoString

func (s CreateCollectionInput) GoString() string

GoString returns the string representation

func (*CreateCollectionInput) SetCollectionId

func (s *CreateCollectionInput) SetCollectionId(v string) *CreateCollectionInput

SetCollectionId sets the CollectionId field's value.

func (CreateCollectionInput) String

func (s CreateCollectionInput) String() string

String returns the string representation

func (*CreateCollectionInput) Validate

func (s *CreateCollectionInput) Validate() error

Validate inspects the fields of the type to determine if they are valid.

type CreateCollectionOutput

type CreateCollectionOutput struct {

	// Amazon Resource Name (ARN) of the collection. You can use this to manage
	// permissions on your resources.
	CollectionArn *string `type:"string"`

	// HTTP status code indicating the result of the operation.
	StatusCode *int64 `type:"integer"`
	// contains filtered or unexported fields
}

func (CreateCollectionOutput) GoString

func (s CreateCollectionOutput) GoString() string

GoString returns the string representation

func (*CreateCollectionOutput) SetCollectionArn

func (s *CreateCollectionOutput) SetCollectionArn(v string) *CreateCollectionOutput

SetCollectionArn sets the CollectionArn field's value.

func (*CreateCollectionOutput) SetStatusCode

SetStatusCode sets the StatusCode field's value.

func (CreateCollectionOutput) String

func (s CreateCollectionOutput) String() string

String returns the string representation

type DeleteCollectionInput

type DeleteCollectionInput struct {

	// ID of the collection to delete.
	//
	// CollectionId is a required field
	CollectionId *string `min:"1" type:"string" required:"true"`
	// contains filtered or unexported fields
}

func (DeleteCollectionInput) GoString

func (s DeleteCollectionInput) GoString() string

GoString returns the string representation

func (*DeleteCollectionInput) SetCollectionId

func (s *DeleteCollectionInput) SetCollectionId(v string) *DeleteCollectionInput

SetCollectionId sets the CollectionId field's value.

func (DeleteCollectionInput) String

func (s DeleteCollectionInput) String() string

String returns the string representation

func (*DeleteCollectionInput) Validate

func (s *DeleteCollectionInput) Validate() error

Validate inspects the fields of the type to determine if they are valid.

type DeleteCollectionOutput

type DeleteCollectionOutput struct {

	// HTTP status code that indicates the result of the operation.
	StatusCode *int64 `type:"integer"`
	// contains filtered or unexported fields
}

func (DeleteCollectionOutput) GoString

func (s DeleteCollectionOutput) GoString() string

GoString returns the string representation

func (*DeleteCollectionOutput) SetStatusCode

SetStatusCode sets the StatusCode field's value.

func (DeleteCollectionOutput) String

func (s DeleteCollectionOutput) String() string

String returns the string representation

type DeleteFacesInput

type DeleteFacesInput struct {

	// Collection from which to remove the specific faces.
	//
	// CollectionId is a required field
	CollectionId *string `min:"1" type:"string" required:"true"`

	// An array of face IDs to delete.
	//
	// FaceIds is a required field
	FaceIds []*string `min:"1" type:"list" required:"true"`
	// contains filtered or unexported fields
}

func (DeleteFacesInput) GoString

func (s DeleteFacesInput) GoString() string

GoString returns the string representation

func (*DeleteFacesInput) SetCollectionId

func (s *DeleteFacesInput) SetCollectionId(v string) *DeleteFacesInput

SetCollectionId sets the CollectionId field's value.

func (*DeleteFacesInput) SetFaceIds

func (s *DeleteFacesInput) SetFaceIds(v []*string) *DeleteFacesInput

SetFaceIds sets the FaceIds field's value.

func (DeleteFacesInput) String

func (s DeleteFacesInput) String() string

String returns the string representation

func (*DeleteFacesInput) Validate

func (s *DeleteFacesInput) Validate() error

Validate inspects the fields of the type to determine if they are valid.

type DeleteFacesOutput

type DeleteFacesOutput struct {

	// An array of strings (face IDs) of the faces that were deleted.
	DeletedFaces []*string `min:"1" type:"list"`
	// contains filtered or unexported fields
}

func (DeleteFacesOutput) GoString

func (s DeleteFacesOutput) GoString() string

GoString returns the string representation

func (*DeleteFacesOutput) SetDeletedFaces

func (s *DeleteFacesOutput) SetDeletedFaces(v []*string) *DeleteFacesOutput

SetDeletedFaces sets the DeletedFaces field's value.

func (DeleteFacesOutput) String

func (s DeleteFacesOutput) String() string

String returns the string representation

type DetectFacesInput

type DetectFacesInput struct {

	// An array of facial attributes you want to be returned. This can be the default
	// list of attributes or all attributes. If you don't specify a value for Attributes
	// or if you specify ["DEFAULT"], the API returns the following subset of facial
	// attributes: BoundingBox, Confidence, Pose, Quality and Landmarks. If you
	// provide ["ALL"], all facial attributes are returned but the operation will
	// take longer to complete.
	//
	// If you provide both, ["ALL", "DEFAULT"], the service uses a logical AND operator
	// to determine which attributes to return (in this case, all attributes).
	Attributes []*string `type:"list"`

	// The image in which you want to detect faces. You can specify a blob or an
	// S3 object.
	//
	// Image is a required field
	Image *Image `type:"structure" required:"true"`
	// contains filtered or unexported fields
}

func (DetectFacesInput) GoString

func (s DetectFacesInput) GoString() string

GoString returns the string representation

func (*DetectFacesInput) SetAttributes

func (s *DetectFacesInput) SetAttributes(v []*string) *DetectFacesInput

SetAttributes sets the Attributes field's value.

func (*DetectFacesInput) SetImage

func (s *DetectFacesInput) SetImage(v *Image) *DetectFacesInput

SetImage sets the Image field's value.

func (DetectFacesInput) String

func (s DetectFacesInput) String() string

String returns the string representation

func (*DetectFacesInput) Validate

func (s *DetectFacesInput) Validate() error

Validate inspects the fields of the type to determine if they are valid.

type DetectFacesOutput

type DetectFacesOutput struct {

	// Details of each face found in the image.
	FaceDetails []*FaceDetail `type:"list"`

	// The orientation of the input image (counter-clockwise direction). If your
	// application displays the image, you can use this value to correct image orientation.
	// The bounding box coordinates returned in FaceDetails represent face locations
	// before the image orientation is corrected.
	//
	// If the input image is in .jpeg format, it might contain exchangeable image
	// (Exif) metadata that includes the image's orientation. If so, and the Exif
	// metadata for the input image populates the orientation field, the value of
	// OrientationCorrection is null and the FaceDetails bounding box coordinates
	// represent face locations after Exif metadata is used to correct the image
	// orientation. Images in .png format don't contain Exif metadata.
	OrientationCorrection *string `type:"string" enum:"OrientationCorrection"`
	// contains filtered or unexported fields
}

func (DetectFacesOutput) GoString

func (s DetectFacesOutput) GoString() string

GoString returns the string representation

func (*DetectFacesOutput) SetFaceDetails

func (s *DetectFacesOutput) SetFaceDetails(v []*FaceDetail) *DetectFacesOutput

SetFaceDetails sets the FaceDetails field's value.

func (*DetectFacesOutput) SetOrientationCorrection

func (s *DetectFacesOutput) SetOrientationCorrection(v string) *DetectFacesOutput

SetOrientationCorrection sets the OrientationCorrection field's value.

func (DetectFacesOutput) String

func (s DetectFacesOutput) String() string

String returns the string representation

type DetectLabelsInput

type DetectLabelsInput struct {

	// The input image. You can provide a blob of image bytes or an S3 object.
	//
	// Image is a required field
	Image *Image `type:"structure" required:"true"`

	// Maximum number of labels you want the service to return in the response.
	// The service returns the specified number of highest confidence labels.
	MaxLabels *int64 `type:"integer"`

	// 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.
	MinConfidence *float64 `type:"float"`
	// contains filtered or unexported fields
}

func (DetectLabelsInput) GoString

func (s DetectLabelsInput) GoString() string

GoString returns the string representation

func (*DetectLabelsInput) SetImage

func (s *DetectLabelsInput) SetImage(v *Image) *DetectLabelsInput

SetImage sets the Image field's value.

func (*DetectLabelsInput) SetMaxLabels

func (s *DetectLabelsInput) SetMaxLabels(v int64) *DetectLabelsInput

SetMaxLabels sets the MaxLabels field's value.

func (*DetectLabelsInput) SetMinConfidence

func (s *DetectLabelsInput) SetMinConfidence(v float64) *DetectLabelsInput

SetMinConfidence sets the MinConfidence field's value.

func (DetectLabelsInput) String

func (s DetectLabelsInput) String() string

String returns the string representation

func (*DetectLabelsInput) Validate

func (s *DetectLabelsInput) Validate() error

Validate inspects the fields of the type to determine if they are valid.

type DetectLabelsOutput

type DetectLabelsOutput struct {

	// An array of labels for the real-world objects detected.
	Labels []*Label `type:"list"`

	// 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.
	//
	// If the input image Exif metadata populates the orientation field, Amazon
	// Rekognition does not perform orientation correction and the value of OrientationCorrection
	// will be null.
	OrientationCorrection *string `type:"string" enum:"OrientationCorrection"`
	// contains filtered or unexported fields
}

func (DetectLabelsOutput) GoString

func (s DetectLabelsOutput) GoString() string

GoString returns the string representation

func (*DetectLabelsOutput) SetLabels

func (s *DetectLabelsOutput) SetLabels(v []*Label) *DetectLabelsOutput

SetLabels sets the Labels field's value.

func (*DetectLabelsOutput) SetOrientationCorrection

func (s *DetectLabelsOutput) SetOrientationCorrection(v string) *DetectLabelsOutput

SetOrientationCorrection sets the OrientationCorrection field's value.

func (DetectLabelsOutput) String

func (s DetectLabelsOutput) String() string

String returns the string representation

type DetectModerationLabelsInput

type DetectModerationLabelsInput struct {

	// The input image as bytes or an S3 object.
	//
	// Image is a required field
	Image *Image `type:"structure" required:"true"`

	// Specifies the minimum confidence level for the labels to return. Amazon Rekognition
	// doesn't return any labels with a confidence level lower than this specified
	// value.
	//
	// If you don't specify MinConfidence, the operation returns labels with confidence
	// values greater than or equal to 50 percent.
	MinConfidence *float64 `type:"float"`
	// contains filtered or unexported fields
}

func (DetectModerationLabelsInput) GoString

func (s DetectModerationLabelsInput) GoString() string

GoString returns the string representation

func (*DetectModerationLabelsInput) SetImage

SetImage sets the Image field's value.

func (*DetectModerationLabelsInput) SetMinConfidence

SetMinConfidence sets the MinConfidence field's value.

func (DetectModerationLabelsInput) String

String returns the string representation

func (*DetectModerationLabelsInput) Validate

func (s *DetectModerationLabelsInput) Validate() error

Validate inspects the fields of the type to determine if they are valid.

type DetectModerationLabelsOutput

type DetectModerationLabelsOutput struct {

	// An array of labels for explicit or suggestive adult content found in the
	// image. The list includes the top-level label and each child label detected
	// in the image. This is useful for filtering specific categories of content.
	ModerationLabels []*ModerationLabel `type:"list"`
	// contains filtered or unexported fields
}

func (DetectModerationLabelsOutput) GoString

func (s DetectModerationLabelsOutput) GoString() string

GoString returns the string representation

func (*DetectModerationLabelsOutput) SetModerationLabels

SetModerationLabels sets the ModerationLabels field's value.

func (DetectModerationLabelsOutput) String

String returns the string representation

type Emotion

type Emotion struct {

	// Level of confidence in the determination.
	Confidence *float64 `type:"float"`

	// Type of emotion detected.
	Type *string `type:"string" enum:"EmotionName"`
	// contains filtered or unexported fields
}

The emotions detected on the face, and the confidence level in the determination. For example, HAPPY, SAD, and ANGRY.

func (Emotion) GoString

func (s Emotion) GoString() string

GoString returns the string representation

func (*Emotion) SetConfidence

func (s *Emotion) SetConfidence(v float64) *Emotion

SetConfidence sets the Confidence field's value.

func (*Emotion) SetType

func (s *Emotion) SetType(v string) *Emotion

SetType sets the Type field's value.

func (Emotion) String

func (s Emotion) String() string

String returns the string representation

type EyeOpen

type EyeOpen struct {

	// Level of confidence in the determination.
	Confidence *float64 `type:"float"`

	// Boolean value that indicates whether the eyes on the face are open.
	Value *bool `type:"boolean"`
	// contains filtered or unexported fields
}

Indicates whether or not the eyes on the face are open, and the confidence level in the determination.

func (EyeOpen) GoString

func (s EyeOpen) GoString() string

GoString returns the string representation

func (*EyeOpen) SetConfidence

func (s *EyeOpen) SetConfidence(v float64) *EyeOpen

SetConfidence sets the Confidence field's value.

func (*EyeOpen) SetValue

func (s *EyeOpen) SetValue(v bool) *EyeOpen

SetValue sets the Value field's value.

func (EyeOpen) String

func (s EyeOpen) String() string

String returns the string representation

type Eyeglasses

type Eyeglasses struct {

	// Level of confidence in the determination.
	Confidence *float64 `type:"float"`

	// Boolean value that indicates whether the face is wearing eye glasses or not.
	Value *bool `type:"boolean"`
	// contains filtered or unexported fields
}

Indicates whether or not the face is wearing eye glasses, and the confidence level in the determination.

func (Eyeglasses) GoString

func (s Eyeglasses) GoString() string

GoString returns the string representation

func (*Eyeglasses) SetConfidence

func (s *Eyeglasses) SetConfidence(v float64) *Eyeglasses

SetConfidence sets the Confidence field's value.

func (*Eyeglasses) SetValue

func (s *Eyeglasses) SetValue(v bool) *Eyeglasses

SetValue sets the Value field's value.

func (Eyeglasses) String

func (s Eyeglasses) String() string

String returns the string representation

type Face

type Face struct {

	// Bounding box of the face.
	BoundingBox *BoundingBox `type:"structure"`

	// Confidence level that the bounding box contains a face (and not a different
	// object such as a tree).
	Confidence *float64 `type:"float"`

	// Identifier that you assign to all the faces in the input image.
	ExternalImageId *string `min:"1" type:"string"`

	// Unique identifier that Amazon Rekognition assigns to the face.
	FaceId *string `type:"string"`

	// Unique identifier that Amazon Rekognition assigns to the input image.
	ImageId *string `type:"string"`
	// contains filtered or unexported fields
}

Describes the face properties such as the bounding box, face ID, image ID of the input image, and external image ID that you assigned.

func (Face) GoString

func (s Face) GoString() string

GoString returns the string representation

func (*Face) SetBoundingBox

func (s *Face) SetBoundingBox(v *BoundingBox) *Face

SetBoundingBox sets the BoundingBox field's value.

func (*Face) SetConfidence

func (s *Face) SetConfidence(v float64) *Face

SetConfidence sets the Confidence field's value.

func (*Face) SetExternalImageId

func (s *Face) SetExternalImageId(v string) *Face

SetExternalImageId sets the ExternalImageId field's value.

func (*Face) SetFaceId

func (s *Face) SetFaceId(v string) *Face

SetFaceId sets the FaceId field's value.

func (*Face) SetImageId

func (s *Face) SetImageId(v string) *Face

SetImageId sets the ImageId field's value.

func (Face) String

func (s Face) String() string

String returns the string representation

type FaceDetail

type FaceDetail struct {

	// The estimated age range, in years, for the face. Low represents the lowest
	// estimated age and High represents the highest estimated age.
	AgeRange *AgeRange `type:"structure"`

	// Indicates whether or not the face has a beard, and the confidence level in
	// the determination.
	Beard *Beard `type:"structure"`

	// Bounding box of the face.
	BoundingBox *BoundingBox `type:"structure"`

	// Confidence level that the bounding box contains a face (and not a different
	// object such as a tree).
	Confidence *float64 `type:"float"`

	// The emotions detected on the face, and the confidence level in the determination.
	// For example, HAPPY, SAD, and ANGRY.
	Emotions []*Emotion `type:"list"`

	// Indicates whether or not the face is wearing eye glasses, and the confidence
	// level in the determination.
	Eyeglasses *Eyeglasses `type:"structure"`

	// Indicates whether or not the eyes on the face are open, and the confidence
	// level in the determination.
	EyesOpen *EyeOpen `type:"structure"`

	// Gender of the face and the confidence level in the determination.
	Gender *Gender `type:"structure"`

	// Indicates the location of landmarks on the face.
	Landmarks []*Landmark `type:"list"`

	// Indicates whether or not the mouth on the face is open, and the confidence
	// level in the determination.
	MouthOpen *MouthOpen `type:"structure"`

	// Indicates whether or not the face has a mustache, and the confidence level
	// in the determination.
	Mustache *Mustache `type:"structure"`

	// Indicates the pose of the face as determined by its pitch, roll, and yaw.
	Pose *Pose `type:"structure"`

	// Identifies image brightness and sharpness.
	Quality *ImageQuality `type:"structure"`

	// Indicates whether or not the face is smiling, and the confidence level in
	// the determination.
	Smile *Smile `type:"structure"`

	// Indicates whether or not the face is wearing sunglasses, and the confidence
	// level in the determination.
	Sunglasses *Sunglasses `type:"structure"`
	// contains filtered or unexported fields
}

Structure containing attributes of the face that the algorithm detected.

func (FaceDetail) GoString

func (s FaceDetail) GoString() string

GoString returns the string representation

func (*FaceDetail) SetAgeRange

func (s *FaceDetail) SetAgeRange(v *AgeRange) *FaceDetail

SetAgeRange sets the AgeRange field's value.

func (*FaceDetail) SetBeard

func (s *FaceDetail) SetBeard(v *Beard) *FaceDetail

SetBeard sets the Beard field's value.

func (*FaceDetail) SetBoundingBox

func (s *FaceDetail) SetBoundingBox(v *BoundingBox) *FaceDetail

SetBoundingBox sets the BoundingBox field's value.

func (*FaceDetail) SetConfidence

func (s *FaceDetail) SetConfidence(v float64) *FaceDetail

SetConfidence sets the Confidence field's value.

func (*FaceDetail) SetEmotions

func (s *FaceDetail) SetEmotions(v []*Emotion) *FaceDetail

SetEmotions sets the Emotions field's value.

func (*FaceDetail) SetEyeglasses

func (s *FaceDetail) SetEyeglasses(v *Eyeglasses) *FaceDetail

SetEyeglasses sets the Eyeglasses field's value.

func (*FaceDetail) SetEyesOpen

func (s *FaceDetail) SetEyesOpen(v *EyeOpen) *FaceDetail

SetEyesOpen sets the EyesOpen field's value.

func (*FaceDetail) SetGender

func (s *FaceDetail) SetGender(v *Gender) *FaceDetail

SetGender sets the Gender field's value.

func (*FaceDetail) SetLandmarks

func (s *FaceDetail) SetLandmarks(v []*Landmark) *FaceDetail

SetLandmarks sets the Landmarks field's value.

func (*FaceDetail) SetMouthOpen

func (s *FaceDetail) SetMouthOpen(v *MouthOpen) *FaceDetail

SetMouthOpen sets the MouthOpen field's value.

func (*FaceDetail) SetMustache

func (s *FaceDetail) SetMustache(v *Mustache) *FaceDetail

SetMustache sets the Mustache field's value.

func (*FaceDetail) SetPose

func (s *FaceDetail) SetPose(v *Pose) *FaceDetail

SetPose sets the Pose field's value.

func (*FaceDetail) SetQuality

func (s *FaceDetail) SetQuality(v *ImageQuality) *FaceDetail

SetQuality sets the Quality field's value.

func (*FaceDetail) SetSmile

func (s *FaceDetail) SetSmile(v *Smile) *FaceDetail

SetSmile sets the Smile field's value.

func (*FaceDetail) SetSunglasses

func (s *FaceDetail) SetSunglasses(v *Sunglasses) *FaceDetail

SetSunglasses sets the Sunglasses field's value.

func (FaceDetail) String

func (s FaceDetail) String() string

String returns the string representation

type FaceMatch

type FaceMatch struct {

	// Describes the face properties such as the bounding box, face ID, image ID
	// of the source image, and external image ID that you assigned.
	Face *Face `type:"structure"`

	// Confidence in the match of this face with the input face.
	Similarity *float64 `type:"float"`
	// contains filtered or unexported fields
}

Provides face metadata. In addition, it also provides the confidence in the match of this face with the input face.

func (FaceMatch) GoString

func (s FaceMatch) GoString() string

GoString returns the string representation

func (*FaceMatch) SetFace

func (s *FaceMatch) SetFace(v *Face) *FaceMatch

SetFace sets the Face field's value.

func (*FaceMatch) SetSimilarity

func (s *FaceMatch) SetSimilarity(v float64) *FaceMatch

SetSimilarity sets the Similarity field's value.

func (FaceMatch) String

func (s FaceMatch) String() string

String returns the string representation

type FaceRecord

type FaceRecord struct {

	// Describes the face properties such as the bounding box, face ID, image ID
	// of the input image, and external image ID that you assigned.
	Face *Face `type:"structure"`

	// Structure containing attributes of the face that the algorithm detected.
	FaceDetail *FaceDetail `type:"structure"`
	// contains filtered or unexported fields
}

Object containing both the face metadata (stored in the back-end database) and facial attributes that are detected but aren't stored in the database.

func (FaceRecord) GoString

func (s FaceRecord) GoString() string

GoString returns the string representation

func (*FaceRecord) SetFace

func (s *FaceRecord) SetFace(v *Face) *FaceRecord

SetFace sets the Face field's value.

func (*FaceRecord) SetFaceDetail

func (s *FaceRecord) SetFaceDetail(v *FaceDetail) *FaceRecord

SetFaceDetail sets the FaceDetail field's value.

func (FaceRecord) String

func (s FaceRecord) String() string

String returns the string representation

type Gender

type Gender struct {

	// Level of confidence in the determination.
	Confidence *float64 `type:"float"`

	// Gender of the face.
	Value *string `type:"string" enum:"GenderType"`
	// contains filtered or unexported fields
}

Gender of the face and the confidence level in the determination.

func (Gender) GoString

func (s Gender) GoString() string

GoString returns the string representation

func (*Gender) SetConfidence

func (s *Gender) SetConfidence(v float64) *Gender

SetConfidence sets the Confidence field's value.

func (*Gender) SetValue

func (s *Gender) SetValue(v string) *Gender

SetValue sets the Value field's value.

func (Gender) String

func (s Gender) String() string

String returns the string representation

type GetCelebrityInfoInput

type GetCelebrityInfoInput struct {

	// The ID for the celebrity. You get the celebrity ID from a call to the operation,
	// which recognizes celebrities in an image.
	//
	// Id is a required field
	Id *string `type:"string" required:"true"`
	// contains filtered or unexported fields
}

func (GetCelebrityInfoInput) GoString

func (s GetCelebrityInfoInput) GoString() string

GoString returns the string representation

func (*GetCelebrityInfoInput) SetId

SetId sets the Id field's value.

func (GetCelebrityInfoInput) String

func (s GetCelebrityInfoInput) String() string

String returns the string representation

func (*GetCelebrityInfoInput) Validate

func (s *GetCelebrityInfoInput) Validate() error

Validate inspects the fields of the type to determine if they are valid.

type GetCelebrityInfoOutput

type GetCelebrityInfoOutput struct {

	// The name of the celebrity.
	Name *string `type:"string"`

	// An array of URLs pointing to additional celebrity information.
	Urls []*string `type:"list"`
	// contains filtered or unexported fields
}

func (GetCelebrityInfoOutput) GoString

func (s GetCelebrityInfoOutput) GoString() string

GoString returns the string representation

func (*GetCelebrityInfoOutput) SetName

SetName sets the Name field's value.

func (*GetCelebrityInfoOutput) SetUrls

SetUrls sets the Urls field's value.

func (GetCelebrityInfoOutput) String

func (s GetCelebrityInfoOutput) String() string

String returns the string representation

type Image

type Image struct {

	// Blob of image bytes up to 5 MBs.
	//
	// Bytes is automatically base64 encoded/decoded by the SDK.
	Bytes []byte `min:"1" type:"blob"`

	// Identifies an S3 object as the image source.
	S3Object *S3Object `type:"structure"`
	// contains filtered or unexported fields
}

Provides the input image either as bytes or an S3 object.

You pass image bytes to a Rekognition API operation by using the Bytes property. For example, you would use the Bytes property to pass an image loaded from a local file system. Image bytes passed by using the Bytes property must be base64-encoded. Your code may not need to encode image bytes if you are using an AWS SDK to call Rekognition API operations. For more information, see example4.

You pass images stored in an S3 bucket to a Rekognition API operation by using the S3Object property. Images stored in an S3 bucket do not need to be base64-encoded.

The region for the S3 bucket containing the S3 object must match the region you use for Amazon Rekognition operations.

If you use the Amazon CLI to call Amazon Rekognition operations, passing image bytes using the Bytes property is not supported. You must first upload the image to an Amazon S3 bucket and then call the operation using the S3Object property.

For Amazon Rekognition to process an S3 object, the user must have permission to access the S3 object. For more information, see manage-access-resource-policies.

func (Image) GoString

func (s Image) GoString() string

GoString returns the string representation

func (*Image) SetBytes

func (s *Image) SetBytes(v []byte) *Image

SetBytes sets the Bytes field's value.

func (*Image) SetS3Object

func (s *Image) SetS3Object(v *S3Object) *Image

SetS3Object sets the S3Object field's value.

func (Image) String

func (s Image) String() string

String returns the string representation

func (*Image) Validate

func (s *Image) Validate() error

Validate inspects the fields of the type to determine if they are valid.

type ImageQuality

type ImageQuality struct {

	// Value representing brightness of the face. The service returns a value between
	// 0 and 100 (inclusive). A higher value indicates a brighter face image.
	Brightness *float64 `type:"float"`

	// Value representing sharpness of the face. The service returns a value between
	// 0 and 100 (inclusive). A higher value indicates a sharper face image.
	Sharpness *float64 `type:"float"`
	// contains filtered or unexported fields
}

Identifies face image brightness and sharpness.

func (ImageQuality) GoString

func (s ImageQuality) GoString() string

GoString returns the string representation

func (*ImageQuality) SetBrightness

func (s *ImageQuality) SetBrightness(v float64) *ImageQuality

SetBrightness sets the Brightness field's value.

func (*ImageQuality) SetSharpness

func (s *ImageQuality) SetSharpness(v float64) *ImageQuality

SetSharpness sets the Sharpness field's value.

func (ImageQuality) String

func (s ImageQuality) String() string

String returns the string representation

type IndexFacesInput

type IndexFacesInput struct {

	// The ID of an existing collection to which you want to add the faces that
	// are detected in the input images.
	//
	// CollectionId is a required field
	CollectionId *string `min:"1" type:"string" required:"true"`

	// An array of facial attributes that you want to be returned. This can be the
	// default list of attributes or all attributes. If you don't specify a value
	// for Attributes or if you specify ["DEFAULT"], the API returns the following
	// subset of facial attributes: BoundingBox, Confidence, Pose, Quality and Landmarks.
	// If you provide ["ALL"], all facial attributes are returned but the operation
	// will take longer to complete.
	//
	// If you provide both, ["ALL", "DEFAULT"], the service uses a logical AND operator
	// to determine which attributes to return (in this case, all attributes).
	DetectionAttributes []*string `type:"list"`

	// ID you want to assign to all the faces detected in the image.
	ExternalImageId *string `min:"1" type:"string"`

	// The input image as bytes or an S3 object.
	//
	// Image is a required field
	Image *Image `type:"structure" required:"true"`
	// contains filtered or unexported fields
}

func (IndexFacesInput) GoString

func (s IndexFacesInput) GoString() string

GoString returns the string representation

func (*IndexFacesInput) SetCollectionId

func (s *IndexFacesInput) SetCollectionId(v string) *IndexFacesInput

SetCollectionId sets the CollectionId field's value.

func (*IndexFacesInput) SetDetectionAttributes

func (s *IndexFacesInput) SetDetectionAttributes(v []*string) *IndexFacesInput

SetDetectionAttributes sets the DetectionAttributes field's value.

func (*IndexFacesInput) SetExternalImageId

func (s *IndexFacesInput) SetExternalImageId(v string) *IndexFacesInput

SetExternalImageId sets the ExternalImageId field's value.

func (*IndexFacesInput) SetImage

func (s *IndexFacesInput) SetImage(v *Image) *IndexFacesInput

SetImage sets the Image field's value.

func (IndexFacesInput) String

func (s IndexFacesInput) String() string

String returns the string representation

func (*IndexFacesInput) Validate

func (s *IndexFacesInput) Validate() error

Validate inspects the fields of the type to determine if they are valid.

type IndexFacesOutput

type IndexFacesOutput struct {

	// An array of faces detected and added to the collection. For more information,
	// see howitworks-index-faces.
	FaceRecords []*FaceRecord `type:"list"`

	// The orientation of the input image (counterclockwise direction). If your
	// application displays the image, you can use this value to correct image orientation.
	// The bounding box coordinates returned in FaceRecords represent face locations
	// before the image orientation is corrected.
	//
	// If the input image is in jpeg format, it might contain exchangeable image
	// (Exif) metadata. If so, and the Exif metadata populates the orientation field,
	// the value of OrientationCorrection is null and the bounding box coordinates
	// in FaceRecords represent face locations after Exif metadata is used to correct
	// the image orientation. Images in .png format don't contain Exif metadata.
	OrientationCorrection *string `type:"string" enum:"OrientationCorrection"`
	// contains filtered or unexported fields
}

func (IndexFacesOutput) GoString

func (s IndexFacesOutput) GoString() string

GoString returns the string representation

func (*IndexFacesOutput) SetFaceRecords

func (s *IndexFacesOutput) SetFaceRecords(v []*FaceRecord) *IndexFacesOutput

SetFaceRecords sets the FaceRecords field's value.

func (*IndexFacesOutput) SetOrientationCorrection

func (s *IndexFacesOutput) SetOrientationCorrection(v string) *IndexFacesOutput

SetOrientationCorrection sets the OrientationCorrection field's value.

func (IndexFacesOutput) String

func (s IndexFacesOutput) String() string

String returns the string representation

type Label

type Label struct {

	// Level of confidence.
	Confidence *float64 `type:"float"`

	// The name (label) of the object.
	Name *string `type:"string"`
	// contains filtered or unexported fields
}

Structure containing details about the detected label, including name, and level of confidence.

func (Label) GoString

func (s Label) GoString() string

GoString returns the string representation

func (*Label) SetConfidence

func (s *Label) SetConfidence(v float64) *Label

SetConfidence sets the Confidence field's value.

func (*Label) SetName

func (s *Label) SetName(v string) *Label

SetName sets the Name field's value.

func (Label) String

func (s Label) String() string

String returns the string representation

type Landmark

type Landmark struct {

	// Type of the landmark.
	Type *string `type:"string" enum:"LandmarkType"`

	// x-coordinate from the top left of the landmark expressed as the ratio of
	// the width of the image. For example, if the images is 700x200 and the x-coordinate
	// of the landmark is at 350 pixels, this value is 0.5.
	X *float64 `type:"float"`

	// y-coordinate from the top left of the landmark expressed as the ratio of
	// the height of the image. For example, if the images is 700x200 and the y-coordinate
	// of the landmark is at 100 pixels, this value is 0.5.
	Y *float64 `type:"float"`
	// contains filtered or unexported fields
}

Indicates the location of the landmark on the face.

func (Landmark) GoString

func (s Landmark) GoString() string

GoString returns the string representation

func (*Landmark) SetType

func (s *Landmark) SetType(v string) *Landmark

SetType sets the Type field's value.

func (*Landmark) SetX

func (s *Landmark) SetX(v float64) *Landmark

SetX sets the X field's value.

func (*Landmark) SetY

func (s *Landmark) SetY(v float64) *Landmark

SetY sets the Y field's value.

func (Landmark) String

func (s Landmark) String() string

String returns the string representation

type ListCollectionsInput

type ListCollectionsInput struct {

	// Maximum number of collection IDs to return.
	MaxResults *int64 `type:"integer"`

	// Pagination token from the previous response.
	NextToken *string `type:"string"`
	// contains filtered or unexported fields
}

func (ListCollectionsInput) GoString

func (s ListCollectionsInput) GoString() string

GoString returns the string representation

func (*ListCollectionsInput) SetMaxResults

func (s *ListCollectionsInput) SetMaxResults(v int64) *ListCollectionsInput

SetMaxResults sets the MaxResults field's value.

func (*ListCollectionsInput) SetNextToken

func (s *ListCollectionsInput) SetNextToken(v string) *ListCollectionsInput

SetNextToken sets the NextToken field's value.

func (ListCollectionsInput) String

func (s ListCollectionsInput) String() string

String returns the string representation

type ListCollectionsOutput

type ListCollectionsOutput struct {

	// An array of collection IDs.
	CollectionIds []*string `type:"list"`

	// If the result is truncated, the response provides a NextToken that you can
	// use in the subsequent request to fetch the next set of collection IDs.
	NextToken *string `type:"string"`
	// contains filtered or unexported fields
}

func (ListCollectionsOutput) GoString

func (s ListCollectionsOutput) GoString() string

GoString returns the string representation

func (*ListCollectionsOutput) SetCollectionIds

func (s *ListCollectionsOutput) SetCollectionIds(v []*string) *ListCollectionsOutput

SetCollectionIds sets the CollectionIds field's value.

func (*ListCollectionsOutput) SetNextToken

SetNextToken sets the NextToken field's value.

func (ListCollectionsOutput) String

func (s ListCollectionsOutput) String() string

String returns the string representation

type ListFacesInput

type ListFacesInput struct {

	// ID of the collection from which to list the faces.
	//
	// CollectionId is a required field
	CollectionId *string `min:"1" type:"string" required:"true"`

	// Maximum number of faces to return.
	MaxResults *int64 `type:"integer"`

	// If the previous response was incomplete (because there is more data to retrieve),
	// Amazon Rekognition returns a pagination token in the response. You can use
	// this pagination token to retrieve the next set of faces.
	NextToken *string `type:"string"`
	// contains filtered or unexported fields
}

func (ListFacesInput) GoString

func (s ListFacesInput) GoString() string

GoString returns the string representation

func (*ListFacesInput) SetCollectionId

func (s *ListFacesInput) SetCollectionId(v string) *ListFacesInput

SetCollectionId sets the CollectionId field's value.

func (*ListFacesInput) SetMaxResults

func (s *ListFacesInput) SetMaxResults(v int64) *ListFacesInput

SetMaxResults sets the MaxResults field's value.

func (*ListFacesInput) SetNextToken

func (s *ListFacesInput) SetNextToken(v string) *ListFacesInput

SetNextToken sets the NextToken field's value.

func (ListFacesInput) String

func (s ListFacesInput) String() string

String returns the string representation

func (*ListFacesInput) Validate

func (s *ListFacesInput) Validate() error

Validate inspects the fields of the type to determine if they are valid.

type ListFacesOutput

type ListFacesOutput struct {

	// An array of Face objects.
	Faces []*Face `type:"list"`

	// If the response is truncated, Amazon Rekognition returns this token that
	// you can use in the subsequent request to retrieve the next set of faces.
	NextToken *string `type:"string"`
	// contains filtered or unexported fields
}

func (ListFacesOutput) GoString

func (s ListFacesOutput) GoString() string

GoString returns the string representation

func (*ListFacesOutput) SetFaces

func (s *ListFacesOutput) SetFaces(v []*Face) *ListFacesOutput

SetFaces sets the Faces field's value.

func (*ListFacesOutput) SetNextToken

func (s *ListFacesOutput) SetNextToken(v string) *ListFacesOutput

SetNextToken sets the NextToken field's value.

func (ListFacesOutput) String

func (s ListFacesOutput) String() string

String returns the string representation

type ModerationLabel

type ModerationLabel struct {

	// Specifies the confidence that Amazon Rekognition has that the label has been
	// correctly identified.
	//
	// If you don't specify the MinConfidence parameter in the call to DetectModerationLabels,
	// the operation returns labels with a confidence value greater than or equal
	// to 50 percent.
	Confidence *float64 `type:"float"`

	// The label name for the type of content detected in the image.
	Name *string `type:"string"`

	// The name for the parent label. Labels at the top-level of the hierarchy have
	// the parent label "".
	ParentName *string `type:"string"`
	// contains filtered or unexported fields
}

Provides information about a single type of moderated content found in an image. Each type of moderated content has a label within a hierarchical taxonomy. For more information, see image-moderation.

func (ModerationLabel) GoString

func (s ModerationLabel) GoString() string

GoString returns the string representation

func (*ModerationLabel) SetConfidence

func (s *ModerationLabel) SetConfidence(v float64) *ModerationLabel

SetConfidence sets the Confidence field's value.

func (*ModerationLabel) SetName

func (s *ModerationLabel) SetName(v string) *ModerationLabel

SetName sets the Name field's value.

func (*ModerationLabel) SetParentName

func (s *ModerationLabel) SetParentName(v string) *ModerationLabel

SetParentName sets the ParentName field's value.

func (ModerationLabel) String

func (s ModerationLabel) String() string

String returns the string representation

type MouthOpen

type MouthOpen struct {

	// Level of confidence in the determination.
	Confidence *float64 `type:"float"`

	// Boolean value that indicates whether the mouth on the face is open or not.
	Value *bool `type:"boolean"`
	// contains filtered or unexported fields
}

Indicates whether or not the mouth on the face is open, and the confidence level in the determination.

func (MouthOpen) GoString

func (s MouthOpen) GoString() string

GoString returns the string representation

func (*MouthOpen) SetConfidence

func (s *MouthOpen) SetConfidence(v float64) *MouthOpen

SetConfidence sets the Confidence field's value.

func (*MouthOpen) SetValue

func (s *MouthOpen) SetValue(v bool) *MouthOpen

SetValue sets the Value field's value.

func (MouthOpen) String

func (s MouthOpen) String() string

String returns the string representation

type Mustache

type Mustache struct {

	// Level of confidence in the determination.
	Confidence *float64 `type:"float"`

	// Boolean value that indicates whether the face has mustache or not.
	Value *bool `type:"boolean"`
	// contains filtered or unexported fields
}

Indicates whether or not the face has a mustache, and the confidence level in the determination.

func (Mustache) GoString

func (s Mustache) GoString() string

GoString returns the string representation

func (*Mustache) SetConfidence

func (s *Mustache) SetConfidence(v float64) *Mustache

SetConfidence sets the Confidence field's value.

func (*Mustache) SetValue

func (s *Mustache) SetValue(v bool) *Mustache

SetValue sets the Value field's value.

func (Mustache) String

func (s Mustache) String() string

String returns the string representation

type Pose

type Pose struct {

	// Value representing the face rotation on the pitch axis.
	Pitch *float64 `type:"float"`

	// Value representing the face rotation on the roll axis.
	Roll *float64 `type:"float"`

	// Value representing the face rotation on the yaw axis.
	Yaw *float64 `type:"float"`
	// contains filtered or unexported fields
}

Indicates the pose of the face as determined by its pitch, roll, and yaw.

func (Pose) GoString

func (s Pose) GoString() string

GoString returns the string representation

func (*Pose) SetPitch

func (s *Pose) SetPitch(v float64) *Pose

SetPitch sets the Pitch field's value.

func (*Pose) SetRoll

func (s *Pose) SetRoll(v float64) *Pose

SetRoll sets the Roll field's value.

func (*Pose) SetYaw

func (s *Pose) SetYaw(v float64) *Pose

SetYaw sets the Yaw field's value.

func (Pose) String

func (s Pose) String() string

String returns the string representation

type RecognizeCelebritiesInput

type RecognizeCelebritiesInput struct {

	// The input image to use for celebrity recognition.
	//
	// Image is a required field
	Image *Image `type:"structure" required:"true"`
	// contains filtered or unexported fields
}

func (RecognizeCelebritiesInput) GoString

func (s RecognizeCelebritiesInput) GoString() string

GoString returns the string representation

func (*RecognizeCelebritiesInput) SetImage

SetImage sets the Image field's value.

func (RecognizeCelebritiesInput) String

func (s RecognizeCelebritiesInput) String() string

String returns the string representation

func (*RecognizeCelebritiesInput) Validate

func (s *RecognizeCelebritiesInput) Validate() error

Validate inspects the fields of the type to determine if they are valid.

type RecognizeCelebritiesOutput

type RecognizeCelebritiesOutput struct {

	// Details about each celebrity found in the image. Amazon Rekognition can detect
	// a maximum of 15 celebrities in an image.
	CelebrityFaces []*Celebrity `type:"list"`

	// The orientation of the input image (counterclockwise direction). If your
	// application displays the image, you can use this value to correct the orientation.
	// The bounding box coordinates returned in CelebrityFaces and UnrecognizedFaces
	// represent face locations before the image orientation is corrected.
	//
	// If the input image is in .jpeg format, it might contain exchangeable image
	// (Exif) metadata that includes the image's orientation. If so, and the Exif
	// metadata for the input image populates the orientation field, the value of
	// OrientationCorrection is null and the CelebrityFaces and UnrecognizedFaces
	// bounding box coordinates represent face locations after Exif metadata is
	// used to correct the image orientation. Images in .png format don't contain
	// Exif metadata.
	OrientationCorrection *string `type:"string" enum:"OrientationCorrection"`

	// Details about each unrecognized face in the image.
	UnrecognizedFaces []*ComparedFace `type:"list"`
	// contains filtered or unexported fields
}

func (RecognizeCelebritiesOutput) GoString

func (s RecognizeCelebritiesOutput) GoString() string

GoString returns the string representation

func (*RecognizeCelebritiesOutput) SetCelebrityFaces

SetCelebrityFaces sets the CelebrityFaces field's value.

func (*RecognizeCelebritiesOutput) SetOrientationCorrection

func (s *RecognizeCelebritiesOutput) SetOrientationCorrection(v string) *RecognizeCelebritiesOutput

SetOrientationCorrection sets the OrientationCorrection field's value.

func (*RecognizeCelebritiesOutput) SetUnrecognizedFaces

SetUnrecognizedFaces sets the UnrecognizedFaces field's value.

func (RecognizeCelebritiesOutput) String

String returns the string representation

type Rekognition

type Rekognition struct {
	*client.Client
}

Rekognition provides the API operation methods for making requests to Amazon Rekognition. See this package's package overview docs for details on the service.

Rekognition methods are safe to use concurrently. It is not safe to modify mutate any of the struct's properties though.

func New

func New(p client.ConfigProvider, cfgs ...*aws.Config) *Rekognition

New creates a new instance of the Rekognition client with a session. If additional configuration is needed for the client instance use the optional aws.Config parameter to add your extra config.

Example:

// Create a Rekognition client from just a session.
svc := rekognition.New(mySession)

// Create a Rekognition client with additional configuration
svc := rekognition.New(mySession, aws.NewConfig().WithRegion("us-west-2"))

func (*Rekognition) CompareFaces

func (c *Rekognition) CompareFaces(input *CompareFacesInput) (*CompareFacesOutput, error)

CompareFaces API operation for Amazon Rekognition.

Compares a face in the source input image with each face detected in the target input image.

If the source image contains multiple faces, the service detects the largest face and compares it with each face detected in the target image.

In response, the operation returns an array of face matches ordered by similarity score in descending order. For each face match, the response provides a bounding box of the face, facial landmarks, pose details (pitch, role, and yaw), quality (brightness and sharpness), and confidence value (indicating the level of confidence that the bounding box contains a face). The response also provides a similarity score, which indicates how closely the faces match.

By default, only faces with a similarity score of greater than or equal to 80% are returned in the response. You can change this value by specifying the SimilarityThreshold parameter.

CompareFaces also returns an array of faces that don't match the source image. For each face, it returns a bounding box, confidence value, landmarks, pose details, and quality. The response also returns information about the face in the source image, including the bounding box of the face and confidence value.

If the image doesn't contain Exif metadata, CompareFaces returns orientation information for the source and target images. Use these values to display the images with the correct image orientation.

This is a stateless API operation. That is, data returned by this operation doesn't persist.

For an example, see get-started-exercise-compare-faces.

This operation requires permissions to perform the rekognition:CompareFaces action.

Returns awserr.Error for service API and SDK errors. Use runtime type assertions with awserr.Error's Code and Message methods to get detailed information about the error.

See the AWS API reference guide for Amazon Rekognition's API operation CompareFaces for usage and error information.

Returned Error Codes:

  • ErrCodeInvalidParameterException "InvalidParameterException" Input parameter violated a constraint. Validate your parameter before calling the API operation again.

  • ErrCodeInvalidS3ObjectException "InvalidS3ObjectException" Amazon Rekognition is unable to access the S3 object specified in the request.

  • ErrCodeImageTooLargeException "ImageTooLargeException" The input image size exceeds the allowed limit. For more information, see limits.

  • ErrCodeAccessDeniedException "AccessDeniedException" You are not authorized to perform the action.

  • ErrCodeInternalServerError "InternalServerError" Amazon Rekognition experienced a service issue. Try your call again.

  • ErrCodeThrottlingException "ThrottlingException" Amazon Rekognition is temporarily unable to process the request. Try your call again.

  • ErrCodeProvisionedThroughputExceededException "ProvisionedThroughputExceededException" The number of requests exceeded your throughput limit. If you want to increase this limit, contact Amazon Rekognition.

  • ErrCodeInvalidImageFormatException "InvalidImageFormatException" The provided image format is not supported.

Example (Shared00)

To compare two images

This operation compares the largest face detected in the source image with each face detected in the target image.

package main

import (
	"fmt"

	"github.com/aws/aws-sdk-go/aws"
	"github.com/aws/aws-sdk-go/aws/awserr"
	"github.com/aws/aws-sdk-go/aws/session"
	"github.com/aws/aws-sdk-go/service/rekognition"
)

func main() {
	svc := rekognition.New(session.New())
	input := &rekognition.CompareFacesInput{
		SimilarityThreshold: aws.Float64(90.000000),
		SourceImage: &rekognition.Image{
			S3Object: &rekognition.S3Object{
				Bucket: aws.String("mybucket"),
				Name:   aws.String("mysourceimage"),
			},
		},
		TargetImage: &rekognition.Image{
			S3Object: &rekognition.S3Object{
				Bucket: aws.String("mybucket"),
				Name:   aws.String("mytargetimage"),
			},
		},
	}

	result, err := svc.CompareFaces(input)
	if err != nil {
		if aerr, ok := err.(awserr.Error); ok {
			switch aerr.Code() {
			case rekognition.ErrCodeInvalidParameterException:
				fmt.Println(rekognition.ErrCodeInvalidParameterException, aerr.Error())
			case rekognition.ErrCodeInvalidS3ObjectException:
				fmt.Println(rekognition.ErrCodeInvalidS3ObjectException, aerr.Error())
			case rekognition.ErrCodeImageTooLargeException:
				fmt.Println(rekognition.ErrCodeImageTooLargeException, aerr.Error())
			case rekognition.ErrCodeAccessDeniedException:
				fmt.Println(rekognition.ErrCodeAccessDeniedException, aerr.Error())
			case rekognition.ErrCodeInternalServerError:
				fmt.Println(rekognition.ErrCodeInternalServerError, aerr.Error())
			case rekognition.ErrCodeThrottlingException:
				fmt.Println(rekognition.ErrCodeThrottlingException, aerr.Error())
			case rekognition.ErrCodeProvisionedThroughputExceededException:
				fmt.Println(rekognition.ErrCodeProvisionedThroughputExceededException, aerr.Error())
			case rekognition.ErrCodeInvalidImageFormatException:
				fmt.Println(rekognition.ErrCodeInvalidImageFormatException, aerr.Error())
			default:
				fmt.Println(aerr.Error())
			}
		} else {
			// Print the error, cast err to awserr.Error to get the Code and
			// Message from an error.
			fmt.Println(err.Error())
		}
		return
	}

	fmt.Println(result)
}
Output:

func (*Rekognition) CompareFacesRequest

func (c *Rekognition) CompareFacesRequest(input *CompareFacesInput) (req *request.Request, output *CompareFacesOutput)

CompareFacesRequest generates a "aws/request.Request" representing the client's request for the CompareFaces operation. The "output" return value will be populated with the request's response once the request complets successfuly.

Use "Send" method on the returned Request to send the API call to the service. the "output" return value is not valid until after Send returns without error.

See CompareFaces for more information on using the CompareFaces API call, and error handling.

This method is useful when you want to inject custom logic or configuration into the SDK's request lifecycle. Such as custom headers, or retry logic.

// Example sending a request using the CompareFacesRequest method.
req, resp := client.CompareFacesRequest(params)

err := req.Send()
if err == nil { // resp is now filled
    fmt.Println(resp)
}

func (*Rekognition) CompareFacesWithContext

func (c *Rekognition) CompareFacesWithContext(ctx aws.Context, input *CompareFacesInput, opts ...request.Option) (*CompareFacesOutput, error)

CompareFacesWithContext is the same as CompareFaces with the addition of the ability to pass a context and additional request options.

See CompareFaces for details on how to use this API operation.

The context must be non-nil and will be used for request cancellation. If the context is nil a panic will occur. In the future the SDK may create sub-contexts for http.Requests. See https://golang.org/pkg/context/ for more information on using Contexts.

func (*Rekognition) CreateCollection

func (c *Rekognition) CreateCollection(input *CreateCollectionInput) (*CreateCollectionOutput, error)

CreateCollection API operation for Amazon Rekognition.

Creates a collection in an AWS Region. You can add faces to the collection using the operation.

For example, you might create collections, one for each of your application users. A user can then index faces using the IndexFaces operation and persist results in a specific collection. Then, a user can search the collection for faces in the user-specific container.

Collection names are case-sensitive.

For an example, see example1.

This operation requires permissions to perform the rekognition:CreateCollection action.

Returns awserr.Error for service API and SDK errors. Use runtime type assertions with awserr.Error's Code and Message methods to get detailed information about the error.

See the AWS API reference guide for Amazon Rekognition's API operation CreateCollection for usage and error information.

Returned Error Codes:

  • ErrCodeInvalidParameterException "InvalidParameterException" Input parameter violated a constraint. Validate your parameter before calling the API operation again.

  • ErrCodeAccessDeniedException "AccessDeniedException" You are not authorized to perform the action.

  • ErrCodeInternalServerError "InternalServerError" Amazon Rekognition experienced a service issue. Try your call again.

  • ErrCodeThrottlingException "ThrottlingException" Amazon Rekognition is temporarily unable to process the request. Try your call again.

  • ErrCodeProvisionedThroughputExceededException "ProvisionedThroughputExceededException" The number of requests exceeded your throughput limit. If you want to increase this limit, contact Amazon Rekognition.

  • ErrCodeResourceAlreadyExistsException "ResourceAlreadyExistsException" A collection with the specified ID already exists.

Example (Shared00)

To create a collection

This operation creates a Rekognition collection for storing image data.

package main

import (
	"fmt"

	"github.com/aws/aws-sdk-go/aws"
	"github.com/aws/aws-sdk-go/aws/awserr"
	"github.com/aws/aws-sdk-go/aws/session"
	"github.com/aws/aws-sdk-go/service/rekognition"
)

func main() {
	svc := rekognition.New(session.New())
	input := &rekognition.CreateCollectionInput{
		CollectionId: aws.String("myphotos"),
	}

	result, err := svc.CreateCollection(input)
	if err != nil {
		if aerr, ok := err.(awserr.Error); ok {
			switch aerr.Code() {
			case rekognition.ErrCodeInvalidParameterException:
				fmt.Println(rekognition.ErrCodeInvalidParameterException, aerr.Error())
			case rekognition.ErrCodeAccessDeniedException:
				fmt.Println(rekognition.ErrCodeAccessDeniedException, aerr.Error())
			case rekognition.ErrCodeInternalServerError:
				fmt.Println(rekognition.ErrCodeInternalServerError, aerr.Error())
			case rekognition.ErrCodeThrottlingException:
				fmt.Println(rekognition.ErrCodeThrottlingException, aerr.Error())
			case rekognition.ErrCodeProvisionedThroughputExceededException:
				fmt.Println(rekognition.ErrCodeProvisionedThroughputExceededException, aerr.Error())
			case rekognition.ErrCodeResourceAlreadyExistsException:
				fmt.Println(rekognition.ErrCodeResourceAlreadyExistsException, aerr.Error())
			default:
				fmt.Println(aerr.Error())
			}
		} else {
			// Print the error, cast err to awserr.Error to get the Code and
			// Message from an error.
			fmt.Println(err.Error())
		}
		return
	}

	fmt.Println(result)
}
Output:

func (*Rekognition) CreateCollectionRequest

func (c *Rekognition) CreateCollectionRequest(input *CreateCollectionInput) (req *request.Request, output *CreateCollectionOutput)

CreateCollectionRequest generates a "aws/request.Request" representing the client's request for the CreateCollection operation. The "output" return value will be populated with the request's response once the request complets successfuly.

Use "Send" method on the returned Request to send the API call to the service. the "output" return value is not valid until after Send returns without error.

See CreateCollection for more information on using the CreateCollection API call, and error handling.

This method is useful when you want to inject custom logic or configuration into the SDK's request lifecycle. Such as custom headers, or retry logic.

// Example sending a request using the CreateCollectionRequest method.
req, resp := client.CreateCollectionRequest(params)

err := req.Send()
if err == nil { // resp is now filled
    fmt.Println(resp)
}

func (*Rekognition) CreateCollectionWithContext

func (c *Rekognition) CreateCollectionWithContext(ctx aws.Context, input *CreateCollectionInput, opts ...request.Option) (*CreateCollectionOutput, error)

CreateCollectionWithContext is the same as CreateCollection with the addition of the ability to pass a context and additional request options.

See CreateCollection for details on how to use this API operation.

The context must be non-nil and will be used for request cancellation. If the context is nil a panic will occur. In the future the SDK may create sub-contexts for http.Requests. See https://golang.org/pkg/context/ for more information on using Contexts.

func (*Rekognition) DeleteCollection

func (c *Rekognition) DeleteCollection(input *DeleteCollectionInput) (*DeleteCollectionOutput, error)

DeleteCollection API operation for Amazon Rekognition.

Deletes the specified collection. Note that this operation removes all faces in the collection. For an example, see example1.

This operation requires permissions to perform the rekognition:DeleteCollection action.

Returns awserr.Error for service API and SDK errors. Use runtime type assertions with awserr.Error's Code and Message methods to get detailed information about the error.

See the AWS API reference guide for Amazon Rekognition's API operation DeleteCollection for usage and error information.

Returned Error Codes:

  • ErrCodeInvalidParameterException "InvalidParameterException" Input parameter violated a constraint. Validate your parameter before calling the API operation again.

  • ErrCodeAccessDeniedException "AccessDeniedException" You are not authorized to perform the action.

  • ErrCodeInternalServerError "InternalServerError" Amazon Rekognition experienced a service issue. Try your call again.

  • ErrCodeThrottlingException "ThrottlingException" Amazon Rekognition is temporarily unable to process the request. Try your call again.

  • ErrCodeProvisionedThroughputExceededException "ProvisionedThroughputExceededException" The number of requests exceeded your throughput limit. If you want to increase this limit, contact Amazon Rekognition.

  • ErrCodeResourceNotFoundException "ResourceNotFoundException" Collection specified in the request is not found.

Example (Shared00)

To delete a collection

This operation deletes a Rekognition collection.

package main

import (
	"fmt"

	"github.com/aws/aws-sdk-go/aws"
	"github.com/aws/aws-sdk-go/aws/awserr"
	"github.com/aws/aws-sdk-go/aws/session"
	"github.com/aws/aws-sdk-go/service/rekognition"
)

func main() {
	svc := rekognition.New(session.New())
	input := &rekognition.DeleteCollectionInput{
		CollectionId: aws.String("myphotos"),
	}

	result, err := svc.DeleteCollection(input)
	if err != nil {
		if aerr, ok := err.(awserr.Error); ok {
			switch aerr.Code() {
			case rekognition.ErrCodeInvalidParameterException:
				fmt.Println(rekognition.ErrCodeInvalidParameterException, aerr.Error())
			case rekognition.ErrCodeAccessDeniedException:
				fmt.Println(rekognition.ErrCodeAccessDeniedException, aerr.Error())
			case rekognition.ErrCodeInternalServerError:
				fmt.Println(rekognition.ErrCodeInternalServerError, aerr.Error())
			case rekognition.ErrCodeThrottlingException:
				fmt.Println(rekognition.ErrCodeThrottlingException, aerr.Error())
			case rekognition.ErrCodeProvisionedThroughputExceededException:
				fmt.Println(rekognition.ErrCodeProvisionedThroughputExceededException, aerr.Error())
			case rekognition.ErrCodeResourceNotFoundException:
				fmt.Println(rekognition.ErrCodeResourceNotFoundException, aerr.Error())
			default:
				fmt.Println(aerr.Error())
			}
		} else {
			// Print the error, cast err to awserr.Error to get the Code and
			// Message from an error.
			fmt.Println(err.Error())
		}
		return
	}

	fmt.Println(result)
}
Output:

func (*Rekognition) DeleteCollectionRequest

func (c *Rekognition) DeleteCollectionRequest(input *DeleteCollectionInput) (req *request.Request, output *DeleteCollectionOutput)

DeleteCollectionRequest generates a "aws/request.Request" representing the client's request for the DeleteCollection operation. The "output" return value will be populated with the request's response once the request complets successfuly.

Use "Send" method on the returned Request to send the API call to the service. the "output" return value is not valid until after Send returns without error.

See DeleteCollection for more information on using the DeleteCollection API call, and error handling.

This method is useful when you want to inject custom logic or configuration into the SDK's request lifecycle. Such as custom headers, or retry logic.

// Example sending a request using the DeleteCollectionRequest method.
req, resp := client.DeleteCollectionRequest(params)

err := req.Send()
if err == nil { // resp is now filled
    fmt.Println(resp)
}

func (*Rekognition) DeleteCollectionWithContext

func (c *Rekognition) DeleteCollectionWithContext(ctx aws.Context, input *DeleteCollectionInput, opts ...request.Option) (*DeleteCollectionOutput, error)

DeleteCollectionWithContext is the same as DeleteCollection with the addition of the ability to pass a context and additional request options.

See DeleteCollection for details on how to use this API operation.

The context must be non-nil and will be used for request cancellation. If the context is nil a panic will occur. In the future the SDK may create sub-contexts for http.Requests. See https://golang.org/pkg/context/ for more information on using Contexts.

func (*Rekognition) DeleteFaces

func (c *Rekognition) DeleteFaces(input *DeleteFacesInput) (*DeleteFacesOutput, error)

DeleteFaces API operation for Amazon Rekognition.

Deletes faces from a collection. You specify a collection ID and an array of face IDs to remove from the collection.

This operation requires permissions to perform the rekognition:DeleteFaces action.

Returns awserr.Error for service API and SDK errors. Use runtime type assertions with awserr.Error's Code and Message methods to get detailed information about the error.

See the AWS API reference guide for Amazon Rekognition's API operation DeleteFaces for usage and error information.

Returned Error Codes:

  • ErrCodeInvalidParameterException "InvalidParameterException" Input parameter violated a constraint. Validate your parameter before calling the API operation again.

  • ErrCodeAccessDeniedException "AccessDeniedException" You are not authorized to perform the action.

  • ErrCodeInternalServerError "InternalServerError" Amazon Rekognition experienced a service issue. Try your call again.

  • ErrCodeThrottlingException "ThrottlingException" Amazon Rekognition is temporarily unable to process the request. Try your call again.

  • ErrCodeProvisionedThroughputExceededException "ProvisionedThroughputExceededException" The number of requests exceeded your throughput limit. If you want to increase this limit, contact Amazon Rekognition.

  • ErrCodeResourceNotFoundException "ResourceNotFoundException" Collection specified in the request is not found.

Example (Shared00)

To delete a face

This operation deletes one or more faces from a Rekognition collection.

package main

import (
	"fmt"

	"github.com/aws/aws-sdk-go/aws"
	"github.com/aws/aws-sdk-go/aws/awserr"
	"github.com/aws/aws-sdk-go/aws/session"
	"github.com/aws/aws-sdk-go/service/rekognition"
)

func main() {
	svc := rekognition.New(session.New())
	input := &rekognition.DeleteFacesInput{
		CollectionId: aws.String("myphotos"),
		FaceIds: []*string{
			aws.String("ff43d742-0c13-5d16-a3e8-03d3f58e980b"),
		},
	}

	result, err := svc.DeleteFaces(input)
	if err != nil {
		if aerr, ok := err.(awserr.Error); ok {
			switch aerr.Code() {
			case rekognition.ErrCodeInvalidParameterException:
				fmt.Println(rekognition.ErrCodeInvalidParameterException, aerr.Error())
			case rekognition.ErrCodeAccessDeniedException:
				fmt.Println(rekognition.ErrCodeAccessDeniedException, aerr.Error())
			case rekognition.ErrCodeInternalServerError:
				fmt.Println(rekognition.ErrCodeInternalServerError, aerr.Error())
			case rekognition.ErrCodeThrottlingException:
				fmt.Println(rekognition.ErrCodeThrottlingException, aerr.Error())
			case rekognition.ErrCodeProvisionedThroughputExceededException:
				fmt.Println(rekognition.ErrCodeProvisionedThroughputExceededException, aerr.Error())
			case rekognition.ErrCodeResourceNotFoundException:
				fmt.Println(rekognition.ErrCodeResourceNotFoundException, aerr.Error())
			default:
				fmt.Println(aerr.Error())
			}
		} else {
			// Print the error, cast err to awserr.Error to get the Code and
			// Message from an error.
			fmt.Println(err.Error())
		}
		return
	}

	fmt.Println(result)
}
Output:

func (*Rekognition) DeleteFacesRequest

func (c *Rekognition) DeleteFacesRequest(input *DeleteFacesInput) (req *request.Request, output *DeleteFacesOutput)

DeleteFacesRequest generates a "aws/request.Request" representing the client's request for the DeleteFaces operation. The "output" return value will be populated with the request's response once the request complets successfuly.

Use "Send" method on the returned Request to send the API call to the service. the "output" return value is not valid until after Send returns without error.

See DeleteFaces for more information on using the DeleteFaces API call, and error handling.

This method is useful when you want to inject custom logic or configuration into the SDK's request lifecycle. Such as custom headers, or retry logic.

// Example sending a request using the DeleteFacesRequest method.
req, resp := client.DeleteFacesRequest(params)

err := req.Send()
if err == nil { // resp is now filled
    fmt.Println(resp)
}

func (*Rekognition) DeleteFacesWithContext

func (c *Rekognition) DeleteFacesWithContext(ctx aws.Context, input *DeleteFacesInput, opts ...request.Option) (*DeleteFacesOutput, error)

DeleteFacesWithContext is the same as DeleteFaces with the addition of the ability to pass a context and additional request options.

See DeleteFaces for details on how to use this API operation.

The context must be non-nil and will be used for request cancellation. If the context is nil a panic will occur. In the future the SDK may create sub-contexts for http.Requests. See https://golang.org/pkg/context/ for more information on using Contexts.

func (*Rekognition) DetectFaces

func (c *Rekognition) DetectFaces(input *DetectFacesInput) (*DetectFacesOutput, error)

DetectFaces API operation for Amazon Rekognition.

Detects faces within an image (JPEG or PNG) that is provided as input.

For each face detected, the operation returns face details including a bounding box of the face, a confidence value (that the bounding box contains a face), and a fixed set of attributes such as facial landmarks (for example, coordinates of eye and mouth), gender, presence of beard, sunglasses, etc.

The face-detection algorithm is most effective on frontal faces. For non-frontal or obscured faces, the algorithm may not detect the faces or might detect faces with lower confidence.

This is a stateless API operation. That is, the operation does not persist any data.

For an example, see get-started-exercise-detect-faces.

This operation requires permissions to perform the rekognition:DetectFaces action.

Returns awserr.Error for service API and SDK errors. Use runtime type assertions with awserr.Error's Code and Message methods to get detailed information about the error.

See the AWS API reference guide for Amazon Rekognition's API operation DetectFaces for usage and error information.

Returned Error Codes:

  • ErrCodeInvalidS3ObjectException "InvalidS3ObjectException" Amazon Rekognition is unable to access the S3 object specified in the request.

  • ErrCodeInvalidParameterException "InvalidParameterException" Input parameter violated a constraint. Validate your parameter before calling the API operation again.

  • ErrCodeImageTooLargeException "ImageTooLargeException" The input image size exceeds the allowed limit. For more information, see limits.

  • ErrCodeAccessDeniedException "AccessDeniedException" You are not authorized to perform the action.

  • ErrCodeInternalServerError "InternalServerError" Amazon Rekognition experienced a service issue. Try your call again.

  • ErrCodeThrottlingException "ThrottlingException" Amazon Rekognition is temporarily unable to process the request. Try your call again.

  • ErrCodeProvisionedThroughputExceededException "ProvisionedThroughputExceededException" The number of requests exceeded your throughput limit. If you want to increase this limit, contact Amazon Rekognition.

  • ErrCodeInvalidImageFormatException "InvalidImageFormatException" The provided image format is not supported.

Example (Shared00)

To detect faces in an image

This operation detects faces in an image stored in an AWS S3 bucket.

package main

import (
	"fmt"

	"github.com/aws/aws-sdk-go/aws"
	"github.com/aws/aws-sdk-go/aws/awserr"
	"github.com/aws/aws-sdk-go/aws/session"
	"github.com/aws/aws-sdk-go/service/rekognition"
)

func main() {
	svc := rekognition.New(session.New())
	input := &rekognition.DetectFacesInput{
		Image: &rekognition.Image{
			S3Object: &rekognition.S3Object{
				Bucket: aws.String("mybucket"),
				Name:   aws.String("myphoto"),
			},
		},
	}

	result, err := svc.DetectFaces(input)
	if err != nil {
		if aerr, ok := err.(awserr.Error); ok {
			switch aerr.Code() {
			case rekognition.ErrCodeInvalidS3ObjectException:
				fmt.Println(rekognition.ErrCodeInvalidS3ObjectException, aerr.Error())
			case rekognition.ErrCodeInvalidParameterException:
				fmt.Println(rekognition.ErrCodeInvalidParameterException, aerr.Error())
			case rekognition.ErrCodeImageTooLargeException:
				fmt.Println(rekognition.ErrCodeImageTooLargeException, aerr.Error())
			case rekognition.ErrCodeAccessDeniedException:
				fmt.Println(rekognition.ErrCodeAccessDeniedException, aerr.Error())
			case rekognition.ErrCodeInternalServerError:
				fmt.Println(rekognition.ErrCodeInternalServerError, aerr.Error())
			case rekognition.ErrCodeThrottlingException:
				fmt.Println(rekognition.ErrCodeThrottlingException, aerr.Error())
			case rekognition.ErrCodeProvisionedThroughputExceededException:
				fmt.Println(rekognition.ErrCodeProvisionedThroughputExceededException, aerr.Error())
			case rekognition.ErrCodeInvalidImageFormatException:
				fmt.Println(rekognition.ErrCodeInvalidImageFormatException, aerr.Error())
			default:
				fmt.Println(aerr.Error())
			}
		} else {
			// Print the error, cast err to awserr.Error to get the Code and
			// Message from an error.
			fmt.Println(err.Error())
		}
		return
	}

	fmt.Println(result)
}
Output:

func (*Rekognition) DetectFacesRequest

func (c *Rekognition) DetectFacesRequest(input *DetectFacesInput) (req *request.Request, output *DetectFacesOutput)

DetectFacesRequest generates a "aws/request.Request" representing the client's request for the DetectFaces operation. The "output" return value will be populated with the request's response once the request complets successfuly.

Use "Send" method on the returned Request to send the API call to the service. the "output" return value is not valid until after Send returns without error.

See DetectFaces for more information on using the DetectFaces API call, and error handling.

This method is useful when you want to inject custom logic or configuration into the SDK's request lifecycle. Such as custom headers, or retry logic.

// Example sending a request using the DetectFacesRequest method.
req, resp := client.DetectFacesRequest(params)

err := req.Send()
if err == nil { // resp is now filled
    fmt.Println(resp)
}

func (*Rekognition) DetectFacesWithContext

func (c *Rekognition) DetectFacesWithContext(ctx aws.Context, input *DetectFacesInput, opts ...request.Option) (*DetectFacesOutput, error)

DetectFacesWithContext is the same as DetectFaces with the addition of the ability to pass a context and additional request options.

See DetectFaces for details on how to use this API operation.

The context must be non-nil and will be used for request cancellation. If the context is nil a panic will occur. In the future the SDK may create sub-contexts for http.Requests. See https://golang.org/pkg/context/ for more information on using Contexts.

func (*Rekognition) DetectLabels

func (c *Rekognition) DetectLabels(input *DetectLabelsInput) (*DetectLabelsOutput, error)

DetectLabels API operation for Amazon Rekognition.

Detects instances of real-world labels 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 get-started-exercise-detect-labels.

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.

You can provide the input image as an S3 object or as base64-encoded bytes. 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.

If the object detected is a person, the operation doesn't provide the same facial details that the DetectFaces operation provides.

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.

Returns awserr.Error for service API and SDK errors. Use runtime type assertions with awserr.Error's Code and Message methods to get detailed information about the error.

See the AWS API reference guide for Amazon Rekognition's API operation DetectLabels for usage and error information.

Returned Error Codes:

  • ErrCodeInvalidS3ObjectException "InvalidS3ObjectException" Amazon Rekognition is unable to access the S3 object specified in the request.

  • ErrCodeInvalidParameterException "InvalidParameterException" Input parameter violated a constraint. Validate your parameter before calling the API operation again.

  • ErrCodeImageTooLargeException "ImageTooLargeException" The input image size exceeds the allowed limit. For more information, see limits.

  • ErrCodeAccessDeniedException "AccessDeniedException" You are not authorized to perform the action.

  • ErrCodeInternalServerError "InternalServerError" Amazon Rekognition experienced a service issue. Try your call again.

  • ErrCodeThrottlingException "ThrottlingException" Amazon Rekognition is temporarily unable to process the request. Try your call again.

  • ErrCodeProvisionedThroughputExceededException "ProvisionedThroughputExceededException" The number of requests exceeded your throughput limit. If you want to increase this limit, contact Amazon Rekognition.

  • ErrCodeInvalidImageFormatException "InvalidImageFormatException" The provided image format is not supported.

Example (Shared00)

To detect labels

This operation detects labels in the supplied image

package main

import (
	"fmt"

	"github.com/aws/aws-sdk-go/aws"
	"github.com/aws/aws-sdk-go/aws/awserr"
	"github.com/aws/aws-sdk-go/aws/session"
	"github.com/aws/aws-sdk-go/service/rekognition"
)

func main() {
	svc := rekognition.New(session.New())
	input := &rekognition.DetectLabelsInput{
		Image: &rekognition.Image{
			S3Object: &rekognition.S3Object{
				Bucket: aws.String("mybucket"),
				Name:   aws.String("myphoto"),
			},
		},
		MaxLabels:     aws.Int64(123),
		MinConfidence: aws.Float64(70.000000),
	}

	result, err := svc.DetectLabels(input)
	if err != nil {
		if aerr, ok := err.(awserr.Error); ok {
			switch aerr.Code() {
			case rekognition.ErrCodeInvalidS3ObjectException:
				fmt.Println(rekognition.ErrCodeInvalidS3ObjectException, aerr.Error())
			case rekognition.ErrCodeInvalidParameterException:
				fmt.Println(rekognition.ErrCodeInvalidParameterException, aerr.Error())
			case rekognition.ErrCodeImageTooLargeException:
				fmt.Println(rekognition.ErrCodeImageTooLargeException, aerr.Error())
			case rekognition.ErrCodeAccessDeniedException:
				fmt.Println(rekognition.ErrCodeAccessDeniedException, aerr.Error())
			case rekognition.ErrCodeInternalServerError:
				fmt.Println(rekognition.ErrCodeInternalServerError, aerr.Error())
			case rekognition.ErrCodeThrottlingException:
				fmt.Println(rekognition.ErrCodeThrottlingException, aerr.Error())
			case rekognition.ErrCodeProvisionedThroughputExceededException:
				fmt.Println(rekognition.ErrCodeProvisionedThroughputExceededException, aerr.Error())
			case rekognition.ErrCodeInvalidImageFormatException:
				fmt.Println(rekognition.ErrCodeInvalidImageFormatException, aerr.Error())
			default:
				fmt.Println(aerr.Error())
			}
		} else {
			// Print the error, cast err to awserr.Error to get the Code and
			// Message from an error.
			fmt.Println(err.Error())
		}
		return
	}

	fmt.Println(result)
}
Output:

func (*Rekognition) DetectLabelsRequest

func (c *Rekognition) DetectLabelsRequest(input *DetectLabelsInput) (req *request.Request, output *DetectLabelsOutput)

DetectLabelsRequest generates a "aws/request.Request" representing the client's request for the DetectLabels operation. The "output" return value will be populated with the request's response once the request complets successfuly.

Use "Send" method on the returned Request to send the API call to the service. the "output" return value is not valid until after Send returns without error.

See DetectLabels for more information on using the DetectLabels API call, and error handling.

This method is useful when you want to inject custom logic or configuration into the SDK's request lifecycle. Such as custom headers, or retry logic.

// Example sending a request using the DetectLabelsRequest method.
req, resp := client.DetectLabelsRequest(params)

err := req.Send()
if err == nil { // resp is now filled
    fmt.Println(resp)
}

func (*Rekognition) DetectLabelsWithContext

func (c *Rekognition) DetectLabelsWithContext(ctx aws.Context, input *DetectLabelsInput, opts ...request.Option) (*DetectLabelsOutput, error)

DetectLabelsWithContext is the same as DetectLabels with the addition of the ability to pass a context and additional request options.

See DetectLabels for details on how to use this API operation.

The context must be non-nil and will be used for request cancellation. If the context is nil a panic will occur. In the future the SDK may create sub-contexts for http.Requests. See https://golang.org/pkg/context/ for more information on using Contexts.

func (*Rekognition) DetectModerationLabels

func (c *Rekognition) DetectModerationLabels(input *DetectModerationLabelsInput) (*DetectModerationLabelsOutput, error)

DetectModerationLabels API operation for Amazon Rekognition.

Detects explicit or suggestive adult content in a specified JPEG or PNG format image. Use DetectModerationLabels to moderate images depending on your requirements. For example, you might want to filter images that contain nudity, but not images containing suggestive content.

To filter images, use the labels returned by DetectModerationLabels to determine which types of content are appropriate. For information about moderation labels, see image-moderation.

Returns awserr.Error for service API and SDK errors. Use runtime type assertions with awserr.Error's Code and Message methods to get detailed information about the error.

See the AWS API reference guide for Amazon Rekognition's API operation DetectModerationLabels for usage and error information.

Returned Error Codes:

  • ErrCodeInvalidS3ObjectException "InvalidS3ObjectException" Amazon Rekognition is unable to access the S3 object specified in the request.

  • ErrCodeInvalidParameterException "InvalidParameterException" Input parameter violated a constraint. Validate your parameter before calling the API operation again.

  • ErrCodeImageTooLargeException "ImageTooLargeException" The input image size exceeds the allowed limit. For more information, see limits.

  • ErrCodeAccessDeniedException "AccessDeniedException" You are not authorized to perform the action.

  • ErrCodeInternalServerError "InternalServerError" Amazon Rekognition experienced a service issue. Try your call again.

  • ErrCodeThrottlingException "ThrottlingException" Amazon Rekognition is temporarily unable to process the request. Try your call again.

  • ErrCodeProvisionedThroughputExceededException "ProvisionedThroughputExceededException" The number of requests exceeded your throughput limit. If you want to increase this limit, contact Amazon Rekognition.

  • ErrCodeInvalidImageFormatException "InvalidImageFormatException" The provided image format is not supported.

func (*Rekognition) DetectModerationLabelsRequest

func (c *Rekognition) DetectModerationLabelsRequest(input *DetectModerationLabelsInput) (req *request.Request, output *DetectModerationLabelsOutput)

DetectModerationLabelsRequest generates a "aws/request.Request" representing the client's request for the DetectModerationLabels operation. The "output" return value will be populated with the request's response once the request complets successfuly.

Use "Send" method on the returned Request to send the API call to the service. the "output" return value is not valid until after Send returns without error.

See DetectModerationLabels for more information on using the DetectModerationLabels API call, and error handling.

This method is useful when you want to inject custom logic or configuration into the SDK's request lifecycle. Such as custom headers, or retry logic.

// Example sending a request using the DetectModerationLabelsRequest method.
req, resp := client.DetectModerationLabelsRequest(params)

err := req.Send()
if err == nil { // resp is now filled
    fmt.Println(resp)
}

func (*Rekognition) DetectModerationLabelsWithContext

func (c *Rekognition) DetectModerationLabelsWithContext(ctx aws.Context, input *DetectModerationLabelsInput, opts ...request.Option) (*DetectModerationLabelsOutput, error)

DetectModerationLabelsWithContext is the same as DetectModerationLabels with the addition of the ability to pass a context and additional request options.

See DetectModerationLabels for details on how to use this API operation.

The context must be non-nil and will be used for request cancellation. If the context is nil a panic will occur. In the future the SDK may create sub-contexts for http.Requests. See https://golang.org/pkg/context/ for more information on using Contexts.

func (*Rekognition) GetCelebrityInfo

func (c *Rekognition) GetCelebrityInfo(input *GetCelebrityInfoInput) (*GetCelebrityInfoOutput, error)

GetCelebrityInfo API operation for Amazon Rekognition.

Gets the name and additional information about a celebrity based on his or her Rekognition ID. The additional information is returned as an array of URLs. If there is no additional information about the celebrity, this list is empty. For more information, see celebrity-recognition.

This operation requires permissions to perform the rekognition:GetCelebrityInfo action.

Returns awserr.Error for service API and SDK errors. Use runtime type assertions with awserr.Error's Code and Message methods to get detailed information about the error.

See the AWS API reference guide for Amazon Rekognition's API operation GetCelebrityInfo for usage and error information.

Returned Error Codes:

  • ErrCodeInvalidParameterException "InvalidParameterException" Input parameter violated a constraint. Validate your parameter before calling the API operation again.

  • ErrCodeAccessDeniedException "AccessDeniedException" You are not authorized to perform the action.

  • ErrCodeInternalServerError "InternalServerError" Amazon Rekognition experienced a service issue. Try your call again.

  • ErrCodeThrottlingException "ThrottlingException" Amazon Rekognition is temporarily unable to process the request. Try your call again.

  • ErrCodeProvisionedThroughputExceededException "ProvisionedThroughputExceededException" The number of requests exceeded your throughput limit. If you want to increase this limit, contact Amazon Rekognition.

  • ErrCodeResourceNotFoundException "ResourceNotFoundException" Collection specified in the request is not found.

func (*Rekognition) GetCelebrityInfoRequest

func (c *Rekognition) GetCelebrityInfoRequest(input *GetCelebrityInfoInput) (req *request.Request, output *GetCelebrityInfoOutput)

GetCelebrityInfoRequest generates a "aws/request.Request" representing the client's request for the GetCelebrityInfo operation. The "output" return value will be populated with the request's response once the request complets successfuly.

Use "Send" method on the returned Request to send the API call to the service. the "output" return value is not valid until after Send returns without error.

See GetCelebrityInfo for more information on using the GetCelebrityInfo API call, and error handling.

This method is useful when you want to inject custom logic or configuration into the SDK's request lifecycle. Such as custom headers, or retry logic.

// Example sending a request using the GetCelebrityInfoRequest method.
req, resp := client.GetCelebrityInfoRequest(params)

err := req.Send()
if err == nil { // resp is now filled
    fmt.Println(resp)
}

func (*Rekognition) GetCelebrityInfoWithContext

func (c *Rekognition) GetCelebrityInfoWithContext(ctx aws.Context, input *GetCelebrityInfoInput, opts ...request.Option) (*GetCelebrityInfoOutput, error)

GetCelebrityInfoWithContext is the same as GetCelebrityInfo with the addition of the ability to pass a context and additional request options.

See GetCelebrityInfo for details on how to use this API operation.

The context must be non-nil and will be used for request cancellation. If the context is nil a panic will occur. In the future the SDK may create sub-contexts for http.Requests. See https://golang.org/pkg/context/ for more information on using Contexts.

func (*Rekognition) IndexFaces

func (c *Rekognition) IndexFaces(input *IndexFacesInput) (*IndexFacesOutput, error)

IndexFaces API operation for Amazon Rekognition.

Detects faces in the input image and adds them to the specified collection.

Amazon Rekognition does not save the actual faces detected. Instead, the underlying detection algorithm first detects the faces in the input image, and for each face extracts facial features into a feature vector, and stores it in the back-end database. Amazon Rekognition uses feature vectors when performing face match and search operations using the and operations.

If you provide the optional externalImageID for the input image you provided, Amazon Rekognition associates this ID with all faces that it detects. When you call the operation, the response returns the external ID. You can use this external image ID to create a client-side index to associate the faces with each image. You can then use the index to find all faces in an image.

In response, the operation returns an array of metadata for all detected faces. This includes, the bounding box of the detected face, confidence value (indicating the bounding box contains a face), a face ID assigned by the service for each face that is detected and stored, and an image ID assigned by the service for the input image. If you request all facial attributes (using the detectionAttributes parameter, Amazon Rekognition returns detailed facial attributes such as facial landmarks (for example, location of eye and mount) and other facial attributes such gender. If you provide the same image, specify the same collection, and use the same external ID in the IndexFaces operation, Amazon Rekognition doesn't save duplicate face metadata.

For an example, see example2.

This operation requires permissions to perform the rekognition:IndexFaces action.

Returns awserr.Error for service API and SDK errors. Use runtime type assertions with awserr.Error's Code and Message methods to get detailed information about the error.

See the AWS API reference guide for Amazon Rekognition's API operation IndexFaces for usage and error information.

Returned Error Codes:

  • ErrCodeInvalidS3ObjectException "InvalidS3ObjectException" Amazon Rekognition is unable to access the S3 object specified in the request.

  • ErrCodeInvalidParameterException "InvalidParameterException" Input parameter violated a constraint. Validate your parameter before calling the API operation again.

  • ErrCodeImageTooLargeException "ImageTooLargeException" The input image size exceeds the allowed limit. For more information, see limits.

  • ErrCodeAccessDeniedException "AccessDeniedException" You are not authorized to perform the action.

  • ErrCodeInternalServerError "InternalServerError" Amazon Rekognition experienced a service issue. Try your call again.

  • ErrCodeThrottlingException "ThrottlingException" Amazon Rekognition is temporarily unable to process the request. Try your call again.

  • ErrCodeProvisionedThroughputExceededException "ProvisionedThroughputExceededException" The number of requests exceeded your throughput limit. If you want to increase this limit, contact Amazon Rekognition.

  • ErrCodeResourceNotFoundException "ResourceNotFoundException" Collection specified in the request is not found.

  • ErrCodeInvalidImageFormatException "InvalidImageFormatException" The provided image format is not supported.

Example (Shared00)

To add a face to a collection

This operation detects faces in an image and adds them to the specified Rekognition collection.

package main

import (
	"fmt"

	"github.com/aws/aws-sdk-go/aws"
	"github.com/aws/aws-sdk-go/aws/awserr"
	"github.com/aws/aws-sdk-go/aws/session"
	"github.com/aws/aws-sdk-go/service/rekognition"
)

func main() {
	svc := rekognition.New(session.New())
	input := &rekognition.IndexFacesInput{
		CollectionId:    aws.String("myphotos"),
		ExternalImageId: aws.String("myphotoid"),
		Image: &rekognition.Image{
			S3Object: &rekognition.S3Object{
				Bucket: aws.String("mybucket"),
				Name:   aws.String("myphoto"),
			},
		},
	}

	result, err := svc.IndexFaces(input)
	if err != nil {
		if aerr, ok := err.(awserr.Error); ok {
			switch aerr.Code() {
			case rekognition.ErrCodeInvalidS3ObjectException:
				fmt.Println(rekognition.ErrCodeInvalidS3ObjectException, aerr.Error())
			case rekognition.ErrCodeInvalidParameterException:
				fmt.Println(rekognition.ErrCodeInvalidParameterException, aerr.Error())
			case rekognition.ErrCodeImageTooLargeException:
				fmt.Println(rekognition.ErrCodeImageTooLargeException, aerr.Error())
			case rekognition.ErrCodeAccessDeniedException:
				fmt.Println(rekognition.ErrCodeAccessDeniedException, aerr.Error())
			case rekognition.ErrCodeInternalServerError:
				fmt.Println(rekognition.ErrCodeInternalServerError, aerr.Error())
			case rekognition.ErrCodeThrottlingException:
				fmt.Println(rekognition.ErrCodeThrottlingException, aerr.Error())
			case rekognition.ErrCodeProvisionedThroughputExceededException:
				fmt.Println(rekognition.ErrCodeProvisionedThroughputExceededException, aerr.Error())
			case rekognition.ErrCodeResourceNotFoundException:
				fmt.Println(rekognition.ErrCodeResourceNotFoundException, aerr.Error())
			case rekognition.ErrCodeInvalidImageFormatException:
				fmt.Println(rekognition.ErrCodeInvalidImageFormatException, aerr.Error())
			default:
				fmt.Println(aerr.Error())
			}
		} else {
			// Print the error, cast err to awserr.Error to get the Code and
			// Message from an error.
			fmt.Println(err.Error())
		}
		return
	}

	fmt.Println(result)
}
Output:

func (*Rekognition) IndexFacesRequest

func (c *Rekognition) IndexFacesRequest(input *IndexFacesInput) (req *request.Request, output *IndexFacesOutput)

IndexFacesRequest generates a "aws/request.Request" representing the client's request for the IndexFaces operation. The "output" return value will be populated with the request's response once the request complets successfuly.

Use "Send" method on the returned Request to send the API call to the service. the "output" return value is not valid until after Send returns without error.

See IndexFaces for more information on using the IndexFaces API call, and error handling.

This method is useful when you want to inject custom logic or configuration into the SDK's request lifecycle. Such as custom headers, or retry logic.

// Example sending a request using the IndexFacesRequest method.
req, resp := client.IndexFacesRequest(params)

err := req.Send()
if err == nil { // resp is now filled
    fmt.Println(resp)
}

func (*Rekognition) IndexFacesWithContext

func (c *Rekognition) IndexFacesWithContext(ctx aws.Context, input *IndexFacesInput, opts ...request.Option) (*IndexFacesOutput, error)

IndexFacesWithContext is the same as IndexFaces with the addition of the ability to pass a context and additional request options.

See IndexFaces for details on how to use this API operation.

The context must be non-nil and will be used for request cancellation. If the context is nil a panic will occur. In the future the SDK may create sub-contexts for http.Requests. See https://golang.org/pkg/context/ for more information on using Contexts.

func (*Rekognition) ListCollections

func (c *Rekognition) ListCollections(input *ListCollectionsInput) (*ListCollectionsOutput, error)

ListCollections API operation for Amazon Rekognition.

Returns list of collection IDs in your account. If the result is truncated, the response also provides a NextToken that you can use in the subsequent request to fetch the next set of collection IDs.

For an example, see example1.

This operation requires permissions to perform the rekognition:ListCollections action.

Returns awserr.Error for service API and SDK errors. Use runtime type assertions with awserr.Error's Code and Message methods to get detailed information about the error.

See the AWS API reference guide for Amazon Rekognition's API operation ListCollections for usage and error information.

Returned Error Codes:

  • ErrCodeInvalidParameterException "InvalidParameterException" Input parameter violated a constraint. Validate your parameter before calling the API operation again.

  • ErrCodeAccessDeniedException "AccessDeniedException" You are not authorized to perform the action.

  • ErrCodeInternalServerError "InternalServerError" Amazon Rekognition experienced a service issue. Try your call again.

  • ErrCodeThrottlingException "ThrottlingException" Amazon Rekognition is temporarily unable to process the request. Try your call again.

  • ErrCodeProvisionedThroughputExceededException "ProvisionedThroughputExceededException" The number of requests exceeded your throughput limit. If you want to increase this limit, contact Amazon Rekognition.

  • ErrCodeInvalidPaginationTokenException "InvalidPaginationTokenException" Pagination token in the request is not valid.

  • ErrCodeResourceNotFoundException "ResourceNotFoundException" Collection specified in the request is not found.

Example (Shared00)

To list the collections

This operation returns a list of Rekognition collections.

package main

import (
	"fmt"

	"github.com/aws/aws-sdk-go/aws/awserr"
	"github.com/aws/aws-sdk-go/aws/session"
	"github.com/aws/aws-sdk-go/service/rekognition"
)

func main() {
	svc := rekognition.New(session.New())
	input := &rekognition.ListCollectionsInput{}

	result, err := svc.ListCollections(input)
	if err != nil {
		if aerr, ok := err.(awserr.Error); ok {
			switch aerr.Code() {
			case rekognition.ErrCodeInvalidParameterException:
				fmt.Println(rekognition.ErrCodeInvalidParameterException, aerr.Error())
			case rekognition.ErrCodeAccessDeniedException:
				fmt.Println(rekognition.ErrCodeAccessDeniedException, aerr.Error())
			case rekognition.ErrCodeInternalServerError:
				fmt.Println(rekognition.ErrCodeInternalServerError, aerr.Error())
			case rekognition.ErrCodeThrottlingException:
				fmt.Println(rekognition.ErrCodeThrottlingException, aerr.Error())
			case rekognition.ErrCodeProvisionedThroughputExceededException:
				fmt.Println(rekognition.ErrCodeProvisionedThroughputExceededException, aerr.Error())
			case rekognition.ErrCodeInvalidPaginationTokenException:
				fmt.Println(rekognition.ErrCodeInvalidPaginationTokenException, aerr.Error())
			case rekognition.ErrCodeResourceNotFoundException:
				fmt.Println(rekognition.ErrCodeResourceNotFoundException, aerr.Error())
			default:
				fmt.Println(aerr.Error())
			}
		} else {
			// Print the error, cast err to awserr.Error to get the Code and
			// Message from an error.
			fmt.Println(err.Error())
		}
		return
	}

	fmt.Println(result)
}
Output:

func (*Rekognition) ListCollectionsPages

func (c *Rekognition) ListCollectionsPages(input *ListCollectionsInput, fn func(*ListCollectionsOutput, bool) bool) error

ListCollectionsPages iterates over the pages of a ListCollections operation, calling the "fn" function with the response data for each page. To stop iterating, return false from the fn function.

See ListCollections method for more information on how to use this operation.

Note: This operation can generate multiple requests to a service.

// Example iterating over at most 3 pages of a ListCollections operation.
pageNum := 0
err := client.ListCollectionsPages(params,
    func(page *ListCollectionsOutput, lastPage bool) bool {
        pageNum++
        fmt.Println(page)
        return pageNum <= 3
    })

func (*Rekognition) ListCollectionsPagesWithContext

func (c *Rekognition) ListCollectionsPagesWithContext(ctx aws.Context, input *ListCollectionsInput, fn func(*ListCollectionsOutput, bool) bool, opts ...request.Option) error

ListCollectionsPagesWithContext same as ListCollectionsPages except it takes a Context and allows setting request options on the pages.

The context must be non-nil and will be used for request cancellation. If the context is nil a panic will occur. In the future the SDK may create sub-contexts for http.Requests. See https://golang.org/pkg/context/ for more information on using Contexts.

func (*Rekognition) ListCollectionsRequest

func (c *Rekognition) ListCollectionsRequest(input *ListCollectionsInput) (req *request.Request, output *ListCollectionsOutput)

ListCollectionsRequest generates a "aws/request.Request" representing the client's request for the ListCollections operation. The "output" return value will be populated with the request's response once the request complets successfuly.

Use "Send" method on the returned Request to send the API call to the service. the "output" return value is not valid until after Send returns without error.

See ListCollections for more information on using the ListCollections API call, and error handling.

This method is useful when you want to inject custom logic or configuration into the SDK's request lifecycle. Such as custom headers, or retry logic.

// Example sending a request using the ListCollectionsRequest method.
req, resp := client.ListCollectionsRequest(params)

err := req.Send()
if err == nil { // resp is now filled
    fmt.Println(resp)
}

func (*Rekognition) ListCollectionsWithContext

func (c *Rekognition) ListCollectionsWithContext(ctx aws.Context, input *ListCollectionsInput, opts ...request.Option) (*ListCollectionsOutput, error)

ListCollectionsWithContext is the same as ListCollections with the addition of the ability to pass a context and additional request options.

See ListCollections for details on how to use this API operation.

The context must be non-nil and will be used for request cancellation. If the context is nil a panic will occur. In the future the SDK may create sub-contexts for http.Requests. See https://golang.org/pkg/context/ for more information on using Contexts.

func (*Rekognition) ListFaces

func (c *Rekognition) ListFaces(input *ListFacesInput) (*ListFacesOutput, error)

ListFaces API operation for Amazon Rekognition.

Returns metadata for faces in the specified collection. This metadata includes information such as the bounding box coordinates, the confidence (that the bounding box contains a face), and face ID. For an example, see example3.

This operation requires permissions to perform the rekognition:ListFaces action.

Returns awserr.Error for service API and SDK errors. Use runtime type assertions with awserr.Error's Code and Message methods to get detailed information about the error.

See the AWS API reference guide for Amazon Rekognition's API operation ListFaces for usage and error information.

Returned Error Codes:

  • ErrCodeInvalidParameterException "InvalidParameterException" Input parameter violated a constraint. Validate your parameter before calling the API operation again.

  • ErrCodeAccessDeniedException "AccessDeniedException" You are not authorized to perform the action.

  • ErrCodeInternalServerError "InternalServerError" Amazon Rekognition experienced a service issue. Try your call again.

  • ErrCodeThrottlingException "ThrottlingException" Amazon Rekognition is temporarily unable to process the request. Try your call again.

  • ErrCodeProvisionedThroughputExceededException "ProvisionedThroughputExceededException" The number of requests exceeded your throughput limit. If you want to increase this limit, contact Amazon Rekognition.

  • ErrCodeInvalidPaginationTokenException "InvalidPaginationTokenException" Pagination token in the request is not valid.

  • ErrCodeResourceNotFoundException "ResourceNotFoundException" Collection specified in the request is not found.

Example (Shared00)

To list the faces in a collection

This operation lists the faces in a Rekognition collection.

package main

import (
	"fmt"

	"github.com/aws/aws-sdk-go/aws"
	"github.com/aws/aws-sdk-go/aws/awserr"
	"github.com/aws/aws-sdk-go/aws/session"
	"github.com/aws/aws-sdk-go/service/rekognition"
)

func main() {
	svc := rekognition.New(session.New())
	input := &rekognition.ListFacesInput{
		CollectionId: aws.String("myphotos"),
		MaxResults:   aws.Int64(20),
	}

	result, err := svc.ListFaces(input)
	if err != nil {
		if aerr, ok := err.(awserr.Error); ok {
			switch aerr.Code() {
			case rekognition.ErrCodeInvalidParameterException:
				fmt.Println(rekognition.ErrCodeInvalidParameterException, aerr.Error())
			case rekognition.ErrCodeAccessDeniedException:
				fmt.Println(rekognition.ErrCodeAccessDeniedException, aerr.Error())
			case rekognition.ErrCodeInternalServerError:
				fmt.Println(rekognition.ErrCodeInternalServerError, aerr.Error())
			case rekognition.ErrCodeThrottlingException:
				fmt.Println(rekognition.ErrCodeThrottlingException, aerr.Error())
			case rekognition.ErrCodeProvisionedThroughputExceededException:
				fmt.Println(rekognition.ErrCodeProvisionedThroughputExceededException, aerr.Error())
			case rekognition.ErrCodeInvalidPaginationTokenException:
				fmt.Println(rekognition.ErrCodeInvalidPaginationTokenException, aerr.Error())
			case rekognition.ErrCodeResourceNotFoundException:
				fmt.Println(rekognition.ErrCodeResourceNotFoundException, aerr.Error())
			default:
				fmt.Println(aerr.Error())
			}
		} else {
			// Print the error, cast err to awserr.Error to get the Code and
			// Message from an error.
			fmt.Println(err.Error())
		}
		return
	}

	fmt.Println(result)
}
Output:

func (*Rekognition) ListFacesPages

func (c *Rekognition) ListFacesPages(input *ListFacesInput, fn func(*ListFacesOutput, bool) bool) error

ListFacesPages iterates over the pages of a ListFaces operation, calling the "fn" function with the response data for each page. To stop iterating, return false from the fn function.

See ListFaces method for more information on how to use this operation.

Note: This operation can generate multiple requests to a service.

// Example iterating over at most 3 pages of a ListFaces operation.
pageNum := 0
err := client.ListFacesPages(params,
    func(page *ListFacesOutput, lastPage bool) bool {
        pageNum++
        fmt.Println(page)
        return pageNum <= 3
    })

func (*Rekognition) ListFacesPagesWithContext

func (c *Rekognition) ListFacesPagesWithContext(ctx aws.Context, input *ListFacesInput, fn func(*ListFacesOutput, bool) bool, opts ...request.Option) error

ListFacesPagesWithContext same as ListFacesPages except it takes a Context and allows setting request options on the pages.

The context must be non-nil and will be used for request cancellation. If the context is nil a panic will occur. In the future the SDK may create sub-contexts for http.Requests. See https://golang.org/pkg/context/ for more information on using Contexts.

func (*Rekognition) ListFacesRequest

func (c *Rekognition) ListFacesRequest(input *ListFacesInput) (req *request.Request, output *ListFacesOutput)

ListFacesRequest generates a "aws/request.Request" representing the client's request for the ListFaces operation. The "output" return value will be populated with the request's response once the request complets successfuly.

Use "Send" method on the returned Request to send the API call to the service. the "output" return value is not valid until after Send returns without error.

See ListFaces for more information on using the ListFaces API call, and error handling.

This method is useful when you want to inject custom logic or configuration into the SDK's request lifecycle. Such as custom headers, or retry logic.

// Example sending a request using the ListFacesRequest method.
req, resp := client.ListFacesRequest(params)

err := req.Send()
if err == nil { // resp is now filled
    fmt.Println(resp)
}

func (*Rekognition) ListFacesWithContext

func (c *Rekognition) ListFacesWithContext(ctx aws.Context, input *ListFacesInput, opts ...request.Option) (*ListFacesOutput, error)

ListFacesWithContext is the same as ListFaces with the addition of the ability to pass a context and additional request options.

See ListFaces for details on how to use this API operation.

The context must be non-nil and will be used for request cancellation. If the context is nil a panic will occur. In the future the SDK may create sub-contexts for http.Requests. See https://golang.org/pkg/context/ for more information on using Contexts.

func (*Rekognition) RecognizeCelebrities

func (c *Rekognition) RecognizeCelebrities(input *RecognizeCelebritiesInput) (*RecognizeCelebritiesOutput, error)

RecognizeCelebrities API operation for Amazon Rekognition.

Returns an array of celebrities recognized in the input image. The image is passed either as base64-encoded image bytes or as a reference to an image in an Amazon S3 bucket. The image must be either a PNG or JPEG formatted file. For more information, see celebrity-recognition.

RecognizeCelebrities returns the 15 largest faces in the image. It lists recognized celebrities in the CelebrityFaces list and unrecognized faces in the UnrecognizedFaces list. The operation doesn't return celebrities whose face sizes are smaller than the largest 15 faces in the image.

For each celebrity recognized, the API returns a Celebrity object. The Celebrity object contains the celebrity name, ID, URL links to additional information, match confidence, and a ComparedFace object that you can use to locate the celebrity's face on the image.

Rekognition does not retain information about which images a celebrity has been recognized in. Your application must store this information and use the Celebrity ID property as a unique identifier for the celebrity. If you don't store the celebrity name or additional information URLs returned by RecognizeCelebrities, you will need the ID to identify the celebrity in a call to the operation.

For an example, see recognize-celebrities-tutorial.

This operation requires permissions to perform the rekognition:RecognizeCelebrities operation.

Returns awserr.Error for service API and SDK errors. Use runtime type assertions with awserr.Error's Code and Message methods to get detailed information about the error.

See the AWS API reference guide for Amazon Rekognition's API operation RecognizeCelebrities for usage and error information.

Returned Error Codes:

  • ErrCodeInvalidS3ObjectException "InvalidS3ObjectException" Amazon Rekognition is unable to access the S3 object specified in the request.

  • ErrCodeInvalidParameterException "InvalidParameterException" Input parameter violated a constraint. Validate your parameter before calling the API operation again.

  • ErrCodeInvalidImageFormatException "InvalidImageFormatException" The provided image format is not supported.

  • ErrCodeImageTooLargeException "ImageTooLargeException" The input image size exceeds the allowed limit. For more information, see limits.

  • ErrCodeAccessDeniedException "AccessDeniedException" You are not authorized to perform the action.

  • ErrCodeInternalServerError "InternalServerError" Amazon Rekognition experienced a service issue. Try your call again.

  • ErrCodeThrottlingException "ThrottlingException" Amazon Rekognition is temporarily unable to process the request. Try your call again.

  • ErrCodeProvisionedThroughputExceededException "ProvisionedThroughputExceededException" The number of requests exceeded your throughput limit. If you want to increase this limit, contact Amazon Rekognition.

  • ErrCodeInvalidImageFormatException "InvalidImageFormatException" The provided image format is not supported.

func (*Rekognition) RecognizeCelebritiesRequest

func (c *Rekognition) RecognizeCelebritiesRequest(input *RecognizeCelebritiesInput) (req *request.Request, output *RecognizeCelebritiesOutput)

RecognizeCelebritiesRequest generates a "aws/request.Request" representing the client's request for the RecognizeCelebrities operation. The "output" return value will be populated with the request's response once the request complets successfuly.

Use "Send" method on the returned Request to send the API call to the service. the "output" return value is not valid until after Send returns without error.

See RecognizeCelebrities for more information on using the RecognizeCelebrities API call, and error handling.

This method is useful when you want to inject custom logic or configuration into the SDK's request lifecycle. Such as custom headers, or retry logic.

// Example sending a request using the RecognizeCelebritiesRequest method.
req, resp := client.RecognizeCelebritiesRequest(params)

err := req.Send()
if err == nil { // resp is now filled
    fmt.Println(resp)
}

func (*Rekognition) RecognizeCelebritiesWithContext

func (c *Rekognition) RecognizeCelebritiesWithContext(ctx aws.Context, input *RecognizeCelebritiesInput, opts ...request.Option) (*RecognizeCelebritiesOutput, error)

RecognizeCelebritiesWithContext is the same as RecognizeCelebrities with the addition of the ability to pass a context and additional request options.

See RecognizeCelebrities for details on how to use this API operation.

The context must be non-nil and will be used for request cancellation. If the context is nil a panic will occur. In the future the SDK may create sub-contexts for http.Requests. See https://golang.org/pkg/context/ for more information on using Contexts.

func (*Rekognition) SearchFaces

func (c *Rekognition) SearchFaces(input *SearchFacesInput) (*SearchFacesOutput, error)

SearchFaces API operation for Amazon Rekognition.

For a given input face ID, searches for matching faces in the collection the face belongs to. You get a face ID when you add a face to the collection using the IndexFaces operation. The operation compares the features of the input face with faces in the specified collection.

You can also search faces without indexing faces by using the SearchFacesByImage operation.

The operation response returns an array of faces that match, ordered by similarity score with the highest similarity first. More specifically, it is an array of metadata for each face match that is found. Along with the metadata, the response also includes a confidence value for each face match, indicating the confidence that the specific face matches the input face.

For an example, see example3.

This operation requires permissions to perform the rekognition:SearchFaces action.

Returns awserr.Error for service API and SDK errors. Use runtime type assertions with awserr.Error's Code and Message methods to get detailed information about the error.

See the AWS API reference guide for Amazon Rekognition's API operation SearchFaces for usage and error information.

Returned Error Codes:

  • ErrCodeInvalidParameterException "InvalidParameterException" Input parameter violated a constraint. Validate your parameter before calling the API operation again.

  • ErrCodeAccessDeniedException "AccessDeniedException" You are not authorized to perform the action.

  • ErrCodeInternalServerError "InternalServerError" Amazon Rekognition experienced a service issue. Try your call again.

  • ErrCodeThrottlingException "ThrottlingException" Amazon Rekognition is temporarily unable to process the request. Try your call again.

  • ErrCodeProvisionedThroughputExceededException "ProvisionedThroughputExceededException" The number of requests exceeded your throughput limit. If you want to increase this limit, contact Amazon Rekognition.

  • ErrCodeResourceNotFoundException "ResourceNotFoundException" Collection specified in the request is not found.

Example (Shared00)

To delete a face

This operation searches for matching faces in the collection the supplied face belongs to.

package main

import (
	"fmt"

	"github.com/aws/aws-sdk-go/aws"
	"github.com/aws/aws-sdk-go/aws/awserr"
	"github.com/aws/aws-sdk-go/aws/session"
	"github.com/aws/aws-sdk-go/service/rekognition"
)

func main() {
	svc := rekognition.New(session.New())
	input := &rekognition.SearchFacesInput{
		CollectionId:       aws.String("myphotos"),
		FaceId:             aws.String("70008e50-75e4-55d0-8e80-363fb73b3a14"),
		FaceMatchThreshold: aws.Float64(90.000000),
		MaxFaces:           aws.Int64(10),
	}

	result, err := svc.SearchFaces(input)
	if err != nil {
		if aerr, ok := err.(awserr.Error); ok {
			switch aerr.Code() {
			case rekognition.ErrCodeInvalidParameterException:
				fmt.Println(rekognition.ErrCodeInvalidParameterException, aerr.Error())
			case rekognition.ErrCodeAccessDeniedException:
				fmt.Println(rekognition.ErrCodeAccessDeniedException, aerr.Error())
			case rekognition.ErrCodeInternalServerError:
				fmt.Println(rekognition.ErrCodeInternalServerError, aerr.Error())
			case rekognition.ErrCodeThrottlingException:
				fmt.Println(rekognition.ErrCodeThrottlingException, aerr.Error())
			case rekognition.ErrCodeProvisionedThroughputExceededException:
				fmt.Println(rekognition.ErrCodeProvisionedThroughputExceededException, aerr.Error())
			case rekognition.ErrCodeResourceNotFoundException:
				fmt.Println(rekognition.ErrCodeResourceNotFoundException, aerr.Error())
			default:
				fmt.Println(aerr.Error())
			}
		} else {
			// Print the error, cast err to awserr.Error to get the Code and
			// Message from an error.
			fmt.Println(err.Error())
		}
		return
	}

	fmt.Println(result)
}
Output:

func (*Rekognition) SearchFacesByImage

func (c *Rekognition) SearchFacesByImage(input *SearchFacesByImageInput) (*SearchFacesByImageOutput, error)

SearchFacesByImage API operation for Amazon Rekognition.

For a given input image, first detects the largest face in the image, and then searches the specified collection for matching faces. The operation compares the features of the input face with faces in the specified collection.

To search for all faces in an input image, you might first call the operation, and then use the face IDs returned in subsequent calls to the operation.

You can also call the DetectFaces operation and use the bounding boxes in

the response to make face crops, which then you can pass in to the SearchFacesByImage operation.

The response returns an array of faces that match, ordered by similarity score with the highest similarity first. More specifically, it is an array of metadata for each face match found. Along with the metadata, the response also includes a similarity indicating how similar the face is to the input face. In the response, the operation also returns the bounding box (and a confidence level that the bounding box contains a face) of the face that Amazon Rekognition used for the input image.

For an example, see example3.

This operation requires permissions to perform the rekognition:SearchFacesByImage action.

Returns awserr.Error for service API and SDK errors. Use runtime type assertions with awserr.Error's Code and Message methods to get detailed information about the error.

See the AWS API reference guide for Amazon Rekognition's API operation SearchFacesByImage for usage and error information.

Returned Error Codes:

  • ErrCodeInvalidS3ObjectException "InvalidS3ObjectException" Amazon Rekognition is unable to access the S3 object specified in the request.

  • ErrCodeInvalidParameterException "InvalidParameterException" Input parameter violated a constraint. Validate your parameter before calling the API operation again.

  • ErrCodeImageTooLargeException "ImageTooLargeException" The input image size exceeds the allowed limit. For more information, see limits.

  • ErrCodeAccessDeniedException "AccessDeniedException" You are not authorized to perform the action.

  • ErrCodeInternalServerError "InternalServerError" Amazon Rekognition experienced a service issue. Try your call again.

  • ErrCodeThrottlingException "ThrottlingException" Amazon Rekognition is temporarily unable to process the request. Try your call again.

  • ErrCodeProvisionedThroughputExceededException "ProvisionedThroughputExceededException" The number of requests exceeded your throughput limit. If you want to increase this limit, contact Amazon Rekognition.

  • ErrCodeResourceNotFoundException "ResourceNotFoundException" Collection specified in the request is not found.

  • ErrCodeInvalidImageFormatException "InvalidImageFormatException" The provided image format is not supported.

Example (Shared00)

To search for faces matching a supplied image

This operation searches for faces in a Rekognition collection that match the largest face in an S3 bucket stored image.

package main

import (
	"fmt"

	"github.com/aws/aws-sdk-go/aws"
	"github.com/aws/aws-sdk-go/aws/awserr"
	"github.com/aws/aws-sdk-go/aws/session"
	"github.com/aws/aws-sdk-go/service/rekognition"
)

func main() {
	svc := rekognition.New(session.New())
	input := &rekognition.SearchFacesByImageInput{
		CollectionId:       aws.String("myphotos"),
		FaceMatchThreshold: aws.Float64(95.000000),
		Image: &rekognition.Image{
			S3Object: &rekognition.S3Object{
				Bucket: aws.String("mybucket"),
				Name:   aws.String("myphoto"),
			},
		},
		MaxFaces: aws.Int64(5),
	}

	result, err := svc.SearchFacesByImage(input)
	if err != nil {
		if aerr, ok := err.(awserr.Error); ok {
			switch aerr.Code() {
			case rekognition.ErrCodeInvalidS3ObjectException:
				fmt.Println(rekognition.ErrCodeInvalidS3ObjectException, aerr.Error())
			case rekognition.ErrCodeInvalidParameterException:
				fmt.Println(rekognition.ErrCodeInvalidParameterException, aerr.Error())
			case rekognition.ErrCodeImageTooLargeException:
				fmt.Println(rekognition.ErrCodeImageTooLargeException, aerr.Error())
			case rekognition.ErrCodeAccessDeniedException:
				fmt.Println(rekognition.ErrCodeAccessDeniedException, aerr.Error())
			case rekognition.ErrCodeInternalServerError:
				fmt.Println(rekognition.ErrCodeInternalServerError, aerr.Error())
			case rekognition.ErrCodeThrottlingException:
				fmt.Println(rekognition.ErrCodeThrottlingException, aerr.Error())
			case rekognition.ErrCodeProvisionedThroughputExceededException:
				fmt.Println(rekognition.ErrCodeProvisionedThroughputExceededException, aerr.Error())
			case rekognition.ErrCodeResourceNotFoundException:
				fmt.Println(rekognition.ErrCodeResourceNotFoundException, aerr.Error())
			case rekognition.ErrCodeInvalidImageFormatException:
				fmt.Println(rekognition.ErrCodeInvalidImageFormatException, aerr.Error())
			default:
				fmt.Println(aerr.Error())
			}
		} else {
			// Print the error, cast err to awserr.Error to get the Code and
			// Message from an error.
			fmt.Println(err.Error())
		}
		return
	}

	fmt.Println(result)
}
Output:

func (*Rekognition) SearchFacesByImageRequest

func (c *Rekognition) SearchFacesByImageRequest(input *SearchFacesByImageInput) (req *request.Request, output *SearchFacesByImageOutput)

SearchFacesByImageRequest generates a "aws/request.Request" representing the client's request for the SearchFacesByImage operation. The "output" return value will be populated with the request's response once the request complets successfuly.

Use "Send" method on the returned Request to send the API call to the service. the "output" return value is not valid until after Send returns without error.

See SearchFacesByImage for more information on using the SearchFacesByImage API call, and error handling.

This method is useful when you want to inject custom logic or configuration into the SDK's request lifecycle. Such as custom headers, or retry logic.

// Example sending a request using the SearchFacesByImageRequest method.
req, resp := client.SearchFacesByImageRequest(params)

err := req.Send()
if err == nil { // resp is now filled
    fmt.Println(resp)
}

func (*Rekognition) SearchFacesByImageWithContext

func (c *Rekognition) SearchFacesByImageWithContext(ctx aws.Context, input *SearchFacesByImageInput, opts ...request.Option) (*SearchFacesByImageOutput, error)

SearchFacesByImageWithContext is the same as SearchFacesByImage with the addition of the ability to pass a context and additional request options.

See SearchFacesByImage for details on how to use this API operation.

The context must be non-nil and will be used for request cancellation. If the context is nil a panic will occur. In the future the SDK may create sub-contexts for http.Requests. See https://golang.org/pkg/context/ for more information on using Contexts.

func (*Rekognition) SearchFacesRequest

func (c *Rekognition) SearchFacesRequest(input *SearchFacesInput) (req *request.Request, output *SearchFacesOutput)

SearchFacesRequest generates a "aws/request.Request" representing the client's request for the SearchFaces operation. The "output" return value will be populated with the request's response once the request complets successfuly.

Use "Send" method on the returned Request to send the API call to the service. the "output" return value is not valid until after Send returns without error.

See SearchFaces for more information on using the SearchFaces API call, and error handling.

This method is useful when you want to inject custom logic or configuration into the SDK's request lifecycle. Such as custom headers, or retry logic.

// Example sending a request using the SearchFacesRequest method.
req, resp := client.SearchFacesRequest(params)

err := req.Send()
if err == nil { // resp is now filled
    fmt.Println(resp)
}

func (*Rekognition) SearchFacesWithContext

func (c *Rekognition) SearchFacesWithContext(ctx aws.Context, input *SearchFacesInput, opts ...request.Option) (*SearchFacesOutput, error)

SearchFacesWithContext is the same as SearchFaces with the addition of the ability to pass a context and additional request options.

See SearchFaces for details on how to use this API operation.

The context must be non-nil and will be used for request cancellation. If the context is nil a panic will occur. In the future the SDK may create sub-contexts for http.Requests. See https://golang.org/pkg/context/ for more information on using Contexts.

type S3Object

type S3Object struct {

	// Name of the S3 bucket.
	Bucket *string `min:"3" type:"string"`

	// S3 object key name.
	Name *string `min:"1" type:"string"`

	// If the bucket is versioning enabled, you can specify the object version.
	Version *string `min:"1" type:"string"`
	// contains filtered or unexported fields
}

Provides the S3 bucket name and object name.

The region for the S3 bucket containing the S3 object must match the region you use for Amazon Rekognition operations.

For Amazon Rekognition to process an S3 object, the user must have permission to access the S3 object. For more information, see manage-access-resource-policies.

func (S3Object) GoString

func (s S3Object) GoString() string

GoString returns the string representation

func (*S3Object) SetBucket

func (s *S3Object) SetBucket(v string) *S3Object

SetBucket sets the Bucket field's value.

func (*S3Object) SetName

func (s *S3Object) SetName(v string) *S3Object

SetName sets the Name field's value.

func (*S3Object) SetVersion

func (s *S3Object) SetVersion(v string) *S3Object

SetVersion sets the Version field's value.

func (S3Object) String

func (s S3Object) String() string

String returns the string representation

func (*S3Object) Validate

func (s *S3Object) Validate() error

Validate inspects the fields of the type to determine if they are valid.

type SearchFacesByImageInput

type SearchFacesByImageInput struct {

	// ID of the collection to search.
	//
	// CollectionId is a required field
	CollectionId *string `min:"1" type:"string" required:"true"`

	// (Optional) Specifies the minimum confidence in the face match to return.
	// For example, don't return any matches where confidence in matches is less
	// than 70%.
	FaceMatchThreshold *float64 `type:"float"`

	// The input image as bytes or an S3 object.
	//
	// Image is a required field
	Image *Image `type:"structure" required:"true"`

	// Maximum number of faces to return. The operation returns the maximum number
	// of faces with the highest confidence in the match.
	MaxFaces *int64 `min:"1" type:"integer"`
	// contains filtered or unexported fields
}

func (SearchFacesByImageInput) GoString

func (s SearchFacesByImageInput) GoString() string

GoString returns the string representation

func (*SearchFacesByImageInput) SetCollectionId

SetCollectionId sets the CollectionId field's value.

func (*SearchFacesByImageInput) SetFaceMatchThreshold

func (s *SearchFacesByImageInput) SetFaceMatchThreshold(v float64) *SearchFacesByImageInput

SetFaceMatchThreshold sets the FaceMatchThreshold field's value.

func (*SearchFacesByImageInput) SetImage

SetImage sets the Image field's value.

func (*SearchFacesByImageInput) SetMaxFaces

SetMaxFaces sets the MaxFaces field's value.

func (SearchFacesByImageInput) String

func (s SearchFacesByImageInput) String() string

String returns the string representation

func (*SearchFacesByImageInput) Validate

func (s *SearchFacesByImageInput) Validate() error

Validate inspects the fields of the type to determine if they are valid.

type SearchFacesByImageOutput

type SearchFacesByImageOutput struct {

	// An array of faces that match the input face, along with the confidence in
	// the match.
	FaceMatches []*FaceMatch `type:"list"`

	// The bounding box around the face in the input image that Amazon Rekognition
	// used for the search.
	SearchedFaceBoundingBox *BoundingBox `type:"structure"`

	// The level of confidence that the searchedFaceBoundingBox, contains a face.
	SearchedFaceConfidence *float64 `type:"float"`
	// contains filtered or unexported fields
}

func (SearchFacesByImageOutput) GoString

func (s SearchFacesByImageOutput) GoString() string

GoString returns the string representation

func (*SearchFacesByImageOutput) SetFaceMatches

SetFaceMatches sets the FaceMatches field's value.

func (*SearchFacesByImageOutput) SetSearchedFaceBoundingBox

func (s *SearchFacesByImageOutput) SetSearchedFaceBoundingBox(v *BoundingBox) *SearchFacesByImageOutput

SetSearchedFaceBoundingBox sets the SearchedFaceBoundingBox field's value.

func (*SearchFacesByImageOutput) SetSearchedFaceConfidence

func (s *SearchFacesByImageOutput) SetSearchedFaceConfidence(v float64) *SearchFacesByImageOutput

SetSearchedFaceConfidence sets the SearchedFaceConfidence field's value.

func (SearchFacesByImageOutput) String

func (s SearchFacesByImageOutput) String() string

String returns the string representation

type SearchFacesInput

type SearchFacesInput struct {

	// ID of the collection the face belongs to.
	//
	// CollectionId is a required field
	CollectionId *string `min:"1" type:"string" required:"true"`

	// ID of a face to find matches for in the collection.
	//
	// FaceId is a required field
	FaceId *string `type:"string" required:"true"`

	// Optional value specifying the minimum confidence in the face match to return.
	// For example, don't return any matches where confidence in matches is less
	// than 70%.
	FaceMatchThreshold *float64 `type:"float"`

	// Maximum number of faces to return. The operation returns the maximum number
	// of faces with the highest confidence in the match.
	MaxFaces *int64 `min:"1" type:"integer"`
	// contains filtered or unexported fields
}

func (SearchFacesInput) GoString

func (s SearchFacesInput) GoString() string

GoString returns the string representation

func (*SearchFacesInput) SetCollectionId

func (s *SearchFacesInput) SetCollectionId(v string) *SearchFacesInput

SetCollectionId sets the CollectionId field's value.

func (*SearchFacesInput) SetFaceId

func (s *SearchFacesInput) SetFaceId(v string) *SearchFacesInput

SetFaceId sets the FaceId field's value.

func (*SearchFacesInput) SetFaceMatchThreshold

func (s *SearchFacesInput) SetFaceMatchThreshold(v float64) *SearchFacesInput

SetFaceMatchThreshold sets the FaceMatchThreshold field's value.

func (*SearchFacesInput) SetMaxFaces

func (s *SearchFacesInput) SetMaxFaces(v int64) *SearchFacesInput

SetMaxFaces sets the MaxFaces field's value.

func (SearchFacesInput) String

func (s SearchFacesInput) String() string

String returns the string representation

func (*SearchFacesInput) Validate

func (s *SearchFacesInput) Validate() error

Validate inspects the fields of the type to determine if they are valid.

type SearchFacesOutput

type SearchFacesOutput struct {

	// An array of faces that matched the input face, along with the confidence
	// in the match.
	FaceMatches []*FaceMatch `type:"list"`

	// ID of the face that was searched for matches in a collection.
	SearchedFaceId *string `type:"string"`
	// contains filtered or unexported fields
}

func (SearchFacesOutput) GoString

func (s SearchFacesOutput) GoString() string

GoString returns the string representation

func (*SearchFacesOutput) SetFaceMatches

func (s *SearchFacesOutput) SetFaceMatches(v []*FaceMatch) *SearchFacesOutput

SetFaceMatches sets the FaceMatches field's value.

func (*SearchFacesOutput) SetSearchedFaceId

func (s *SearchFacesOutput) SetSearchedFaceId(v string) *SearchFacesOutput

SetSearchedFaceId sets the SearchedFaceId field's value.

func (SearchFacesOutput) String

func (s SearchFacesOutput) String() string

String returns the string representation

type Smile

type Smile struct {

	// Level of confidence in the determination.
	Confidence *float64 `type:"float"`

	// Boolean value that indicates whether the face is smiling or not.
	Value *bool `type:"boolean"`
	// contains filtered or unexported fields
}

Indicates whether or not the face is smiling, and the confidence level in the determination.

func (Smile) GoString

func (s Smile) GoString() string

GoString returns the string representation

func (*Smile) SetConfidence

func (s *Smile) SetConfidence(v float64) *Smile

SetConfidence sets the Confidence field's value.

func (*Smile) SetValue

func (s *Smile) SetValue(v bool) *Smile

SetValue sets the Value field's value.

func (Smile) String

func (s Smile) String() string

String returns the string representation

type Sunglasses

type Sunglasses struct {

	// Level of confidence in the determination.
	Confidence *float64 `type:"float"`

	// Boolean value that indicates whether the face is wearing sunglasses or not.
	Value *bool `type:"boolean"`
	// contains filtered or unexported fields
}

Indicates whether or not the face is wearing sunglasses, and the confidence level in the determination.

func (Sunglasses) GoString

func (s Sunglasses) GoString() string

GoString returns the string representation

func (*Sunglasses) SetConfidence

func (s *Sunglasses) SetConfidence(v float64) *Sunglasses

SetConfidence sets the Confidence field's value.

func (*Sunglasses) SetValue

func (s *Sunglasses) SetValue(v bool) *Sunglasses

SetValue sets the Value field's value.

func (Sunglasses) String

func (s Sunglasses) String() string

String returns the string representation

Directories

Path Synopsis
Package rekognitioniface provides an interface to enable mocking the Amazon Rekognition service client for testing your code.
Package rekognitioniface provides an interface to enable mocking the Amazon Rekognition service client for testing your code.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL