/AWS1/IF_REK=>LISTFACES()¶
About ListFaces¶
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 Listing Faces in a Collection in the Amazon Rekognition Developer Guide.
This operation requires permissions to perform the rekognition:ListFaces
action.
Method Signature¶
METHODS /AWS1/IF_REK~LISTFACES
IMPORTING
!IV_COLLECTIONID TYPE /AWS1/REKCOLLECTIONID OPTIONAL
!IV_NEXTTOKEN TYPE /AWS1/REKPAGINATIONTOKEN OPTIONAL
!IV_MAXRESULTS TYPE /AWS1/REKPAGESIZE OPTIONAL
!IV_USERID TYPE /AWS1/REKUSERID OPTIONAL
!IT_FACEIDS TYPE /AWS1/CL_REKFACEIDLIST_W=>TT_FACEIDLIST OPTIONAL
RETURNING
VALUE(OO_OUTPUT) TYPE REF TO /aws1/cl_reklistfacesresponse
RAISING
/AWS1/CX_REKACCESSDENIEDEX
/AWS1/CX_REKINTERNALSERVERERR
/AWS1/CX_REKINVPAGINATIONTOKEX
/AWS1/CX_REKINVALIDPARAMETEREX
/AWS1/CX_REKPROVTHRUPUTEXCDEX
/AWS1/CX_REKRESOURCENOTFOUNDEX
/AWS1/CX_REKTHROTTLINGEX
/AWS1/CX_REKCLIENTEXC
/AWS1/CX_REKSERVEREXC
/AWS1/CX_RT_TECHNICAL_GENERIC
/AWS1/CX_RT_SERVICE_GENERIC.
IMPORTING¶
Required arguments:¶
iv_collectionid TYPE /AWS1/REKCOLLECTIONID /AWS1/REKCOLLECTIONID¶
ID of the collection from which to list the faces.
Optional arguments:¶
iv_nexttoken TYPE /AWS1/REKPAGINATIONTOKEN /AWS1/REKPAGINATIONTOKEN¶
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.
iv_maxresults TYPE /AWS1/REKPAGESIZE /AWS1/REKPAGESIZE¶
Maximum number of faces to return.
iv_userid TYPE /AWS1/REKUSERID /AWS1/REKUSERID¶
An array of user IDs to filter results with when listing faces in a collection.
it_faceids TYPE /AWS1/CL_REKFACEIDLIST_W=>TT_FACEIDLIST TT_FACEIDLIST¶
An array of face IDs to filter results with when listing faces in a collection.
RETURNING¶
oo_output TYPE REF TO /aws1/cl_reklistfacesresponse /AWS1/CL_REKLISTFACESRESPONSE¶
Domain /AWS1/RT_ACCOUNT_ID Primitive Type NUMC
Examples¶
Syntax Example¶
This is an example of the syntax for calling the method. It includes every possible argument and initializes every possible value. The data provided is not necessarily semantically accurate (for example the value "string" may be provided for something that is intended to be an instance ID, or in some cases two arguments may be mutually exclusive). The syntax shows the ABAP syntax for creating the various data structures.
DATA(lo_result) = lo_client->listfaces(
it_faceids = VALUE /aws1/cl_rekfaceidlist_w=>tt_faceidlist(
( new /aws1/cl_rekfaceidlist_w( |string| ) )
)
iv_collectionid = |string|
iv_maxresults = 123
iv_nexttoken = |string|
iv_userid = |string|
).
This is an example of reading all possible response values
lo_result = lo_result.
IF lo_result IS NOT INITIAL.
LOOP AT lo_result->get_faces( ) into lo_row.
lo_row_1 = lo_row.
IF lo_row_1 IS NOT INITIAL.
lv_faceid = lo_row_1->get_faceid( ).
lo_boundingbox = lo_row_1->get_boundingbox( ).
IF lo_boundingbox IS NOT INITIAL.
lv_float = lo_boundingbox->get_width( ).
lv_float = lo_boundingbox->get_height( ).
lv_float = lo_boundingbox->get_left( ).
lv_float = lo_boundingbox->get_top( ).
ENDIF.
lv_imageid = lo_row_1->get_imageid( ).
lv_externalimageid = lo_row_1->get_externalimageid( ).
lv_percent = lo_row_1->get_confidence( ).
lv_indexfacesmodelversion = lo_row_1->get_indexfacesmodelversion( ).
lv_userid = lo_row_1->get_userid( ).
ENDIF.
ENDLOOP.
lv_string = lo_result->get_nexttoken( ).
lv_string = lo_result->get_facemodelversion( ).
ENDIF.
To list the faces in a collection¶
This operation lists the faces in a Rekognition collection.
DATA(lo_result) = lo_client->listfaces(
iv_collectionid = |myphotos|
iv_maxresults = 20
).