Skip to main content

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

Project description

cropimage

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.

Installation

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

Contributing

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 details)

Uploaded Source

Built Distribution

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

Uploaded Python 3

File details

Details for the file cropimage-0.0.6.tar.gz.

File metadata

  • Download URL: cropimage-0.0.6.tar.gz
  • Upload date:
  • Size: 29.7 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.23.0 requests-toolbelt/0.9.1 tqdm/4.55.1 CPython/3.6.9

File hashes

Hashes for cropimage-0.0.6.tar.gz
Algorithm Hash digest
SHA256 3be2a56f480f1f28e599699ab7ef5912b56ca166fa682442a69318426f5ef84f
MD5 fae6df3fb88e61fe6bfaf9b56ccc58d2
BLAKE2b-256 7dc09bc8ba796e52781ed52481089250fbcec450fbb2b9c28414935f76ad6cce

See more details on using hashes here.

File details

Details for the file cropimage-0.0.6-py3-none-any.whl.

File metadata

  • Download URL: cropimage-0.0.6-py3-none-any.whl
  • Upload date:
  • Size: 8.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.23.0 requests-toolbelt/0.9.1 tqdm/4.55.1 CPython/3.6.9

File hashes

Hashes for cropimage-0.0.6-py3-none-any.whl
Algorithm Hash digest
SHA256 ffbcd4818ffee5cc9eab8ff3452c26dae119daea417826b34a8a73062ad2d657
MD5 9616125e733bea9496b239537cf18f76
BLAKE2b-256 e7925d2c21ebc9789f2cae8d42ec40570aeafb4adf0d2adf63053c992ab32e37

See more details on using hashes here.

Supported by

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