зеркало из https://github.com/microsoft/torchgeo.git
SpaceNet2 update (#469)
This commit is contained in:
Родитель
1d8e010442
Коммит
76603f3343
Двоичные данные
tests/data/spacenet/sn2_AOI_2_Vegas.tar.gz
Двоичные данные
tests/data/spacenet/sn2_AOI_2_Vegas.tar.gz
Двоичный файл не отображается.
|
@ -87,7 +87,7 @@ class TestSpaceNet2:
|
|||
radiant_mlhub = pytest.importorskip("radiant_mlhub", minversion="0.2.1")
|
||||
monkeypatch.setattr(radiant_mlhub.Collection, "fetch", fetch_collection)
|
||||
test_md5 = {
|
||||
"sn2_AOI_2_Vegas": "b3236f58604a9d746c4e09b3e487e427",
|
||||
"sn2_AOI_2_Vegas": "6ceae7ff8c557346e8a4c8b6c61cc1b9",
|
||||
"sn2_AOI_3_Paris": "811e6a26fdeb8be445fed99769fa52c5",
|
||||
"sn2_AOI_4_Shanghai": "139d1627d184c74426a85ad0222f7355",
|
||||
"sn2_AOI_5_Khartoum": "435535120414b74165aa87f051c3a2b3",
|
||||
|
|
|
@ -501,7 +501,7 @@ class SpaceNet2(SpaceNet):
|
|||
|
||||
dataset_id = "spacenet2"
|
||||
collection_md5_dict = {
|
||||
"sn2_AOI_2_Vegas": "cdc5df70920adca870a9fd0dfc4cca26",
|
||||
"sn2_AOI_2_Vegas": "a5a8de355290783b88ac4d69c7ef0694",
|
||||
"sn2_AOI_3_Paris": "8299186b7bbfb9a256d515bad1b7f146",
|
||||
"sn2_AOI_4_Shanghai": "4e3e80f2f437faca10ca2e6e6df0ef99",
|
||||
"sn2_AOI_5_Khartoum": "8070ff9050f94cd9f0efe9417205d7c3",
|
||||
|
@ -553,35 +553,6 @@ class SpaceNet2(SpaceNet):
|
|||
root, image, collections, transforms, download, api_key, checksum
|
||||
)
|
||||
|
||||
# TODO: Remove this once radiantearth/radiant-mlhub#65 is fixed
|
||||
def _load_files(self, root: str) -> List[Dict[str, str]]:
|
||||
"""Return the paths of the files in the dataset.
|
||||
|
||||
Args:
|
||||
root: root dir of dataset
|
||||
|
||||
Returns:
|
||||
list of dicts containing paths for each pair of image and label
|
||||
"""
|
||||
files = []
|
||||
pat = re.compile("img1" + re.escape(os.sep))
|
||||
for collection in self.collections:
|
||||
images = glob.glob(os.path.join(root, collection, "*", self.filename))
|
||||
images = sorted(images)
|
||||
for imgpath in images:
|
||||
if collection == "sn2_AOI_2_Vegas" and pat.search(imgpath):
|
||||
lbl_path = os.path.join(
|
||||
os.path.dirname(os.path.dirname(imgpath)),
|
||||
"_common",
|
||||
"labels.geojson",
|
||||
)
|
||||
else:
|
||||
lbl_path = os.path.join(
|
||||
os.path.dirname(imgpath) + "-labels", self.label_glob
|
||||
)
|
||||
files.append({"image_path": imgpath, "label_path": lbl_path})
|
||||
return files
|
||||
|
||||
|
||||
class SpaceNet4(SpaceNet):
|
||||
"""SpaceNet 4: Off-Nadir Buildings Dataset.
|
||||
|
|
Загрузка…
Ссылка в новой задаче