-
Notifications
You must be signed in to change notification settings - Fork 547
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
Another self-intersection corner case handling #982
base: main
Are you sure you want to change the base?
Conversation
Hi @sergiev thank you for your contribution, I also had a chance to look at previous related PR. Could you maybe add some test data and extend the tests for shapely_utils ? I think that way we would've more control over these utilities. |
@devrimcavusoglu hi, thanks for the reply! If it's the suggestion to extend test_shapelyutils.py with some kind of |
Hi @sergiev. Yes, I exactly meant that, ofc. this cases are visible in PRs, but it would be nice also to track them in the code as well, so that people contributing to the package know that these cases are filed, and they may be able to add more to that test case. |
Hey @sergiev, thanks for your fantastic contribution! Do you plan to add some tests for your case into test_shapelyutils.py? |
Thank you @fcakyon for reminding! I plan to find time for it in a week, will update this PR branch before June, if you let me :) |
Hello again! This time I faced problem that seem very similar to the one from my previous PR #961
The neighboring points placed here in such order that gives us another invalid shape.
But this time my previous fix hadn't helped:
If you try to get intersection of original shape, it leads to empty intersection, which is the least expected behaviour (for me, at least).
So this time the solution is a bit tradeoff: you're not getting original shape, but only convex hull of it. If there's more accurate solution, I'll be happy to see it implemented in SAHI.
Below are information required to reproduce the bug:
Input image shape: h=2060, w=3790
slice_coco args: slice_height=slice_width=1280, overlap_height_ratio=overlap_width_ratio=0.02
Example of slightly corrupted annotation