From 87f7e4d42932e82c439de6941a4caa119b4a8636 Mon Sep 17 00:00:00 2001 From: Songki Choi Date: Thu, 22 Feb 2024 09:44:01 +0900 Subject: [PATCH 1/3] Fix default memcache size to 100MB Signed-off-by: Songki Choi --- src/otx/algorithms/classification/configs/configuration.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/otx/algorithms/classification/configs/configuration.yaml b/src/otx/algorithms/classification/configs/configuration.yaml index 03c327f88b2..971dbda5ad2 100644 --- a/src/otx/algorithms/classification/configs/configuration.yaml +++ b/src/otx/algorithms/classification/configs/configuration.yaml @@ -441,7 +441,7 @@ algo_backend: warning: null mem_cache_size: affects_outcome_of: TRAINING - default_value: 1000000000 + default_value: 100000000 description: Size of memory pool for caching decoded data to load data faster (bytes). editable: true header: Size of memory pool @@ -453,7 +453,7 @@ algo_backend: operator: AND rules: [] type: UI_RULES - visible_in_ui: false + visible_in_ui: true warning: null storage_cache_scheme: affects_outcome_of: TRAINING From 761ffe9d5093e4f5ad4755f764b632e96d965050 Mon Sep 17 00:00:00 2001 From: Songki Choi Date: Thu, 22 Feb 2024 10:57:46 +0900 Subject: [PATCH 2/3] Deal with empty annotation of 'No Object' label images Signed-off-by: Songki Choi --- .../adapters/mmcv/pipelines/load_image_from_otx_dataset.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/otx/algorithms/common/adapters/mmcv/pipelines/load_image_from_otx_dataset.py b/src/otx/algorithms/common/adapters/mmcv/pipelines/load_image_from_otx_dataset.py index b5df29dcd96..d49e5963aa6 100644 --- a/src/otx/algorithms/common/adapters/mmcv/pipelines/load_image_from_otx_dataset.py +++ b/src/otx/algorithms/common/adapters/mmcv/pipelines/load_image_from_otx_dataset.py @@ -152,7 +152,10 @@ def _load_ann_if_any(self, results: Dict[str, Any]) -> Dict[str, Any]: """Load annotations and fill the results dict.""" if self._load_ann_op is None: return results - return self._load_ann_op(results) + ann_results = self._load_ann_op(results) + if ann_results is None: + return results + return ann_results def _resize_img_ann_if_any(self, results: Dict[str, Any]) -> Dict[str, Any]: """Resize image and annotations if needed and fill the results dict.""" From a002410b1e739ae6496707c18c179fbf606c8556 Mon Sep 17 00:00:00 2001 From: Songki Choi Date: Thu, 22 Feb 2024 11:07:56 +0900 Subject: [PATCH 3/3] Revert UI option for memcache --- .../algorithms/classification/configs/configuration.yaml | 2 +- .../adapters/mmcv/pipelines/load_image_from_otx_dataset.py | 7 +++---- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/src/otx/algorithms/classification/configs/configuration.yaml b/src/otx/algorithms/classification/configs/configuration.yaml index 971dbda5ad2..ba4510a863b 100644 --- a/src/otx/algorithms/classification/configs/configuration.yaml +++ b/src/otx/algorithms/classification/configs/configuration.yaml @@ -453,7 +453,7 @@ algo_backend: operator: AND rules: [] type: UI_RULES - visible_in_ui: true + visible_in_ui: false warning: null storage_cache_scheme: affects_outcome_of: TRAINING diff --git a/src/otx/algorithms/common/adapters/mmcv/pipelines/load_image_from_otx_dataset.py b/src/otx/algorithms/common/adapters/mmcv/pipelines/load_image_from_otx_dataset.py index d49e5963aa6..fa0c94518d9 100644 --- a/src/otx/algorithms/common/adapters/mmcv/pipelines/load_image_from_otx_dataset.py +++ b/src/otx/algorithms/common/adapters/mmcv/pipelines/load_image_from_otx_dataset.py @@ -152,10 +152,7 @@ def _load_ann_if_any(self, results: Dict[str, Any]) -> Dict[str, Any]: """Load annotations and fill the results dict.""" if self._load_ann_op is None: return results - ann_results = self._load_ann_op(results) - if ann_results is None: - return results - return ann_results + return self._load_ann_op(results) def _resize_img_ann_if_any(self, results: Dict[str, Any]) -> Dict[str, Any]: """Resize image and annotations if needed and fill the results dict.""" @@ -207,6 +204,8 @@ def __call__(self, results: Dict[str, Any]) -> Dict[str, Any]: return cached_results results = self._load_img(results) results = self._load_ann_if_any(results) + if results is None: + return None results.pop("dataset_item", None) # Prevent deepcopy or caching results = self._resize_img_ann_if_any(results) self._save_cache(results)