A simple toolkit for detecting and cropping main body from pictures.
Project description
cropimage
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.
Installation
pip install cropimage
Get Started
from cropimage import Cropper
cropper = Cropper()
# Get a Numpy array of the cropped image
# Set completeness to be True if you expect the 'face' to be focused rather than 'person'
# 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
Contributing
If you find any issue of this project, feel free to open an issue or contribute!
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
No source distribution files available for this release.See tutorial on generating distribution archives.
Built Distribution
cropimage_dh-0.0.7-py3-none-any.whl
(270.4 kB
view details)
File details
Details for the file cropimage_dh-0.0.7-py3-none-any.whl
.
File metadata
- Download URL: cropimage_dh-0.0.7-py3-none-any.whl
- Upload date:
- Size: 270.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.10.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2b0fa4394d29b6031d1db9112501d5a0ede55a4e1c12fe2055c0376ac17a431c |
|
MD5 | 120b32eb3e8afa968e8df4bfe0ab67d2 |
|
BLAKE2b-256 | 2ddde6be6638dde0d84e1670573ccdc8d03bf9b988c2543220d3ccb3fab39a0a |