func (c *Collection) IndexFacesFromLocalFile(filepath string) (*IndexFacesResponse, error) {
	return c.IndexFacesFromLocalFileWithExternalImageID("", filepath)
}
IndexFacesFromLocalFile saves image into a collection from local image file.
package rekognition
import (
	"io/ioutil"
	SDK "github.com/aws/aws-sdk-go/service/rekognition"
	"github.com/evalphobia/aws-sdk-go-wrapper/private/pointers"
)
const emptyThreshold = -1.0
type Collection struct {
	service *Rekognition
	name           string
	nameWithPrefix string
	limit          int64
}
func NewCollection(svc *Rekognition, name string) *Collection {
	collectionName := svc.prefix + name
	return &Collection{
		service:        svc,
		name:           name,
		nameWithPrefix: collectionName,
	}
}
func (c *Collection) SetLimit(limit int64) {
	c.limit = limit
}
func (c *Collection) ListAllFaces() ([]*Face, error) {
	const defaultMaxResult = 1000  
	limit := c.limit
	if limit == 0 {
		limit = defaultMaxResult
	}
	var nextToken *string
	faces := make([]*Face, 0, limit)
	hasNextToken := true
	for hasNextToken {
		list, token, err := c.listFaces(&SDK.ListFacesInput{
			CollectionId: pointers.String(c.nameWithPrefix),
			MaxResults:   pointers.Long64(limit),
			NextToken:    nextToken,
		})
		if err != nil {
			return nil, err
		}
		faces = append(faces, list...)
		hasNextToken = (token != "")
		if hasNextToken {
			nextToken = &token
		}
	}
	return faces, nil
}
func (c *Collection) listFaces(input *SDK.ListFacesInput) (faces []*Face, nextToken string, err error) {
	svc := c.service
	op, err := svc.client.ListFaces(input)
	if err != nil {
		svc.Errorf("error on `ListFaces` operation; collection=%s; error=%s;", c.nameWithPrefix, err.Error())
		return nil, "", err
	}
	faces = make([]*Face, len(op.Faces))
	for i, f := range op.Faces {
		faces[i] = NewFaceFromAWSFace(f)
	}
	if op.NextToken != nil {
		nextToken = *op.NextToken
	}
	return faces, nextToken, nil
}
func (c *Collection) DeleteFaces(faceIDs []string) ([]string, error) {
	svc := c.service
	ids := make([]*string, len(faceIDs))
	for i, id := range faceIDs {
		id := id
		ids[i] = &id
	}
	op, err := svc.client.DeleteFaces(&SDK.DeleteFacesInput{
		CollectionId: pointers.String(c.nameWithPrefix),
		FaceIds:      ids,
	})
	if err != nil {
		svc.Errorf("error on `DeleteFaces` operation; collection=%s; error=%s;", c.nameWithPrefix, err.Error())
		return nil, err
	}
	result := make([]string, 0, len(op.DeletedFaces))
	for _, f := range op.DeletedFaces {
		if f != nil {
			result = append(result, *f)
		}
	}
	return result, nil
}