From 213a2e38c797e6ce12d149c9ce504d38563668cb Mon Sep 17 00:00:00 2001 From: Songki Choi Date: Fri, 23 Feb 2024 09:16:29 +0900 Subject: [PATCH] Fix default memcache size to 100MB (#2960) * Fix default memcache size to 100MB * Deal with empty annotation of 'No Object' label images --------- Signed-off-by: Songki Choi --- src/otx/algorithms/classification/configs/configuration.yaml | 2 +- .../adapters/mmcv/pipelines/load_image_from_otx_dataset.py | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/otx/algorithms/classification/configs/configuration.yaml b/src/otx/algorithms/classification/configs/configuration.yaml index 03c327f88b2..ba4510a863b 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 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..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 @@ -204,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)