NRCan / geo-deep-learning

Deep learning applied to georeferenced datasets
https://geo-deep-learning.readthedocs.io/en/latest/
MIT License
150 stars 49 forks source link

Smoothening with Hann Window #485

Closed valhassan closed 1 year ago

valhassan commented 1 year ago

New Feature Request: We would like to smooth predictions at inference which solves edge effects, jaggedness, and holes when stitching tiles/patches. Below is an illustration of problem areas highlighted with red circles.

  1. Original Raster, 2. Water Body Extraction (No Smoothening), 3. Water Body Extraction (Smoothening with Hann).

1 tempsnip_2 tempsnip_3

Method

  1. Generate overlapping patches, with a stride half of the patch size.
  2. Model prediction on patches.
  3. Multiplying each patch by the appropriate window depending on its absolute location.
  4. Stitching all patches at their absolute location.

Reference Paper: https://arxiv.org/abs/1910.07831