From 44890480c3b41a6310ca2bd1ba6e9175b35a655b Mon Sep 17 00:00:00 2001 From: "brian.kim" Date: Wed, 30 Oct 2024 12:23:07 -0700 Subject: [PATCH 1/3] now saved in seg --- src/allencell_ml_segmenter/prediction/model.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/allencell_ml_segmenter/prediction/model.py b/src/allencell_ml_segmenter/prediction/model.py index 8c1ddf8c..c31eaa1c 100644 --- a/src/allencell_ml_segmenter/prediction/model.py +++ b/src/allencell_ml_segmenter/prediction/model.py @@ -81,7 +81,7 @@ def get_output_seg_directory(self) -> Optional[Path]: Gets path to where segmentation predictions are stored. """ return ( - self._output_directory / "target" + self._output_directory / "seg" if self._output_directory is not None else None ) From 4caa49d09d4cddf71e251a95599282b2e1f6f54e Mon Sep 17 00:00:00 2001 From: "brian.kim" Date: Wed, 30 Oct 2024 12:23:57 -0700 Subject: [PATCH 2/3] different channel override --- src/allencell_ml_segmenter/services/prediction_service.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/allencell_ml_segmenter/services/prediction_service.py b/src/allencell_ml_segmenter/services/prediction_service.py index 0ffaec7c..5cc83b1e 100644 --- a/src/allencell_ml_segmenter/services/prediction_service.py +++ b/src/allencell_ml_segmenter/services/prediction_service.py @@ -157,10 +157,8 @@ def build_overrides(self, checkpoint: Path) -> dict[str, Any]: channel: Optional[int] = ( self._prediction_model.get_image_input_channel_index() ) - if channel: - overrides["data.transforms.predict.transforms[1].reader[0].C"] = ( - channel - ) + if channel is not None: + overrides["input_channel"] = channel # selecting hardware- GPU if available (and correct drivers installed), # CPU otherwise. From cc96c6fbec1c110c605460afe1127d0ec862a311 Mon Sep 17 00:00:00 2001 From: "brian.kim" Date: Wed, 30 Oct 2024 13:12:10 -0700 Subject: [PATCH 3/3] fix tests --- .../_tests/services/test_prediction_service.py | 2 +- .../{target => seg}/output_1.tiff | Bin .../{target => seg}/output_2.tiff | Bin .../{target => seg}/output_1.tiff | 0 .../{target => seg}/output_2.tiff | 0 .../{target => seg}/output_3.tiff | 0 .../{target => seg}/output_4.tiff | 0 7 files changed, 1 insertion(+), 1 deletion(-) rename src/allencell_ml_segmenter/_tests/test_files/output_test_folder/{target => seg}/output_1.tiff (100%) rename src/allencell_ml_segmenter/_tests/test_files/output_test_folder/{target => seg}/output_2.tiff (100%) rename src/allencell_ml_segmenter/_tests/test_files/output_test_folder_extra/{target => seg}/output_1.tiff (100%) rename src/allencell_ml_segmenter/_tests/test_files/output_test_folder_extra/{target => seg}/output_2.tiff (100%) rename src/allencell_ml_segmenter/_tests/test_files/output_test_folder_extra/{target => seg}/output_3.tiff (100%) rename src/allencell_ml_segmenter/_tests/test_files/output_test_folder_extra/{target => seg}/output_4.tiff (100%) diff --git a/src/allencell_ml_segmenter/_tests/services/test_prediction_service.py b/src/allencell_ml_segmenter/_tests/services/test_prediction_service.py index 5b6a88a9..5e3cf5ea 100644 --- a/src/allencell_ml_segmenter/_tests/services/test_prediction_service.py +++ b/src/allencell_ml_segmenter/_tests/services/test_prediction_service.py @@ -150,7 +150,7 @@ def test_build_overrides() -> None: / "0_exp" / "prediction_output_test" ) - assert overrides["data.transforms.predict.transforms[1].reader[0].C"] == 3 + assert overrides["input_channel"] == 3 assert overrides["data.columns"] == ["raw", "split"] assert overrides["data.split_column"] == "split" diff --git a/src/allencell_ml_segmenter/_tests/test_files/output_test_folder/target/output_1.tiff b/src/allencell_ml_segmenter/_tests/test_files/output_test_folder/seg/output_1.tiff similarity index 100% rename from src/allencell_ml_segmenter/_tests/test_files/output_test_folder/target/output_1.tiff rename to src/allencell_ml_segmenter/_tests/test_files/output_test_folder/seg/output_1.tiff diff --git a/src/allencell_ml_segmenter/_tests/test_files/output_test_folder/target/output_2.tiff b/src/allencell_ml_segmenter/_tests/test_files/output_test_folder/seg/output_2.tiff similarity index 100% rename from src/allencell_ml_segmenter/_tests/test_files/output_test_folder/target/output_2.tiff rename to src/allencell_ml_segmenter/_tests/test_files/output_test_folder/seg/output_2.tiff diff --git a/src/allencell_ml_segmenter/_tests/test_files/output_test_folder_extra/target/output_1.tiff b/src/allencell_ml_segmenter/_tests/test_files/output_test_folder_extra/seg/output_1.tiff similarity index 100% rename from src/allencell_ml_segmenter/_tests/test_files/output_test_folder_extra/target/output_1.tiff rename to src/allencell_ml_segmenter/_tests/test_files/output_test_folder_extra/seg/output_1.tiff diff --git a/src/allencell_ml_segmenter/_tests/test_files/output_test_folder_extra/target/output_2.tiff b/src/allencell_ml_segmenter/_tests/test_files/output_test_folder_extra/seg/output_2.tiff similarity index 100% rename from src/allencell_ml_segmenter/_tests/test_files/output_test_folder_extra/target/output_2.tiff rename to src/allencell_ml_segmenter/_tests/test_files/output_test_folder_extra/seg/output_2.tiff diff --git a/src/allencell_ml_segmenter/_tests/test_files/output_test_folder_extra/target/output_3.tiff b/src/allencell_ml_segmenter/_tests/test_files/output_test_folder_extra/seg/output_3.tiff similarity index 100% rename from src/allencell_ml_segmenter/_tests/test_files/output_test_folder_extra/target/output_3.tiff rename to src/allencell_ml_segmenter/_tests/test_files/output_test_folder_extra/seg/output_3.tiff diff --git a/src/allencell_ml_segmenter/_tests/test_files/output_test_folder_extra/target/output_4.tiff b/src/allencell_ml_segmenter/_tests/test_files/output_test_folder_extra/seg/output_4.tiff similarity index 100% rename from src/allencell_ml_segmenter/_tests/test_files/output_test_folder_extra/target/output_4.tiff rename to src/allencell_ml_segmenter/_tests/test_files/output_test_folder_extra/seg/output_4.tiff