Skip to content

Commit

Permalink
tests correction for torchego extract
Browse files Browse the repository at this point in the history
  • Loading branch information
mpelchat04 committed Sep 6, 2024
1 parent 6efd4f1 commit 7e9d082
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
16 changes: 8 additions & 8 deletions tests/test_tiling_segmentation.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ def test_outputted_chips(self):
data_dir = f"data/patches"
proj = f"tiling_output_test"
Path(data_dir).mkdir(exist_ok=True, parents=True)
extract_archive(src="tests/data/massachusetts_buildings_kaggle.zip")
extract_archive(from_path="tests/data/massachusetts_buildings_kaggle.zip")
cfg = {
"general": {"project_name": proj},
"debug": True,
Expand Down Expand Up @@ -49,7 +49,7 @@ def test_outputted_chips(self):

def test_min_annotated_percent_filter(self):
"""Tests the minimum annotated percent filter"""
extract_archive(src="tests/data/new_brunswick_aerial.zip")
extract_archive(from_path="tests/data/new_brunswick_aerial.zip")
data = read_csv("tests/tiling/tiling_segmentation_multiclass_ci.csv")
iterator = iter(data)
row = next(iterator)
Expand All @@ -60,8 +60,8 @@ def test_val_percent(self):
"""Tests the trn/val sorting to ensure the result is close enough to requested val_percent"""
data_dir = f"data/patches"
Path(data_dir).mkdir(exist_ok=True, parents=True)
extract_archive(src="tests/data/spacenet.zip")
extract_archive(src="tests/data/new_brunswick_aerial.zip")
extract_archive(from_path="tests/data/spacenet.zip")
extract_archive(from_path="tests/data/new_brunswick_aerial.zip")
proj_prefix = "test_val_percent"
datasets = {"binary-multiband", "multiclass"}
results = []
Expand Down Expand Up @@ -106,8 +106,8 @@ def test_annot_percent(self):
"""Tests the minimum annotated percentage to assert ground truth patches with mostly background are rejected"""
data_dir = f"data/patches"
Path(data_dir).mkdir(exist_ok=True, parents=True)
extract_archive(src="tests/data/spacenet.zip")
extract_archive(src="tests/data/new_brunswick_aerial.zip")
extract_archive(from_path="tests/data/spacenet.zip")
extract_archive(from_path="tests/data/new_brunswick_aerial.zip")
proj_prefix = "test_annot_percent"
datasets = {"binary-multiband", "multiclass"}
results = []
Expand Down Expand Up @@ -151,7 +151,7 @@ def test_annot_percent(self):
def test_tiling_segmentation_parallel(self):
data_dir = "data/patches"
Path(data_dir).mkdir(exist_ok=True, parents=True)
extract_archive(src="tests/data/new_brunswick_aerial.zip")
extract_archive(from_path="tests/data/new_brunswick_aerial.zip")
proj = "test_parallel"
cfg = {
"general": {"project_name": proj},
Expand Down Expand Up @@ -190,7 +190,7 @@ def test_tiling_inference(self):
"""Tests tiling of imagery only for inference"""
data_dir = "data/patches"
Path(data_dir).mkdir(exist_ok=True, parents=True)
extract_archive(src="tests/data/new_brunswick_aerial.zip")
extract_archive(from_path="tests/data/new_brunswick_aerial.zip")
project_name = "test_inference"
cfg = {
"general": {"project_name": project_name},
Expand Down
2 changes: 1 addition & 1 deletion tests/test_verify_segmentation.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
class TestVerify(object):
def test_verify_per_aoi(self):
"""Test stats outputs from an AOI"""
extract_archive(src="tests/data/new_brunswick_aerial.zip")
extract_archive(from_path="tests/data/new_brunswick_aerial.zip")
data = read_csv("tests/tiling/tiling_segmentation_multiclass_ci.csv")
aoi = AOI(raster=data[0]['tif'], label=data[0]['gpkg'], split=data[0]['split'])
aoi_dict, error = verify_per_aoi(
Expand Down

0 comments on commit 7e9d082

Please sign in to comment.