@@ -48,10 +48,10 @@ def semantic_postproc_func(raw_output: np.ndarray) -> np.ndarray:
4848 toolbox_env .running_on_ci () or not ON_GPU ,
4949 reason = "Local test on machine with GPU." ,
5050)
51- def test_functionality_local (remote_sample : Callable , tmp_path : Path ) -> None :
51+ def test_functionality_local (remote_sample : Callable , track_tmp_path : Path ) -> None :
5252 """Local functionality test for multi task segmentor."""
5353 gc .collect ()
54- root_save_dir = Path (tmp_path )
54+ root_save_dir = Path (track_tmp_path )
5555 mini_wsi_svs = Path (remote_sample ("svs-1-small" ))
5656 save_dir = root_save_dir / "multitask"
5757 shutil .rmtree (save_dir , ignore_errors = True )
@@ -100,9 +100,11 @@ def test_functionality_local(remote_sample: Callable, tmp_path: Path) -> None:
100100 assert score > 0.95 , "Heavy loss of precision!"
101101
102102
103- def test_functionality_hovernetplus (remote_sample : Callable , tmp_path : Path ) -> None :
103+ def test_functionality_hovernetplus (
104+ remote_sample : Callable , track_tmp_path : Path
105+ ) -> None :
104106 """Functionality test for multitask segmentor."""
105- root_save_dir = Path (tmp_path )
107+ root_save_dir = Path (track_tmp_path )
106108 mini_wsi_svs = Path (remote_sample ("wsi4_512_512_svs" ))
107109 required_dims = (258 , 258 )
108110 # above image is 512 x 512 at 0.252 mpp resolution. This is 258 x 258 at 0.500 mpp.
@@ -133,9 +135,9 @@ def test_functionality_hovernetplus(remote_sample: Callable, tmp_path: Path) ->
133135 )
134136
135137
136- def test_functionality_hovernet (remote_sample : Callable , tmp_path : Path ) -> None :
138+ def test_functionality_hovernet (remote_sample : Callable , track_tmp_path : Path ) -> None :
137139 """Functionality test for multitask segmentor."""
138- root_save_dir = Path (tmp_path )
140+ root_save_dir = Path (track_tmp_path )
139141 mini_wsi_svs = Path (remote_sample ("wsi4_512_512_svs" ))
140142
141143 save_dir = root_save_dir / "multi"
@@ -159,14 +161,14 @@ def test_functionality_hovernet(remote_sample: Callable, tmp_path: Path) -> None
159161 assert len (inst_dict ) > 0 , "Must have some nuclei."
160162
161163
162- def test_masked_segmentor (remote_sample : Callable , tmp_path : Path ) -> None :
164+ def test_masked_segmentor (remote_sample : Callable , track_tmp_path : Path ) -> None :
163165 """Test segmentor when image is masked."""
164- root_save_dir = Path (tmp_path )
166+ root_save_dir = Path (track_tmp_path )
165167 sample_wsi_svs = Path (remote_sample ("svs-1-small" ))
166168 sample_wsi_msk = remote_sample ("small_svs_tissue_mask" )
167169 sample_wsi_msk = np .load (sample_wsi_msk ).astype (np .uint8 )
168- imwrite (f"{ tmp_path } /small_svs_tissue_mask.jpg" , sample_wsi_msk )
169- sample_wsi_msk = tmp_path .joinpath ("small_svs_tissue_mask.jpg" )
170+ imwrite (f"{ track_tmp_path } /small_svs_tissue_mask.jpg" , sample_wsi_msk )
171+ sample_wsi_msk = track_tmp_path .joinpath ("small_svs_tissue_mask.jpg" )
170172
171173 save_dir = root_save_dir / "instance"
172174
@@ -208,10 +210,10 @@ def test_masked_segmentor(remote_sample: Callable, tmp_path: Path) -> None:
208210
209211def test_functionality_process_instance_predictions (
210212 remote_sample : Callable ,
211- tmp_path : Path ,
213+ track_tmp_path : Path ,
212214) -> None :
213215 """Test the functionality of instance predictions processing."""
214- root_save_dir = Path (tmp_path )
216+ root_save_dir = Path (track_tmp_path )
215217 mini_wsi_svs = Path (remote_sample ("wsi4_512_512_svs" ))
216218
217219 save_dir = root_save_dir / "semantic"
@@ -251,9 +253,9 @@ def test_functionality_process_instance_predictions(
251253 assert len (multi_segmentor ._wsi_inst_info [0 ]) == 0
252254
253255
254- def test_empty_image (tmp_path : Path ) -> None :
256+ def test_empty_image (track_tmp_path : Path ) -> None :
255257 """Test MultiTaskSegmentor for an empty image."""
256- root_save_dir = Path (tmp_path )
258+ root_save_dir = Path (track_tmp_path )
257259 sample_patch = np .ones ((256 , 256 , 3 ), dtype = "uint8" ) * 255
258260 sample_patch_path = root_save_dir / "sample_tile.png"
259261 imwrite (sample_patch_path , sample_patch )
@@ -320,9 +322,9 @@ def test_empty_image(tmp_path: Path) -> None:
320322 )
321323
322324
323- def test_functionality_semantic (remote_sample : Callable , tmp_path : Path ) -> None :
325+ def test_functionality_semantic (remote_sample : Callable , track_tmp_path : Path ) -> None :
324326 """Functionality test for multitask segmentor."""
325- root_save_dir = Path (tmp_path )
327+ root_save_dir = Path (track_tmp_path )
326328
327329 save_dir = root_save_dir / "multi"
328330 shutil .rmtree (save_dir , ignore_errors = True )
@@ -373,14 +375,14 @@ def test_functionality_semantic(remote_sample: Callable, tmp_path: Path) -> None
373375 assert layer_map is not None , "Must have some segmentations."
374376
375377
376- def test_crash_segmentor (remote_sample : Callable , tmp_path : Path ) -> None :
378+ def test_crash_segmentor (remote_sample : Callable , track_tmp_path : Path ) -> None :
377379 """Test engine crash when given malformed input."""
378- root_save_dir = Path (tmp_path )
380+ root_save_dir = Path (track_tmp_path )
379381 sample_wsi_svs = Path (remote_sample ("svs-1-small" ))
380382 sample_wsi_msk = remote_sample ("small_svs_tissue_mask" )
381383 sample_wsi_msk = np .load (sample_wsi_msk ).astype (np .uint8 )
382- imwrite (f"{ tmp_path } /small_svs_tissue_mask.jpg" , sample_wsi_msk )
383- sample_wsi_msk = tmp_path .joinpath ("small_svs_tissue_mask.jpg" )
384+ imwrite (f"{ track_tmp_path } /small_svs_tissue_mask.jpg" , sample_wsi_msk )
385+ sample_wsi_msk = track_tmp_path .joinpath ("small_svs_tissue_mask.jpg" )
384386
385387 save_dir = f"{ root_save_dir } /multi/"
386388
0 commit comments