mapbox / mapbox/robosat

Mirror tiles at borders if adjacent tiles are missing

Open
#48 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
2.1k
Forks
385
PR merge metrics
No merged PRs in 30d

Description

At the moment we predict the tile segmentation probabilities by adding a border to the tile. The idea is to do prediction on the larger images to get masks and then crop out the original mask.

This border is made up of (e.g. 32) pixels from the eight adjacent tiles:

```
x x x
x o x
x x x
```

Predicting on tile `o` means we add a small border band from all `x` tiles.

![halfdone](https://user-images.githubusercontent.com/527241/38420640-b944c696-39a4-11e8-9461-0e108833317a.png)
![composite](https://user-images.githubusercontent.com/527241/38420641-b974d020-39a4-11e8-8fbf-7bffe28bb1da.png)

There are two cases when adjacent tiles may not be present:
- hard negative mining on a randomly sampled set of tiles
- predicting at the border of the dataset (e.g. predicting on multiple tifs)

When there are adjacent tiles missing we currently have a black border. This can lead to false predictions. We should instead mirror the image at the border when there are no adjacent tiles. This will reduce or eliminate the tile border problems when there are tiles missing.

Task
- [ ] Mirror image at border when adjacent tile is missing; [here](https://github.com/mapbox/robosat/blob/8d9bd9cbf1edde83f531d267072b6dcb3ba93860/robosat/tiles.py#L143-L156)

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading robosat/tiles.py around lines 143-156, where borders are assembled from adjacent tiles. Trace how missing neighbors currently produce a black border, then make the border behavior mirror the image when those tiles are absent. Done means missing adjacent tiles no longer create black border pixels during segmentation prediction.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
computer-vision, machine-learning
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.