-
Notifications
You must be signed in to change notification settings - Fork 397
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
CV4A Kenya Crop Type: radiant mlhub -> source cooperative (#2090)
- Loading branch information
1 parent
83cad60
commit 32aa349
Showing
21 changed files
with
134 additions
and
254 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
train,test | ||
1,2 | ||
3,4 | ||
5 | ||
6 |
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,51 @@ | ||
#!/usr/bin/env python3 | ||
|
||
# Copyright (c) Microsoft Corporation. All rights reserved. | ||
# Licensed under the MIT License. | ||
|
||
import os | ||
|
||
import numpy as np | ||
from PIL import Image | ||
|
||
DTYPE = np.float32 | ||
SIZE = 2 | ||
|
||
np.random.seed(0) | ||
|
||
all_bands = ( | ||
'B01', | ||
'B02', | ||
'B03', | ||
'B04', | ||
'B05', | ||
'B06', | ||
'B07', | ||
'B08', | ||
'B8A', | ||
'B09', | ||
'B11', | ||
'B12', | ||
'CLD', | ||
) | ||
|
||
for tile in range(1): | ||
directory = os.path.join('data', str(tile)) | ||
os.makedirs(directory, exist_ok=True) | ||
|
||
arr = np.random.randint(np.iinfo(np.int32).max, size=(SIZE, SIZE), dtype=np.int32) | ||
img = Image.fromarray(arr) | ||
img.save(os.path.join(directory, f'{tile}_field_id.tif')) | ||
|
||
arr = np.random.randint(np.iinfo(np.uint8).max, size=(SIZE, SIZE), dtype=np.uint8) | ||
img = Image.fromarray(arr) | ||
img.save(os.path.join(directory, f'{tile}_label.tif')) | ||
|
||
for date in ['20190606']: | ||
directory = os.path.join(directory, date) | ||
os.makedirs(directory, exist_ok=True) | ||
|
||
for band in all_bands: | ||
arr = np.random.rand(SIZE, SIZE).astype(DTYPE) * np.finfo(DTYPE).max | ||
img = Image.fromarray(arr) | ||
img.save(os.path.join(directory, f'{tile}_{band}_{date}.tif')) |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed
BIN
-603 Bytes
tests/data/ref_african_crops_kenya_02/ref_african_crops_kenya_02_labels.tar.gz
Binary file not shown.
Binary file removed
BIN
-638 Bytes
tests/data/ref_african_crops_kenya_02/ref_african_crops_kenya_02_source.tar.gz
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
Oops, something went wrong.