openvinotoolkit / training_extensions

Train, Evaluate, Optimize, Deploy Computer Vision Models via OpenVINO™
https://openvinotoolkit.github.io/training_extensions/
Apache License 2.0
1.14k stars 443 forks source link

There is an issue with the library import structure. #2289

Closed harimkang closed 1 year ago

harimkang commented 1 year ago

Describe the bug

MMCV, a non-required installer library, is imported inside otx.core.data.caching. (MMCV is currently an optional requirement.) https://github.com/openvinotoolkit/training_extensions/blob/develop/otx/core/data/caching/__init__.py

Currently, importing from otx.core.data.adapter.base_dataset_adapter import BaseDatasetAdapter alone imports mmcv.

We'll need to move the location of the three classes above. It looks like this should be moved to otx/algorithms/common/adapters/mmcv/hooks. and https://github.com/openvinotoolkit/training_extensions/blob/4492e510a22a47c4f92b8108888fa28654a6216b/otx/core/data/caching/mem_cache_handler.py#L181 should be modified or relocated accordingly.

This probably causes problems with using anomaly alone by itself. @samet-akcay

Steps to Reproduce

  1. tox devenv -e Integration-Test-py39-ano ./venv-ano
  2. source ./venv-ano/bin/activate

Environment:

harimkang commented 1 year ago

I have created a PR to address this. https://github.com/openvinotoolkit/training_extensions/pull/2293