Smartcrop transform for PyTorch
Project description
pytorch-smartcrop
This is a PyTorch implementation of the smartcrop algorithm. The smartcrop algorithm is a content aware image cropping algorithm that is used to crop images to the most interesting part of the image. The algorithm is based on the pyvips smartcrop implementation.
Prerequisites
- requires libvips shared library to be installed on the system. For further information on how to install libvips, please refer to the libvips installation guide
Usage
from pytorch_smartcrop import SmartCrop
from PIL import Image
# load image
image = Image.open('image.jpg')
# crop image to 256x256
sc = SmartCrop(patch_size=(256, 256))
cropped_image = sc(image)
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 Distribution
Built Distribution
Close
Hashes for pytorch_smartcrop-1.0.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 04e1b7a3ddbcd284e9bfdd69c845104396e0957322d6821b314853ea1bd10067 |
|
MD5 | 7609fdf02d0c71cf1aaeb0b5fe6b98a3 |
|
BLAKE2b-256 | b79928e4c6324f101c21aa8d235daf6b0355b771487c29a3923af483c3620b0a |