Open crystalenka opened 3 years ago
We can have different backends to the face detection code:
Having multiple backends is a bit more flexible, especially if the client is already heavily invested in AWS or Azure. RapidAPI is a good solution for sites which don't already use a public cloud. PHP Facedetect is great for advanced and privacy-conscious users who would rather compile and configure a PHP extension than use a public cloud.
There are some instances where it would be beneficial to crop an image based on the location of a face, instead of from the center. (Author profile pages, for example)
The easiest way is probably going to be to allow someone to sign up for a 3rd-party service like Rapid API (https://rapidapi.com/inferdo/api/face-detection6) and only allow it as an option if there's a valid API key.
The linked Face Detection API is free up to 5,000 requests a month - more than enough for most sites.
They offer sample code for cURL requests.