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

Export error when there are invalid polygons in the overlapping frames (shapely.errors.TopologicalError) #2851

Closed
2 tasks done
fengyach opened this issue Feb 23, 2021 · 5 comments · Fixed by #2852
Closed
2 tasks done
Labels
bug Something isn't working

Comments

@fengyach
Copy link
Contributor

My actions before raising this issue

Expected Behaviour

Export of the datasets should go through without any issues.

Current Behaviour

When there are invalid polygons in the overlapping frames, a notification pops out stating the export cannot be done, and an api call error stating:
shapely.errors.TopologicalError: The operation 'GEOSIntersection_r' could not be performed
Therefore blocking the export.

(in frames that have no overlapping, the invalid polygon does not block the export)

Possible Solution

  • ignore the invalid polygon when calculating similarity
  • add validity check in the UI to prevent any creation of invalid polygon in the first place

Steps to Reproduce (for bugs)

  1. create a new task.
  2. set the overlap size to an integer that is greater or equal to 1.
  3. in the overlapping frames, draw an invalid polygon (self-overlapping polygon).
  4. save and export the task.

Context

We need the exported points' coordinates for further ML model training.

Your Environment

  • Operating System and version (e.g. Linux, Windows, MacOS): MacOS 11
@azhavoro azhavoro added the bug Something isn't working label Feb 24, 2021
@bsekachev
Copy link
Member

bsekachev commented Feb 25, 2021

Hi, @fengyach

Do you happen to know how we can create "invalid" polygon on UI?

@fengyach
Copy link
Contributor Author

fengyach commented Feb 25, 2021

@bsekachev Hello! thank you very much for your comment! I have an example here:
image

Also, I have created a PR related to the issue, some sort of 'quick fix', would it be possible if you could check it out as well?
Much much obliged!

@bsekachev
Copy link
Member

Okay, got it.

If we speak about polygons with intersections, they are legal in CVAT (at least we cannot call them invalid) and we should not prevent creating them on UI.
I saw the PR but probably it should be reviewed by @zhiltsov-max or @yasakova-anastasia because I mightn't have enough expertise in this code.

nmanovic pushed a commit that referenced this issue Mar 4, 2021
…sue #2851   (#2852)

* Added validity check for polygon similarity computation

* Updated changelog
@gboeer
Copy link
Contributor

gboeer commented Apr 1, 2021

At least it has to be possible to export the annotations in any case.
I'm currently in the situation that I can't export my annotations because of this. I have a larger image dataset with polygon track annotations and a segment overlap of 2. Whenever I try to export any kind of annotation format I get the mentioned GEOSIntersection_r error.
I triple checked every overlapping frame for "false" annotations, however didn't find any that look suspicious to me. It would also help, if at least the frame number where the error occurs would be mentioned in the error message.

I also tried to change the frame range of each segment to not include any overlapping frames numbers anymore, however to no avail.

How can I get to my annotations bypassing the web interface or this error in overlapping frames?

@fengyach
Copy link
Contributor Author

fengyach commented Apr 1, 2021

At least it has to be possible to export the annotations in any case.
I'm currently in the situation that I can't export my annotations because of this. I have a larger image dataset with polygon track annotations and a segment overlap of 2. Whenever I try to export any kind of annotation format I get the mentioned GEOSIntersection_r error.
I triple checked every overlapping frame for "false" annotations, however didn't find any that look suspicious to me. It would also help, if at least the frame number where the error occurs would be mentioned in the error message.

I also tried to change the frame range of each segment to not include any overlapping frames numbers anymore, however to no avail.

How can I get to my annotations bypassing the web interface or this error in overlapping frames?

Hello! this is fixed via PR 2852 :) I believe it is already merged to develop.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants