-
-
Notifications
You must be signed in to change notification settings - Fork 699
Expose attention center when doing attention-based cropping. #3164
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
Conversation
Hi @ejoebstl, This looks interesting, but it's a huge API change. Could you explain the effect you are trying to achieve? Perhaps there's a less intrusive way of doing this. Maybe just adding |
Hi, Thank you for getting back. I want to expose the center of attention computed by I agree that adding For this PR I followed what was done with |
https://github.com/libvips/libvips/blob/master/libvips/arithmetic/max.c#L444-L456 After computing the values in https://github.com/libvips/libvips/blob/master/libvips/arithmetic/max.c#L232-L242 And then callers should be able to read them out. |
Hello @jcupitt - thank you for the guidance. This is way less intrusive now. |
Added unit test, this should be good for merging. I did not find the documentation in the package, please feel free to point me in the right direction and I can update that as well. |
Ah nice, yes, that's much neater. The docs are in the comment block near the end: https://github.com/libvips/libvips/blob/master/libvips/conversion/smartcrop.c#L445-L468 Just add your two new optional output params, plus a paragraph of text below saying what they are for. Add a line to |
Done, hope that's good! |
Great! Just two more tiny things ... Thank you for doing this work, @ejoebstl, it'll be in 8.14, due RSN. |
Done 🙌 |
Great! Thanks again for this useful thing. |
Hola,
Thanks for your work on libvips.
I'm currently trying to expose the region of interest when using smart/attention cropping. In libvips, only the crop offset is exposed, but having access to the center would be quite interesting.
However, I'm failing to implement this correctly. One of the unit tests crashes with the following backtrace:
I think it's a problem with how I implemented the additional arguments, but I fail to see the error.
Any guidance would appreciated - happy to finish this PR.