Skip to main content

A simple toolkit for detecting and cropping main body from pictures.

Project description


PyPI version

cropimage is a simple toolkit for image cropping. Different from other projects that mainly tackle face region, we extend to all kinds of images such as landscape. We support horizontal and portrait size and generate a square output.


pip install cropimage

Get Started

from cropimage import Cropper

cropper = Cropper()

# Get a Numpy array of the cropped image
# Set completeness to be False if you expect the 'person' to be complete rather than 'face'
# Set target_size to be a tuple (size, size), only square output is supported now,
result = cropper.crop('./images/input.jpg')

# Save the cropped image
cv2.imwrite('cropped.jpg', result)

More Results


If you find any issue of this project, feel free to open an issue or contribute!

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

cropimage-0.0.6.tar.gz (29.7 MB view hashes)

Uploaded source

Built Distribution

cropimage-0.0.6-py3-none-any.whl (8.9 kB view hashes)

Uploaded py3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page