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

Errors when overlapping labels with tiles #13

Open
rogerkuou opened this issue Nov 29, 2021 · 0 comments
Open

Errors when overlapping labels with tiles #13

rogerkuou opened this issue Nov 29, 2021 · 0 comments

Comments

@rogerkuou
Copy link
Contributor

rogerkuou commented Nov 29, 2021

When executing train.slurm, the training fails on the following line of tile.py:

    # add the tiles overlapping with the labels to the test set
    mask = tiles.intersects(labels.unary_union)       #<- Fails on this line
    test_set = test_set.append(tiles[mask])

My hypothesis is that in the label data, some polylines are added, which is causing the failure of labels.unary_union . My temporal solution is to grow the labels with a very small buffer:

    # add the tiles overlapping with the labels to the test set
    labels['geometry'] = labels.buffer(0.0000001) # Add very small buffer to get rid of Polylines
    mask = tiles.intersects(labels.unary_union)
    test_set = test_set.append(tiles[mask])

In this way, all labels are converted into polygon/multipolygon, and there is no failure.

We need to think of a solution to this. Do we want to adapt to both polygon and polyline in the labels? Or there should be a check to enforce all labels to be polygon?

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

1 participant