Skip to content

Commit

Permalink
MAJOR[Fixes observed missing data over forest]: ESAWC transform chang…
Browse files Browse the repository at this point in the history
…ed (all labels+1) because the tree labels was at 0, thus seen as missing
  • Loading branch information
ThomasRieutord committed Sep 22, 2023
1 parent 93bdf83 commit 809cb29
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions mmt/datasets/landcovers.py
Original file line number Diff line number Diff line change
Expand Up @@ -246,12 +246,12 @@ class EcoclimapSG(TorchgeoLandcover):
class ESAWorldCover(TorchgeoLandcover):
path = os.path.join(config.paths.data_dir, "tiff_data", "ESA-WorldCover-2021")#, "ESA_WorldCover_10m_2021_v200_60deg_macrotile_N30E000")
labels = [
"Tree cover", "Shrubland", "Grassland", "Cropland", "Built-up",
"No data", "Tree cover", "Shrubland", "Grassland", "Cropland", "Built-up",
"Bare/sparse veg.", "Snow and ice", "Permanent water bodies",
"Herbaceous wetland", "Mangroves", "Moss and lichen"
]
cmap = [
(0,100,0), (255, 187, 34), (255, 255, 76), (240, 150, 255), (250, 0, 0), (180, 180, 180),
(0,0,0), (0,100,0), (255, 187, 34), (255, 255, 76), (240, 150, 255), (250, 0, 0), (180, 180, 180),
(240, 240, 240), (0, 100, 200), (0, 150, 160), (0, 207, 117), (250, 230, 160)
]
crs = rasterio.crs.CRS.from_epsg(4326)
Expand Down
2 changes: 1 addition & 1 deletion mmt/datasets/transforms.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,4 +149,4 @@ def __call__(self, x):
x[x == self.missing_label] = self.sea_label
return x

EsawcTransform = tvt.Compose([FloorDivMinus(10, 1), FillMissingWithSea(-1, 7)])
EsawcTransform = tvt.Compose([FloorDivMinus(10, 0), FillMissingWithSea(0, 8)])

0 comments on commit 809cb29

Please sign in to comment.