Artificial Intelligence Integration & Impact
How we built AI face cropping for Images

How we built AI face cropping for Images

8/20/2025 · Deanna Lam, Diretnan Domnan

What this post added

This post details the technical implementation of AI face cropping for Cloudflare Images. It describes the migration from a CPU-based prototype to a GPU-based implementation using Workers AI, addressing memory leaks for large-scale use. The post explains the selection of the RetinaFace model based on performance on the WIDERFACE dataset, speed, and model size. It also details the inference process, including image resizing for efficiency, the construction of bounding boxes for detected faces, and the calculation of the outer bounding box and focal point for cropping. The privacy considerations of using face detection rather than facial recognition are also highlighted.

Read the original post ↗