Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unclear error message when processing certain images #23

Open
RobinDeBock opened this issue Jan 14, 2022 · 1 comment
Open

Unclear error message when processing certain images #23

RobinDeBock opened this issue Jan 14, 2022 · 1 comment

Comments

@RobinDeBock
Copy link

I'm not allowed to disclose the images that cause the error, however the error message isn't really clear.
The first step in determining the source of the mistake is to provide a more informative error message.
As 5% of my 500-image test batch could not be processed, this isn't something to overlook.

The error message is:
{'self': <smartcrop.SmartCrop object at 0x7fc57b26cb50>, 'image': <PIL.Image.Image image mode=RGB size=299x269 at 0x7FC57B2CA4D0>, 'crop_width': 300, 'crop_height': 200, 'max_scale': 1, 'min_scale': 1, 'scale_step': 0.1, 'step': 8, 'image_width': 299, 'image_height': 269, 'crops': [], 'scale': 1.0, 'y': 72, 'x': 0}

@JanPokorny
Copy link

I suppose this is from https://github.com/smartcrop/smartcrop.py/blob/master/smartcrop.py#L215, which happens when the algorithm can't find any viable crop. I'm not the original creator so idk why precisely that happens, but in this case I'd suggest doing a naive crop where SmartCrop fails.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants