Skip to content

Errors when overlapping labels with tiles #13

Description

@rogerkuou

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions