-
Notifications
You must be signed in to change notification settings - Fork 391
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* 0.2.0 release * Fix notebooks * Fix minimal dependency tests * Fix integration tests * Fix integration tests * Try to avoid running GitHub Actions twice on release PRs * Revert "Try to avoid running GitHub Actions twice on release PRs" This reverts commit a1ac7ab. * GeoDatasets use intersection, not addition * Adding stack_samples to benchmarks * Fix zero division error in SEN12MS tests * Replaces test models with dummy models (#344) Co-authored-by: Adam J. Stewart <[email protected]> * lc values must be < num_classes * updated indices tutorial with latest indices Co-authored-by: Caleb Robinson <[email protected]> Co-authored-by: isaaccorley <[email protected]>
- Loading branch information
1 parent
42b9a6d
commit 7f27ede
Showing
49 changed files
with
307 additions
and
77 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file modified
BIN
-480 KB
(6.3%)
tests/data/sen12ms/ROIs1158_spring/lc_1/ROIs1158_spring_lc_1_p1.tif
Binary file not shown.
Binary file modified
BIN
-480 KB
(6.3%)
tests/data/sen12ms/ROIs1158_spring/lc_1/ROIs1158_spring_lc_1_p2.tif
Binary file not shown.
Binary file modified
BIN
-480 KB
(6.3%)
tests/data/sen12ms/ROIs1158_spring/s1_1/ROIs1158_spring_s1_1_p1.tif
Binary file not shown.
Binary file modified
BIN
-480 KB
(6.3%)
tests/data/sen12ms/ROIs1158_spring/s1_1/ROIs1158_spring_s1_1_p2.tif
Binary file not shown.
Binary file modified
BIN
-1.52 MB
(6.3%)
tests/data/sen12ms/ROIs1158_spring/s2_1/ROIs1158_spring_s2_1_p1.tif
Binary file not shown.
Binary file modified
BIN
-1.52 MB
(6.3%)
tests/data/sen12ms/ROIs1158_spring/s2_1/ROIs1158_spring_s2_1_p2.tif
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified
BIN
-480 KB
(6.3%)
tests/data/sen12ms/ROIs1868_summer/lc_1/ROIs1868_summer_lc_1_p1.tif
Binary file not shown.
Binary file modified
BIN
-480 KB
(6.3%)
tests/data/sen12ms/ROIs1868_summer/lc_1/ROIs1868_summer_lc_1_p2.tif
Binary file not shown.
Binary file modified
BIN
-480 KB
(6.3%)
tests/data/sen12ms/ROIs1868_summer/s1_1/ROIs1868_summer_s1_1_p1.tif
Binary file not shown.
Binary file modified
BIN
-480 KB
(6.3%)
tests/data/sen12ms/ROIs1868_summer/s1_1/ROIs1868_summer_s1_1_p2.tif
Binary file not shown.
Binary file modified
BIN
-1.52 MB
(6.3%)
tests/data/sen12ms/ROIs1868_summer/s2_1/ROIs1868_summer_s2_1_p1.tif
Binary file not shown.
Binary file modified
BIN
-1.52 MB
(6.3%)
tests/data/sen12ms/ROIs1868_summer/s2_1/ROIs1868_summer_s2_1_p2.tif
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified
BIN
-480 KB
(6.3%)
tests/data/sen12ms/ROIs1970_fall/lc_1/ROIs1970_fall_lc_1_p1.tif
Binary file not shown.
Binary file modified
BIN
-480 KB
(6.3%)
tests/data/sen12ms/ROIs1970_fall/lc_1/ROIs1970_fall_lc_1_p2.tif
Binary file not shown.
Binary file modified
BIN
-480 KB
(6.3%)
tests/data/sen12ms/ROIs1970_fall/s1_1/ROIs1970_fall_s1_1_p1.tif
Binary file not shown.
Binary file modified
BIN
-480 KB
(6.3%)
tests/data/sen12ms/ROIs1970_fall/s1_1/ROIs1970_fall_s1_1_p2.tif
Binary file not shown.
Binary file modified
BIN
-1.52 MB
(6.3%)
tests/data/sen12ms/ROIs1970_fall/s2_1/ROIs1970_fall_s2_1_p1.tif
Binary file not shown.
Binary file modified
BIN
-1.52 MB
(6.3%)
tests/data/sen12ms/ROIs1970_fall/s2_1/ROIs1970_fall_s2_1_p2.tif
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified
BIN
-480 KB
(6.3%)
tests/data/sen12ms/ROIs2017_winter/lc_1/ROIs2017_winter_lc_1_p1.tif
Binary file not shown.
Binary file modified
BIN
-480 KB
(6.3%)
tests/data/sen12ms/ROIs2017_winter/lc_1/ROIs2017_winter_lc_1_p2.tif
Binary file not shown.
Binary file modified
BIN
-480 KB
(6.3%)
tests/data/sen12ms/ROIs2017_winter/s1_1/ROIs2017_winter_s1_1_p1.tif
Binary file not shown.
Binary file modified
BIN
-480 KB
(6.3%)
tests/data/sen12ms/ROIs2017_winter/s1_1/ROIs2017_winter_s1_1_p2.tif
Binary file not shown.
Binary file modified
BIN
-1.52 MB
(6.3%)
tests/data/sen12ms/ROIs2017_winter/s2_1/ROIs2017_winter_s2_1_p1.tif
Binary file not shown.
Binary file modified
BIN
-1.52 MB
(6.3%)
tests/data/sen12ms/ROIs2017_winter/s2_1/ROIs2017_winter_s2_1_p2.tif
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
#!/usr/bin/env python3 | ||
|
||
# Copyright (c) Microsoft Corporation. All rights reserved. | ||
# Licensed under the MIT License. | ||
|
||
import hashlib | ||
import os | ||
import shutil | ||
|
||
import numpy as np | ||
import rasterio | ||
from rasterio.transform import Affine | ||
from rasterio.crs import CRS | ||
|
||
SIZE = 64 # image width/height | ||
|
||
np.random.seed(0) | ||
|
||
meta = { | ||
"driver": "GTiff", | ||
"nodata": None, | ||
"width": SIZE, | ||
"height": SIZE, | ||
"crs": CRS.from_epsg(32737), | ||
"transform": Affine(10.0, 0.0, 390772.3389928384, 0.0, -10.0, 8114182.836060452), | ||
} | ||
count = {"lc": 4, "s1": 2, "s2": 13} | ||
dtype = {"lc": np.uint16, "s1": np.float32, "s2": np.uint16} | ||
stop = {"lc": 11, "s1": np.iinfo(np.uint16).max, "s2": np.iinfo(np.uint16).max} | ||
|
||
file_list = [] | ||
seasons = ["ROIs1158_spring", "ROIs1868_summer", "ROIs1970_fall", "ROIs2017_winter"] | ||
for season in seasons: | ||
# Remove old data | ||
if os.path.exists(season): | ||
shutil.rmtree(season) | ||
|
||
for source in ["lc", "s1", "s2"]: | ||
tarball = f"{season}_{source}.tar.gz" | ||
|
||
# Remove old data | ||
if os.path.exists(tarball): | ||
os.remove(tarball) | ||
|
||
directory = os.path.join(season, f"{source}_1") | ||
os.makedirs(directory) | ||
|
||
# Random images | ||
for i in range(1, 3): | ||
filename = f"{season}_{source}_1_p{i}.tif" | ||
meta["count"] = count[source] | ||
meta["dtype"] = dtype[source] | ||
with rasterio.open(os.path.join(directory, filename), "w", **meta) as f: | ||
for j in range(1, count[source] + 1): | ||
data = np.random.randint(stop[source], size=(SIZE, SIZE)).astype( | ||
dtype[source] | ||
) | ||
f.write(data, j) | ||
|
||
if source == "s2": | ||
file_list.append(filename) | ||
|
||
# Create tarballs | ||
shutil.make_archive(f"{season}_{source}", "gztar", ".", directory) | ||
|
||
# Compute checksums | ||
with open(tarball, "rb") as f: | ||
md5 = hashlib.md5(f.read()).hexdigest() | ||
print(repr(md5) + ",") | ||
|
||
for split in ["train", "test"]: | ||
filename = f"{split}_list.txt" | ||
|
||
# Create file list | ||
with open(filename, "w") as f: | ||
for fname in file_list: | ||
f.write(f"{fname}\n") | ||
|
||
# Compute checksums | ||
with open(filename, "rb") as f: | ||
md5 = hashlib.md5(f.read()).hexdigest() | ||
print(repr(md5) + ",") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.