Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
bartoszptak committed Feb 8, 2024
1 parent 6d7a884 commit 24845ba
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Binary file modified test/data/dummy_model/dummy_recognition_model.onnx
Binary file not shown.
8 changes: 4 additions & 4 deletions test/test_map_processor_recognition.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
from deepness.common.processing_parameters.map_processing_parameters import ModelOutputFormat, ProcessedAreaType
from deepness.common.processing_parameters.recognition_parameters import RecognitionParameters
from deepness.processing.map_processor.map_processor_recognition import MapProcessorRecognition
from deepness.processing.models.segmentor import Segmentor
from deepness.processing.models.recognition import Recognition

RASTER_FILE_PATH = get_dummy_recognition_map_path()

Expand All @@ -30,12 +30,12 @@ def test_dummy_model_processing__entire_file():
qgs = init_qgis()

rlayer = create_rlayer_from_file(RASTER_FILE_PATH)
model = Segmentor(MODEL_FILE_PATH)
model = Recognition(MODEL_FILE_PATH)

params = RecognitionParameters(
resolution_cm_per_px=50,
tile_size_px=model.get_input_size_in_pixels()[0], # same x and y dimensions, so take x
batch_size=1,
batch_size=2,
local_cache=False,
processed_area_type=ProcessedAreaType.ENTIRE_LAYER,
mask_layer_id=None,
Expand Down Expand Up @@ -63,7 +63,7 @@ def test_dummy_model_processing__entire_file():
vmin = result_img.min()
vmax = result_img.max()

assert np.isclose(vmin, 0.9623341, atol=1e-6)
assert np.isclose(vmin, -0.06747727, atol=1e-6)
assert np.isclose(vmax, 1.0, atol=1e-6)

assert len(np.argwhere(result_img == result_img.max())) == 891
Expand Down

0 comments on commit 24845ba

Please sign in to comment.