esimov / caire

Content aware image resize library
MIT License
10.36k stars 384 forks source link

Using -square seems to take forever #55

Closed mosic closed 4 years ago

mosic commented 4 years ago

I used caire with a couple of images, and aside from the girl example in the README, I haven't gotten it to actually provide an output with any of the images I tried, even after 10-15mins. I have tried using different flags to make it faster, but it seems to be stuck processing forever.

Here's an example to reproduce my issue:

wget -O input.jpg "https://unsplash.com/photos/CaDoHQ3fB8w/download?force=true"
caire -in input.jpg -out output.jpg -face=false -scale -square -width=500 -height=500 -blur=0

Any suggestions?

esimov commented 4 years ago

Thanks for letting me know this issue. It was a missing conditional check in the image processing part. This issue should have been fixed now. Please test it and let me know if it's working on your end.

Below is the end result obtained running the command you have used.

output

mosic commented 4 years ago

That was fast! Yeah, the issue seems to be fixed on my side as well. Thanks for looking into it.

I tried it with another image and got a weird result though, maybe it should be a separate issue:

wget -O input.jpg "https://unsplash.com/photos/TjOH0ymV7oU/download?force=true"
caire -in input.jpg -out output.jpg -face=false -scale -square -width=500 -height=500 -blur=0

This is the original:

input

And this is the output:

output

esimov commented 4 years ago

This is not related to some bug or issue in the algorithm, since it has a "dense" background the nature of this image does not permits to generate a good output.

mosic commented 4 years ago

Ah, fair enough. :+1: