Apache NiFi processor for calling Amazon's "Compare Faces" Rekognition service.
- Download complied NAR into NiFi's
/lib/
directory. - Change permissions on the file (>
chmod 755 nifi-rekognitioncomparefaces-nar-1.0-SNAPSHOT.nar
) - Restart NiFi (
/bin/nifi.sh restart
)
After NiFi restarts and you've added the processor to your canvas ...
- Add your S3 credentials, just as you would with NiFi's FetchS3Object processor.
- Define
Source
andTarget
image sources:
- S3Object <> S3Object
- S3Object <> Base64-encoded string
- Base64-encoded string <> S3Object
- Base64-encoded string <> Base64-encoded string
This processor was developed for a limited, go / no-go use-case. Currently, the processor simply checks whether the length of the FaceMatches response array is non-zero. If if is, then the FlowFile is routed to the Match
relationship. If no faces are found (throwing an InvalidParameters exception) or the FaceMatches
array is empty, the FlowFile is routed to the No Match
relationship.
To make the processor more general-purpose (merge requests welcome! please update the compiled NAR), a successful response could be JSONified and set as an attribute. Thereafter, the NiFi expression language (vs. the processor itself) could be employed for follow-on FlowFile routing.