#206 · Primary category: Computer Vision

autocrop

autocrop computer-vision crop face face-detection facedetect opencv pictures profile-picture python yunet

📸 Automatically detects and crops faces from batches of pictures.

Project last updated:07/15/26

GitHub Stars

674

Forks

120

Contributors

16

License

BSD-2-Clause

Why we included this project

Anyone who has resized a hundred headshots by hand will appreciate what autocrop does: it finds the largest face in each picture, centers the crop on it, and resizes the result to a consistent width and height. Detection runs on OpenCV's YuNet neural network, and the whole tool installs with a single pip command. You can use it as a command-line filter, feeding image bytes on stdin and getting cropped bytes back on stdout, or import the Cropper class and pass it file paths or OpenCV-style arrays from your own Python code. Because each invocation handles one image, it slots neatly into find, xargs, or GNU parallel for batch jobs, and it accepts a broad range of input formats. For teams that want predictable, scriptable face cropping without maintaining their own detection pipeline, it is a practical drop-in.

Articles for this project

No articles for this project yet.

To suggest a topic or contribute an article, contact us.

Related projects in this category