diff --git a/tests/data/spacenet/sn2_AOI_2_Vegas.tar.gz b/tests/data/spacenet/sn2_AOI_2_Vegas.tar.gz index e36ec536023..fe01659fe2e 100644 Binary files a/tests/data/spacenet/sn2_AOI_2_Vegas.tar.gz and b/tests/data/spacenet/sn2_AOI_2_Vegas.tar.gz differ diff --git a/tests/datasets/test_spacenet.py b/tests/datasets/test_spacenet.py index 9ceff3afc74..35ce3cecf16 100644 --- a/tests/datasets/test_spacenet.py +++ b/tests/datasets/test_spacenet.py @@ -87,7 +87,7 @@ def dataset( 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", diff --git a/torchgeo/datasets/spacenet.py b/torchgeo/datasets/spacenet.py index 32fb0983cee..5cf7d9fe5de 100644 --- a/torchgeo/datasets/spacenet.py +++ b/torchgeo/datasets/spacenet.py @@ -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 @@ def __init__( 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.