Face detection crop

On this page

Automatically detect faces in your image and crop them. Sirv uses deep learning neural networks, trained on millions of images to accurately detect faces in images. Faces can be detected in as little as 200ms.

Set 'crop.type' to face. Example:

https://demo.sirv.com/lady.jpg?crop.type=face

Original image, not cropped Face detection cropped image

To reduce the size of the face (scale), use 'ch' and 'cw'.

https://demo.sirv.com/lady.jpg?crop.type=face&ch=150

Face detected image, scaled to 150px

If there is more than 1 face, specify which face to crop by using 'crop.face=0' where 0 is the number of face (from 0 upwards).

https://demo.sirv.com/dance.jpg?crop.type=face&crop.face=1

To see how Sirv detects faces, apply 'crop.dev=1' to the image. A red box will be drawn around the face, like so:

https://demo.sirv.com/lady.jpg?crop.type=face&crop.dev=1

Was this article helpful?

Get help from a Sirv expert