项目作者: haofanwang

项目描述 :
A simple toolkit for detecting and cropping main body from pictures. Support face and saliency detection.
高级语言: Python
项目地址: git://github.com/haofanwang/cropimage.git
创建时间: 2021-09-20T10:32:08Z
项目社区:https://github.com/haofanwang/cropimage

开源协议:Apache License 2.0

下载


cropimage

Colab PyPI version Python Downloads contributions welcome

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

  1. pip install cropimage

Get Started

  1. from cropimage import Cropper
  2. cropper = Cropper()
  3. # Get a Numpy array of the cropped image
  4. # Set completeness to be True if you expect the 'face' to be focused rather than 'person'
  5. # Set target_size to be a tuple (size, size), only square output is supported now
  6. result = cropper.crop('./images/input.jpg')
  7. # Save the cropped image
  8. cv2.imwrite('cropped.jpg', result)

More Results

Contributing

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