Skip to content

Commit

Permalink
Add inference segmentation test files
Browse files Browse the repository at this point in the history
  • Loading branch information
valhassan committed May 15, 2024
1 parent fd5dfe8 commit e7d610e
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 0 deletions.
1 change: 1 addition & 0 deletions tests/data/inference/test.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
tests/data/inference/test.tif
Binary file added tests/data/inference/test.tif
Binary file not shown.
Binary file added tests/data/inference/test_model.pt
Binary file not shown.
27 changes: 27 additions & 0 deletions tests/test_inference_segmentation.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import os
from pathlib import Path
from omegaconf import DictConfig
from inference_segmentation import main as run_inference

def test_inference_segmentation():
"""Test inference segmentation"""
working_folder = "tests/data/inference"
model_path = "tests/data/inference/test_model.pt"
raw_data_csv = "tests/data/inference/test.csv"
data_dir = "tests/data/inference"
bands_requested = [1, 2, 3]
output_mask = Path("tests/data/inference/test_mask.tif")

cfg = {"general": {"project_name": "inference_segmentation_test"},
"dataset": {"bands": bands_requested,
"raw_data_dir": data_dir,},
"inference": {"model_path": model_path,
"raw_data_csv": raw_data_csv,
"root_dir":working_folder},
"tiling": {"clahe_clip_limit": 0},}

cfg = DictConfig(cfg)
run_inference(cfg)
assert output_mask.exists()
os.remove(output_mask)

0 comments on commit e7d610e

Please sign in to comment.