Skip to content

Image Cropping Suggestions

Algorithm Name: image_crop_hints Old Name: detect_crop_hints

For the images that need to be cropped, this algorithm gives a suggestion of how should the image be cropped.

Input: an image file

Output: a dictionary of features

import Aiii
c = Aiii.Client("YOUR_API_KEY")

algo = c.algo('algo://adamleo/image_crop_hints')
with open("LOCAL_PATH_TO_IMAGE", "rb") as img:
    response = algo.pipe(img.read())

Or use local file path directly:

import Aiii
c = Aiii.Client("YOUR_API_KEY")

algo = c.algo('algo://adamleo/image_crop_hints')
response = algo.pipe("LOCAL_PATH_TO_IMAGE")

For cloud storage users, please specify the file path in the cloud:

import Aiii
c = Aiii.Client("YOUR_API_KEY")

algo = c.algo('algo://adamleo/image_crop_hints')
response = algo.pipe("data://CLOUD_PATH_TO_IMAGE")