Skip to content

Commit

Permalink
xView2: deterministic dataset order (#1918)
Browse files Browse the repository at this point in the history
  • Loading branch information
adamjstewart authored and isaaccorley committed Mar 2, 2024
1 parent 76c46a4 commit cdaada0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion torchgeo/datasets/xview.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ def _load_files(self, root: str, split: str) -> list[dict[str, str]]:
images = glob.glob(os.path.join(image_root, "*.png"))
basenames = [os.path.basename(f) for f in images]
basenames = ["_".join(f.split("_")[:-2]) for f in basenames]
for name in set(basenames):
for name in sorted(set(basenames)):
image1 = os.path.join(image_root, f"{name}_pre_disaster.png")
image2 = os.path.join(image_root, f"{name}_post_disaster.png")
mask1 = os.path.join(mask_root, f"{name}_pre_disaster_target.png")
Expand Down

0 comments on commit cdaada0

Please sign in to comment.