diff --git a/docs/source/guide/explanation/algorithms/classification/multi_class_classification.rst b/docs/source/guide/explanation/algorithms/classification/multi_class_classification.rst index 07b571cefec..3923b077434 100644 --- a/docs/source/guide/explanation/algorithms/classification/multi_class_classification.rst +++ b/docs/source/guide/explanation/algorithms/classification/multi_class_classification.rst @@ -206,7 +206,7 @@ Unlike other tasks, ``--val-data-root`` is not needed. $ otx train otx/algorithms/classification/configs/efficientnet_b0_cls_incr/template.yaml \ --train-data-root=tests/assets/imagenet_dataset_class_incremental \ params \ - --algo_backend.train_type=SELFSUPERVISED + --algo_backend.train_type=Selfsupervised After self-supervised training, pretrained weights can be use for supervised (incremental) learning like the below command: diff --git a/docs/source/guide/explanation/algorithms/segmentation/semantic_segmentation.rst b/docs/source/guide/explanation/algorithms/segmentation/semantic_segmentation.rst index ede1c246464..5ae38d350fb 100644 --- a/docs/source/guide/explanation/algorithms/segmentation/semantic_segmentation.rst +++ b/docs/source/guide/explanation/algorithms/segmentation/semantic_segmentation.rst @@ -165,7 +165,7 @@ To enable self-supervised training, the command below can be executed: $ otx train otx/algorithms/segmentation/configs/ocr_lite_hrnet_s_mod2/template.yaml \ --train-data-roots=tests/assets/common_semantic_segmentation_dataset/train/images \ params \ - --algo_backend.train_type=SELFSUPERVISED + --algo_backend.train_type=Selfsupervised After self-supervised training, pretrained weights can be use for supervised (incremental) learning like the below command: diff --git a/docs/source/guide/get_started/quick_start_guide/cli_commands.rst b/docs/source/guide/get_started/quick_start_guide/cli_commands.rst index 2d628d9c4a9..de32e70d1ab 100644 --- a/docs/source/guide/get_started/quick_start_guide/cli_commands.rst +++ b/docs/source/guide/get_started/quick_start_guide/cli_commands.rst @@ -92,7 +92,7 @@ Building workspace folder Comma-separated paths to unlabeled file list --task TASK The currently supported options: ('CLASSIFICATION', 'DETECTION', 'INSTANCE_SEGMENTATION', 'SEGMENTATION', 'ACTION_CLASSIFICATION', 'ACTION_DETECTION', 'ANOMALY_CLASSIFICATION', 'ANOMALY_DETECTION', 'ANOMALY_SEGMENTATION'). --train-type TRAIN_TYPE - The currently supported options: dict_keys(['INCREMENTAL', 'SEMISUPERVISED', 'SELFSUPERVISED']). + The currently supported options: dict_keys(['Incremental', 'Semisupervised', 'Selfsupervised']). --work-dir WORK_DIR Location where the workspace. --model MODEL Enter the name of the model you want to use. (Ex. EfficientNet-B0). --backbone BACKBONE Available Backbone Type can be found using 'otx find --backbone {framework}'. @@ -181,7 +181,7 @@ However, if you created a workspace with ``otx build``, the training process can --unlabeled-file-list UNLABELED_FILE_LIST Comma-separated paths to unlabeled file list --train-type TRAIN_TYPE - The currently supported options: dict_keys(['INCREMENTAL', 'SEMISUPERVISED', 'SELFSUPERVISED']). + The currently supported options: dict_keys(['Incremental', 'Semisupervised', 'Selfsupervised']). --load-weights LOAD_WEIGHTS Load model weights from previously saved checkpoint. --resume-from RESUME_FROM diff --git a/docs/source/guide/tutorials/advanced/self_sl.rst b/docs/source/guide/tutorials/advanced/self_sl.rst index 96de2beb42c..6de99a97d50 100644 --- a/docs/source/guide/tutorials/advanced/self_sl.rst +++ b/docs/source/guide/tutorials/advanced/self_sl.rst @@ -64,23 +64,23 @@ for **self-supervised learning** by running the following command: .. code-block:: - (otx) ...$ otx build --train-data-roots data/flower_photos --model MobileNet-V3-large-1x --train-type SELFSUPERVISED --work-dir otx-workspace-CLASSIFICATION-SELFSUPERVISED + (otx) ...$ otx build --train-data-roots data/flower_photos --model MobileNet-V3-large-1x --train-type Selfsupervised --work-dir otx-workspace-CLASSIFICATION-Selfsupervised - [*] Workspace Path: otx-workspace-CLASSIFICATION-SELFSUPERVISED + [*] Workspace Path: otx-workspace-CLASSIFICATION-Selfsupervised [*] Load Model Template ID: Custom_Image_Classification_MobileNet-V3-large-1x - [*] Load Model Name: MobileNet-V3-large-1x[*] - Updated: otx-workspace-CLASSIFICATION-SELFSUPERVISED/selfsl/model.py - [*] - Updated: otx-workspace-CLASSIFICATION-SELFSUPERVISED/selfsl/data_pipeline.py - [*] - Updated: otx-workspace-CLASSIFICATION-SELFSUPERVISED/deployment.py - [*] - Updated: otx-workspace-CLASSIFICATION-SELFSUPERVISED/hpo_config.yaml - [*] - Updated: otx-workspace-CLASSIFICATION-SELFSUPERVISED/model_hierarchical.py - [*] - Updated: otx-workspace-CLASSIFICATION-SELFSUPERVISED/model_multilabel.py - [*] Update data configuration file to: otx-workspace-CLASSIFICATION-SELFSUPERVISED/data.yaml + [*] Load Model Name: MobileNet-V3-large-1x[*] - Updated: otx-workspace-CLASSIFICATION-Selfsupervised/selfsl/model.py + [*] - Updated: otx-workspace-CLASSIFICATION-Selfsupervised/selfsl/data_pipeline.py + [*] - Updated: otx-workspace-CLASSIFICATION-Selfsupervised/deployment.py + [*] - Updated: otx-workspace-CLASSIFICATION-Selfsupervised/hpo_config.yaml + [*] - Updated: otx-workspace-CLASSIFICATION-Selfsupervised/model_hierarchical.py + [*] - Updated: otx-workspace-CLASSIFICATION-Selfsupervised/model_multilabel.py + [*] Update data configuration file to: otx-workspace-CLASSIFICATION-Selfsupervised/data.yaml .. note:: Three things must be considered to set the workspace for self-supervised learning: - 1. add ``--train-type SELFSUPERVISED`` in the command to get the training components for self-supervised learning, + 1. add ``--train-type Selfsupervised`` in the command to get the training components for self-supervised learning, 2. update the path set as ``train-data-roots``, 3. and add ``--work-dir`` to distinguish self-supervised learning workspace from supervised learning workspace. @@ -102,7 +102,7 @@ After the workspace creation, the workspace structure is as follows: │   ├── train │   └── val └── template.yaml - otx-workspace-CLASSIFICATION-SELFSUPERVISED + otx-workspace-CLASSIFICATION-Selfsupervised ├── configuration.yaml ├── data.yaml ├── deployment.py @@ -121,20 +121,20 @@ After the workspace creation, the workspace structure is as follows: For `VOC2012 dataset `_ used in :doc:`semantic segmentation tutorial <../base/how_to_train/semantic_segmentation>`, for example, the path ``data/VOCdevkit/VOC2012/JPEGImages`` must be set instead of ``data/VOCdevkit/VOC2012``. Please refer to :ref:`Explanation of Self-Supervised Learning for Semantic Segmentation `. - And don't forget to add ``--train-type SELFSUPERVISED``. + And don't forget to add ``--train-type Selfsupervised``. .. code-block:: (otx) ...$ otx build --train-data-roots data/VOCdevkit/VOC2012/JPEGImages \ --model Lite-HRNet-18-mod2 \ - --train-type SELFSUPERVISED + --train-type Selfsupervised 4. To start training we need to call ``otx train`` command in **self-supervised learning** workspace: .. code-block:: - (otx) ...$ cd otx-workspace-CLASSIFICATION-SELFSUPERVISED + (otx) ...$ cd otx-workspace-CLASSIFICATION-Selfsupervised (otx) ...$ otx train --data ../otx-workspace-CLASSIFICATION/data.yaml ... @@ -168,7 +168,7 @@ After pre-training progress, start fine-tuning by calling the below command with .. code-block:: (otx) ...$ cd ../otx-workspace-CLASSIFICATION - (otx) ...$ otx train --load-weights ../otx-workspace-CLASSIFICATION-SELFSUPERVISED/models/weights.pth + (otx) ...$ otx train --load-weights ../otx-workspace-CLASSIFICATION-Selfsupervised/models/weights.pth ... diff --git a/docs/source/guide/tutorials/advanced/semi_sl.rst b/docs/source/guide/tutorials/advanced/semi_sl.rst index cce334631e9..ef81cf598d5 100644 --- a/docs/source/guide/tutorials/advanced/semi_sl.rst +++ b/docs/source/guide/tutorials/advanced/semi_sl.rst @@ -73,7 +73,7 @@ Enable via ``otx build`` 1. To enable semi-supervsied learning via ``otx build``, we need to add arguments ``--unlabeled-data-roots`` and ``--train-type``. OpenVINO™ Training Extensions receives the root path where unlabeled images are by ``--unlabeled-data-roots``. -We should put the path where unlabeled data are contained. It also provides us ``--train-type`` to select the type of training scheme. All we have to do for that is specifying it as **SEMISUPERVISED**. +We should put the path where unlabeled data are contained. It also provides us ``--train-type`` to select the type of training scheme. All we have to do for that is specifying it as **Semisupervised**. .. note:: @@ -85,7 +85,7 @@ We should put the path where unlabeled data are contained. It also provides us ` .. code-block:: - (otx) ...$ otx build --train-data-roots data/flower_photos --unlabeled-data-roots tests/assets/imagenet_dataset --model MobileNet-V3-large-1x --train-type SEMISUPERVISED + (otx) ...$ otx build --train-data-roots data/flower_photos --unlabeled-data-roots tests/assets/imagenet_dataset --model MobileNet-V3-large-1x --train-type Semisupervised [*] Workspace Path: otx-workspace-CLASSIFICATION @@ -107,14 +107,14 @@ command in our workspace: (otx) ...$ otx train -In the train log, you can check that the train type is set to **SEMISUPERVISED** and related configurations are properly loaded as following: +In the train log, you can check that the train type is set to **Semisupervised** and related configurations are properly loaded as following: .. code-block:: ... 2023-02-22 06:21:54,492 | INFO : called _init_recipe() - 2023-02-22 06:21:54,492 | INFO : train type = SEMISUPERVISED - 2023-02-22 06:21:54,492 | INFO : train type = SEMISUPERVISED - loading training_extensions/otx/recipes/stages/classification/semisl.yaml + 2023-02-22 06:21:54,492 | INFO : train type = Semisupervised + 2023-02-22 06:21:54,492 | INFO : train type = Semisupervised - loading training_extensions/otx/recipes/stages/classification/semisl.yaml 2023-02-22 06:21:54,500 | INFO : Replacing runner from EpochRunnerWithCancel to EpochRunnerWithCancel. 2023-02-22 06:21:54,503 | INFO : initialized recipe = training_extensions/otx/recipes/stages/classification/semisl.yaml ... @@ -135,16 +135,16 @@ which is one of template-specific parameters (details are provided in `quick sta (otx) ...$ otx train otx/algorithms/classification/configs/mobilenet_v3_large_1_cls_incr/template.yaml \ --train-data-roots data/flower_photos \ --unlabeled-data-roots tests/assets/imagenet_dataset \ - params --algo_backend.train_type SEMISUPERVISED + params --algo_backend.train_type Semisupervised -In the train log, you can check that the train type is set to **SEMISUPERVISED** and related configurations are properly loaded as following: +In the train log, you can check that the train type is set to **Semisupervised** and related configurations are properly loaded as following: .. code-block:: ... 2023-02-22 06:21:54,492 | INFO : called _init_recipe() - 2023-02-22 06:21:54,492 | INFO : train type = SEMISUPERVISED - 2023-02-22 06:21:54,492 | INFO : train type = SEMISUPERVISED - loading training_extensions/otx/recipes/stages/classification/semisl.yaml + 2023-02-22 06:21:54,492 | INFO : train type = Semisupervised + 2023-02-22 06:21:54,492 | INFO : train type = Semisupervised - loading training_extensions/otx/recipes/stages/classification/semisl.yaml 2023-02-22 06:21:54,500 | INFO : Replacing runner from EpochRunnerWithCancel to EpochRunnerWithCancel. 2023-02-22 06:21:54,503 | INFO : initialized recipe = training_extensions/otx/recipes/stages/classification/semisl.yaml ... diff --git a/otx/algorithms/action/configs/classification/configuration.yaml b/otx/algorithms/action/configs/classification/configuration.yaml index 5221eaaa03b..fde36852b7d 100644 --- a/otx/algorithms/action/configs/classification/configuration.yaml +++ b/otx/algorithms/action/configs/classification/configuration.yaml @@ -245,20 +245,20 @@ algo_backend: header: Algo backend parameters train_type: affects_outcome_of: NONE - default_value: INCREMENTAL + default_value: Incremental description: Quantization preset that defines quantization scheme editable: false enum_name: TrainType header: Train type options: - INCREMENTAL: "INCREMENTAL" + Incremental: "Incremental" type: SELECTABLE ui_rules: action: DISABLE_EDITING operator: AND rules: [] type: UI_RULES - value: INCREMENTAL + value: Incremental visible_in_ui: True warning: null mem_cache_size: diff --git a/otx/algorithms/action/configs/classification/movinet/template.yaml b/otx/algorithms/action/configs/classification/movinet/template.yaml index 6fee18320db..c9b9b570714 100644 --- a/otx/algorithms/action/configs/classification/movinet/template.yaml +++ b/otx/algorithms/action/configs/classification/movinet/template.yaml @@ -45,7 +45,7 @@ hyper_parameters: default_value: 1.0 algo_backend: train_type: - default_value: INCREMENTAL + default_value: Incremental # Training resources. max_nodes: 1 diff --git a/otx/algorithms/action/configs/classification/x3d/template.yaml b/otx/algorithms/action/configs/classification/x3d/template.yaml index c214e0a282d..f217dac0e4a 100644 --- a/otx/algorithms/action/configs/classification/x3d/template.yaml +++ b/otx/algorithms/action/configs/classification/x3d/template.yaml @@ -45,7 +45,7 @@ hyper_parameters: default_value: 1.0 algo_backend: train_type: - default_value: INCREMENTAL + default_value: Incremental # Training resources. max_nodes: 1 diff --git a/otx/algorithms/action/configs/detection/configuration.yaml b/otx/algorithms/action/configs/detection/configuration.yaml index 5221eaaa03b..fde36852b7d 100644 --- a/otx/algorithms/action/configs/detection/configuration.yaml +++ b/otx/algorithms/action/configs/detection/configuration.yaml @@ -245,20 +245,20 @@ algo_backend: header: Algo backend parameters train_type: affects_outcome_of: NONE - default_value: INCREMENTAL + default_value: Incremental description: Quantization preset that defines quantization scheme editable: false enum_name: TrainType header: Train type options: - INCREMENTAL: "INCREMENTAL" + Incremental: "Incremental" type: SELECTABLE ui_rules: action: DISABLE_EDITING operator: AND rules: [] type: UI_RULES - value: INCREMENTAL + value: Incremental visible_in_ui: True warning: null mem_cache_size: diff --git a/otx/algorithms/action/configs/detection/x3d_fast_rcnn/template.yaml b/otx/algorithms/action/configs/detection/x3d_fast_rcnn/template.yaml index 63ed3f682bd..b1d204d6cb0 100644 --- a/otx/algorithms/action/configs/detection/x3d_fast_rcnn/template.yaml +++ b/otx/algorithms/action/configs/detection/x3d_fast_rcnn/template.yaml @@ -45,7 +45,7 @@ hyper_parameters: default_value: 1.0 algo_backend: train_type: - default_value: INCREMENTAL + default_value: Incremental # Training resources. max_nodes: 1 diff --git a/otx/algorithms/classification/configs/configuration.yaml b/otx/algorithms/classification/configs/configuration.yaml index dd2a93c51a0..f64bf911c01 100644 --- a/otx/algorithms/classification/configs/configuration.yaml +++ b/otx/algorithms/classification/configs/configuration.yaml @@ -336,22 +336,22 @@ algo_backend: header: Algo backend parameters train_type: affects_outcome_of: TRAINING - default_value: INCREMENTAL + default_value: Incremental description: Training scheme option that determines how to train the model editable: True enum_name: TrainType header: Train type options: - INCREMENTAL: "INCREMENTAL" - SEMISUPERVISED: "SEMISUPERVISED" - SELFSUPERVISED: "SELFSUPERVISED" + Incremental: "Incremental" + Semisupervised: "Semisupervised" + Selfsupervised: "Selfsupervised" type: SELECTABLE ui_rules: action: DISABLE_EDITING operator: AND rules: [] type: UI_RULES - value: INCREMENTAL + value: Incremental visible_in_ui: True warning: null mem_cache_size: diff --git a/otx/algorithms/classification/configs/efficientnet_b0_cls_incr/selfsl/hparam.yaml b/otx/algorithms/classification/configs/efficientnet_b0_cls_incr/selfsl/hparam.yaml index 6b1e96ff7e0..9be2286c001 100644 --- a/otx/algorithms/classification/configs/efficientnet_b0_cls_incr/selfsl/hparam.yaml +++ b/otx/algorithms/classification/configs/efficientnet_b0_cls_incr/selfsl/hparam.yaml @@ -18,7 +18,7 @@ hyper_parameters: default_value: false algo_backend: train_type: - default_value: SELFSUPERVISED + default_value: Selfsupervised # Training resources. max_nodes: 1 diff --git a/otx/algorithms/classification/configs/efficientnet_b0_cls_incr/semisl/hparam.yaml b/otx/algorithms/classification/configs/efficientnet_b0_cls_incr/semisl/hparam.yaml index fce1fb2f832..d282469bb8e 100644 --- a/otx/algorithms/classification/configs/efficientnet_b0_cls_incr/semisl/hparam.yaml +++ b/otx/algorithms/classification/configs/efficientnet_b0_cls_incr/semisl/hparam.yaml @@ -20,4 +20,4 @@ hyper_parameters: default_value: 90 algo_backend: train_type: - default_value: SEMISUPERVISED + default_value: Semisupervised diff --git a/otx/algorithms/classification/configs/efficientnet_b0_cls_incr/template.yaml b/otx/algorithms/classification/configs/efficientnet_b0_cls_incr/template.yaml index 6743404bb1d..9e195689a68 100644 --- a/otx/algorithms/classification/configs/efficientnet_b0_cls_incr/template.yaml +++ b/otx/algorithms/classification/configs/efficientnet_b0_cls_incr/template.yaml @@ -46,7 +46,7 @@ hyper_parameters: default_value: 1.0 algo_backend: train_type: - default_value: INCREMENTAL + default_value: Incremental # Training resources. max_nodes: 1 diff --git a/otx/algorithms/classification/configs/efficientnet_v2_s_cls_incr/selfsl/hparam.yaml b/otx/algorithms/classification/configs/efficientnet_v2_s_cls_incr/selfsl/hparam.yaml index 6b1e96ff7e0..9be2286c001 100644 --- a/otx/algorithms/classification/configs/efficientnet_v2_s_cls_incr/selfsl/hparam.yaml +++ b/otx/algorithms/classification/configs/efficientnet_v2_s_cls_incr/selfsl/hparam.yaml @@ -18,7 +18,7 @@ hyper_parameters: default_value: false algo_backend: train_type: - default_value: SELFSUPERVISED + default_value: Selfsupervised # Training resources. max_nodes: 1 diff --git a/otx/algorithms/classification/configs/efficientnet_v2_s_cls_incr/semisl/hparam.yaml b/otx/algorithms/classification/configs/efficientnet_v2_s_cls_incr/semisl/hparam.yaml index 62026f71da9..87c19f5bd01 100644 --- a/otx/algorithms/classification/configs/efficientnet_v2_s_cls_incr/semisl/hparam.yaml +++ b/otx/algorithms/classification/configs/efficientnet_v2_s_cls_incr/semisl/hparam.yaml @@ -20,4 +20,4 @@ hyper_parameters: default_value: 90 algo_backend: train_type: - default_value: SEMISUPERVISED + default_value: Semisupervised diff --git a/otx/algorithms/classification/configs/efficientnet_v2_s_cls_incr/template.yaml b/otx/algorithms/classification/configs/efficientnet_v2_s_cls_incr/template.yaml index eaf31fa0afe..1dc17e1470b 100644 --- a/otx/algorithms/classification/configs/efficientnet_v2_s_cls_incr/template.yaml +++ b/otx/algorithms/classification/configs/efficientnet_v2_s_cls_incr/template.yaml @@ -46,7 +46,7 @@ hyper_parameters: default_value: 1.0 algo_backend: train_type: - default_value: INCREMENTAL + default_value: Incremental # Training resources. max_nodes: 1 diff --git a/otx/algorithms/classification/configs/mobilenet_v3_large_075_cls_incr/selfsl/hparam.yaml b/otx/algorithms/classification/configs/mobilenet_v3_large_075_cls_incr/selfsl/hparam.yaml index 6b1e96ff7e0..9be2286c001 100644 --- a/otx/algorithms/classification/configs/mobilenet_v3_large_075_cls_incr/selfsl/hparam.yaml +++ b/otx/algorithms/classification/configs/mobilenet_v3_large_075_cls_incr/selfsl/hparam.yaml @@ -18,7 +18,7 @@ hyper_parameters: default_value: false algo_backend: train_type: - default_value: SELFSUPERVISED + default_value: Selfsupervised # Training resources. max_nodes: 1 diff --git a/otx/algorithms/classification/configs/mobilenet_v3_large_075_cls_incr/template_experiment.yaml b/otx/algorithms/classification/configs/mobilenet_v3_large_075_cls_incr/template_experiment.yaml index 86ed2150a43..cdf0f76bbc1 100644 --- a/otx/algorithms/classification/configs/mobilenet_v3_large_075_cls_incr/template_experiment.yaml +++ b/otx/algorithms/classification/configs/mobilenet_v3_large_075_cls_incr/template_experiment.yaml @@ -37,7 +37,7 @@ hyper_parameters: default_value: 20 algo_backend: train_type: - default_value: INCREMENTAL + default_value: Incremental # Training resources. max_nodes: 1 diff --git a/otx/algorithms/classification/configs/mobilenet_v3_large_1_cls_incr/selfsl/hparam.yaml b/otx/algorithms/classification/configs/mobilenet_v3_large_1_cls_incr/selfsl/hparam.yaml index 6b1e96ff7e0..9be2286c001 100644 --- a/otx/algorithms/classification/configs/mobilenet_v3_large_1_cls_incr/selfsl/hparam.yaml +++ b/otx/algorithms/classification/configs/mobilenet_v3_large_1_cls_incr/selfsl/hparam.yaml @@ -18,7 +18,7 @@ hyper_parameters: default_value: false algo_backend: train_type: - default_value: SELFSUPERVISED + default_value: Selfsupervised # Training resources. max_nodes: 1 diff --git a/otx/algorithms/classification/configs/mobilenet_v3_large_1_cls_incr/semisl/hparam.yaml b/otx/algorithms/classification/configs/mobilenet_v3_large_1_cls_incr/semisl/hparam.yaml index 928ffab95bb..2e116c4acdb 100644 --- a/otx/algorithms/classification/configs/mobilenet_v3_large_1_cls_incr/semisl/hparam.yaml +++ b/otx/algorithms/classification/configs/mobilenet_v3_large_1_cls_incr/semisl/hparam.yaml @@ -20,4 +20,4 @@ hyper_parameters: default_value: 90 algo_backend: train_type: - default_value: SEMISUPERVISED + default_value: Semisupervised diff --git a/otx/algorithms/classification/configs/mobilenet_v3_large_1_cls_incr/template.yaml b/otx/algorithms/classification/configs/mobilenet_v3_large_1_cls_incr/template.yaml index 0076c9f6ee3..7d06fd5fbf3 100644 --- a/otx/algorithms/classification/configs/mobilenet_v3_large_1_cls_incr/template.yaml +++ b/otx/algorithms/classification/configs/mobilenet_v3_large_1_cls_incr/template.yaml @@ -46,7 +46,7 @@ hyper_parameters: default_value: 1.0 algo_backend: train_type: - default_value: INCREMENTAL + default_value: Incremental # Training resources. max_nodes: 1 diff --git a/otx/algorithms/classification/configs/mobilenet_v3_small_cls_incr/selfsl/hparam.yaml b/otx/algorithms/classification/configs/mobilenet_v3_small_cls_incr/selfsl/hparam.yaml index 6b1e96ff7e0..9be2286c001 100644 --- a/otx/algorithms/classification/configs/mobilenet_v3_small_cls_incr/selfsl/hparam.yaml +++ b/otx/algorithms/classification/configs/mobilenet_v3_small_cls_incr/selfsl/hparam.yaml @@ -18,7 +18,7 @@ hyper_parameters: default_value: false algo_backend: train_type: - default_value: SELFSUPERVISED + default_value: Selfsupervised # Training resources. max_nodes: 1 diff --git a/otx/algorithms/classification/configs/mobilenet_v3_small_cls_incr/template_experiment.yaml b/otx/algorithms/classification/configs/mobilenet_v3_small_cls_incr/template_experiment.yaml index 7418bb3e3bd..4b0ce523e05 100644 --- a/otx/algorithms/classification/configs/mobilenet_v3_small_cls_incr/template_experiment.yaml +++ b/otx/algorithms/classification/configs/mobilenet_v3_small_cls_incr/template_experiment.yaml @@ -37,7 +37,7 @@ hyper_parameters: default_value: 20 algo_backend: train_type: - default_value: INCREMENTAL + default_value: Incremental # Training resources. max_nodes: 1 diff --git a/otx/algorithms/classification/tasks/inference.py b/otx/algorithms/classification/tasks/inference.py index d49fc8c0e86..d2b9b937ad6 100644 --- a/otx/algorithms/classification/tasks/inference.py +++ b/otx/algorithms/classification/tasks/inference.py @@ -71,9 +71,9 @@ TASK_CONFIG = ClassificationConfig RECIPE_TRAIN_TYPE = { - TrainType.SEMISUPERVISED: "semisl.yaml", - TrainType.INCREMENTAL: "incremental.yaml", - TrainType.SELFSUPERVISED: "selfsl.yaml", + TrainType.Semisupervised: "semisl.yaml", + TrainType.Incremental: "incremental.yaml", + TrainType.Selfsupervised: "selfsl.yaml", } @@ -113,7 +113,7 @@ def __init__(self, task_environment: TaskEnvironment, **kwargs): if not self._multilabel and not self._hierarchical: logger.info("Classification mode: multiclass") - if self._hyperparams.algo_backend.train_type == TrainType.SELFSUPERVISED: + if self._hyperparams.algo_backend.train_type == TrainType.Selfsupervised: self._selfsl = True @check_input_parameters_type({"dataset": DatasetParamTypeCheck}) @@ -423,7 +423,7 @@ def _init_recipe_hparam(self) -> dict: runner=runner, ) - if self._train_type.value == "SEMISUPERVISED": + if self._train_type.value == "Semisupervised": unlabeled_config = ConfigDict( data=ConfigDict( unlabeled_dataloader=ConfigDict( @@ -443,7 +443,7 @@ def _init_recipe(self): # pylint: disable=too-many-boolean-expressions if ( self._train_type in RECIPE_TRAIN_TYPE - and self._train_type == TrainType.INCREMENTAL + and self._train_type == TrainType.Incremental and not self._multilabel and not self._hierarchical and self._hyperparams.learning_parameters.enable_supcon @@ -453,7 +453,7 @@ def _init_recipe(self): self._recipe_cfg = self._init_model_cfg() - # FIXME[Soobee] : if train type is not in cfg, it raises an error in default INCREMENTAL mode. + # FIXME[Soobee] : if train type is not in cfg, it raises an error in default Incremental mode. # During semi-implementation, this line should be fixed to -> self._recipe_cfg.train_type = train_type self._recipe_cfg.train_type = self._train_type.name @@ -479,7 +479,7 @@ def _init_recipe(self): patch_evaluation(self._recipe_cfg, **options_for_patch_evaluation) # for OTX compatibility # TODO: make cfg_path loaded from custom model cfg file corresponding to train_type - # model.py contains heads/classifier only for INCREMENTAL setting + # model.py contains heads/classifier only for Incremental setting # error log : ValueError: Unexpected type of 'data_loader' parameter def _init_model_cfg(self): if self._multilabel: @@ -512,7 +512,7 @@ def _init_test_data_cfg(self, dataset: DatasetEntity): return data_cfg def _update_stage_module(self, stage_module): - module_prefix = {TrainType.INCREMENTAL: "Incr", TrainType.SEMISUPERVISED: "SemiSL"} + module_prefix = {TrainType.Incremental: "Incr", TrainType.Semisupervised: "SemiSL"} if self._train_type in module_prefix and stage_module in ["ClsTrainer", "ClsInferrer"]: stage_module = module_prefix[self._train_type] + stage_module return stage_module diff --git a/otx/algorithms/common/configs/training_base.py b/otx/algorithms/common/configs/training_base.py index 4c397554c54..c1a85446eb8 100644 --- a/otx/algorithms/common/configs/training_base.py +++ b/otx/algorithms/common/configs/training_base.py @@ -32,15 +32,17 @@ from .configuration_enums import POTQuantizationPreset +# pylint: disable=invalid-name + class TrainType(ConfigurableEnum): """TrainType for OTX Algorithms.""" - FINETUNE = "FINETUNE" - SEMISUPERVISED = "SEMISUPERVISED" - SELFSUPERVISED = "SELFSUPERVISED" - INCREMENTAL = "INCREMENTAL" - FUTUREWORK = "FUTUREWORK" + Finetune = "Finetune" + Semisupervised = "Semisupervised" + Selfsupervised = "Selfsupervised" + Incremental = "Incremental" + Futurework = "Futurework" class LearningRateSchedule(ConfigurableEnum): @@ -275,7 +277,7 @@ class BaseAlgoBackendParameters(ParameterGroup): """BaseAlgoBackendParameters for OTX Algorithms.""" train_type = selectable( - default_value=TrainType.INCREMENTAL, + default_value=TrainType.Incremental, header="train type", description="Training scheme option that determines how to train the model", editable=False, diff --git a/otx/algorithms/common/tasks/training_base.py b/otx/algorithms/common/tasks/training_base.py index 3016685fd4e..24775730976 100644 --- a/otx/algorithms/common/tasks/training_base.py +++ b/otx/algorithms/common/tasks/training_base.py @@ -59,9 +59,9 @@ logger = get_logger() TRAIN_TYPE_DIR_PATH = { - TrainType.INCREMENTAL.name: ".", - TrainType.SELFSUPERVISED.name: "selfsl", - TrainType.SEMISUPERVISED.name: "semisl", + TrainType.Incremental.name: ".", + TrainType.Selfsupervised.name: "selfsl", + TrainType.Semisupervised.name: "semisl", } diff --git a/otx/algorithms/detection/configs/detection/configuration.yaml b/otx/algorithms/detection/configs/detection/configuration.yaml index cd8ba0eadff..e53fe639e0f 100644 --- a/otx/algorithms/detection/configs/detection/configuration.yaml +++ b/otx/algorithms/detection/configs/detection/configuration.yaml @@ -245,21 +245,21 @@ algo_backend: header: Algo backend parameters train_type: affects_outcome_of: TRAINING - default_value: INCREMENTAL + default_value: Incremental description: Training scheme option that determines how to train the model editable: True enum_name: TrainType header: Train type options: - INCREMENTAL: "INCREMENTAL" - SEMISUPERVISED: "SEMISUPERVISED" + Incremental: "Incremental" + Semisupervised: "Semisupervised" type: SELECTABLE ui_rules: action: DISABLE_EDITING operator: AND rules: [] type: UI_RULES - value: INCREMENTAL + value: Incremental visible_in_ui: True warning: null mem_cache_size: diff --git a/otx/algorithms/detection/configs/detection/cspdarknet_yolox/semisl/hparam.yaml b/otx/algorithms/detection/configs/detection/cspdarknet_yolox/semisl/hparam.yaml index 55395b0d84c..580462daa1e 100644 --- a/otx/algorithms/detection/configs/detection/cspdarknet_yolox/semisl/hparam.yaml +++ b/otx/algorithms/detection/configs/detection/cspdarknet_yolox/semisl/hparam.yaml @@ -3,4 +3,4 @@ hyper_parameters: parameter_overrides: algo_backend: train_type: - default_value: SEMISUPERVISED + default_value: Semisupervised diff --git a/otx/algorithms/detection/configs/detection/cspdarknet_yolox/template.yaml b/otx/algorithms/detection/configs/detection/cspdarknet_yolox/template.yaml index cf1546e24a1..6360cba3b74 100644 --- a/otx/algorithms/detection/configs/detection/cspdarknet_yolox/template.yaml +++ b/otx/algorithms/detection/configs/detection/cspdarknet_yolox/template.yaml @@ -46,7 +46,7 @@ hyper_parameters: default_value: 1.0 algo_backend: train_type: - default_value: INCREMENTAL + default_value: Incremental # Training resources. max_nodes: 1 diff --git a/otx/algorithms/detection/configs/detection/mobilenetv2_atss/semisl/hparam.yaml b/otx/algorithms/detection/configs/detection/mobilenetv2_atss/semisl/hparam.yaml index 55395b0d84c..580462daa1e 100644 --- a/otx/algorithms/detection/configs/detection/mobilenetv2_atss/semisl/hparam.yaml +++ b/otx/algorithms/detection/configs/detection/mobilenetv2_atss/semisl/hparam.yaml @@ -3,4 +3,4 @@ hyper_parameters: parameter_overrides: algo_backend: train_type: - default_value: SEMISUPERVISED + default_value: Semisupervised diff --git a/otx/algorithms/detection/configs/detection/mobilenetv2_atss/template.yaml b/otx/algorithms/detection/configs/detection/mobilenetv2_atss/template.yaml index 49b91e29014..cc4051f4611 100644 --- a/otx/algorithms/detection/configs/detection/mobilenetv2_atss/template.yaml +++ b/otx/algorithms/detection/configs/detection/mobilenetv2_atss/template.yaml @@ -46,7 +46,7 @@ hyper_parameters: default_value: 1.0 algo_backend: train_type: - default_value: INCREMENTAL + default_value: Incremental # Training resources. max_nodes: 1 diff --git a/otx/algorithms/detection/configs/detection/mobilenetv2_ssd/semisl/hparam.yaml b/otx/algorithms/detection/configs/detection/mobilenetv2_ssd/semisl/hparam.yaml index 55395b0d84c..580462daa1e 100644 --- a/otx/algorithms/detection/configs/detection/mobilenetv2_ssd/semisl/hparam.yaml +++ b/otx/algorithms/detection/configs/detection/mobilenetv2_ssd/semisl/hparam.yaml @@ -3,4 +3,4 @@ hyper_parameters: parameter_overrides: algo_backend: train_type: - default_value: SEMISUPERVISED + default_value: Semisupervised diff --git a/otx/algorithms/detection/configs/detection/mobilenetv2_ssd/template.yaml b/otx/algorithms/detection/configs/detection/mobilenetv2_ssd/template.yaml index bdb817d21cf..a90ac70b124 100644 --- a/otx/algorithms/detection/configs/detection/mobilenetv2_ssd/template.yaml +++ b/otx/algorithms/detection/configs/detection/mobilenetv2_ssd/template.yaml @@ -46,7 +46,7 @@ hyper_parameters: default_value: 1.0 algo_backend: train_type: - default_value: INCREMENTAL + default_value: Incremental # Training resources. max_nodes: 1 diff --git a/otx/algorithms/detection/configs/detection/resnet50_vfnet/template_experimental.yaml b/otx/algorithms/detection/configs/detection/resnet50_vfnet/template_experimental.yaml index 624b6331ae4..6605ee5bed6 100644 --- a/otx/algorithms/detection/configs/detection/resnet50_vfnet/template_experimental.yaml +++ b/otx/algorithms/detection/configs/detection/resnet50_vfnet/template_experimental.yaml @@ -34,7 +34,7 @@ hyper_parameters: default_value: 100 algo_backend: train_type: - default_value: INCREMENTAL + default_value: Incremental # Training resources. max_nodes: 1 diff --git a/otx/algorithms/detection/configs/instance_segmentation/configuration.yaml b/otx/algorithms/detection/configs/instance_segmentation/configuration.yaml index 57693128302..bd8b078dd3f 100644 --- a/otx/algorithms/detection/configs/instance_segmentation/configuration.yaml +++ b/otx/algorithms/detection/configs/instance_segmentation/configuration.yaml @@ -245,21 +245,21 @@ algo_backend: header: Algo backend parameters train_type: affects_outcome_of: TRAINING - default_value: INCREMENTAL + default_value: Incremental description: Training scheme option that determines how to train the model editable: True enum_name: TrainType header: Train type options: - INCREMENTAL: "INCREMENTAL" - SEMISUPEVISED: "SEMISUPERVISED" + Incremental: "Incremental" + SEMISUPEVISED: "Semisupervised" type: SELECTABLE ui_rules: action: DISABLE_EDITING operator: AND rules: [] type: UI_RULES - value: INCREMENTAL + value: Incremental visible_in_ui: True warning: null mem_cache_size: diff --git a/otx/algorithms/detection/configs/instance_segmentation/efficientnetb2b_maskrcnn/template.yaml b/otx/algorithms/detection/configs/instance_segmentation/efficientnetb2b_maskrcnn/template.yaml index 8b08cff74c9..70ff835290f 100644 --- a/otx/algorithms/detection/configs/instance_segmentation/efficientnetb2b_maskrcnn/template.yaml +++ b/otx/algorithms/detection/configs/instance_segmentation/efficientnetb2b_maskrcnn/template.yaml @@ -49,7 +49,7 @@ hyper_parameters: default_value: 1.0 algo_backend: train_type: - default_value: INCREMENTAL + default_value: Incremental # Training resources. max_nodes: 1 diff --git a/otx/algorithms/detection/configs/instance_segmentation/resnet50_maskrcnn/template.yaml b/otx/algorithms/detection/configs/instance_segmentation/resnet50_maskrcnn/template.yaml index 9f62ac6fea5..c8ddb1ab624 100644 --- a/otx/algorithms/detection/configs/instance_segmentation/resnet50_maskrcnn/template.yaml +++ b/otx/algorithms/detection/configs/instance_segmentation/resnet50_maskrcnn/template.yaml @@ -49,7 +49,7 @@ hyper_parameters: default_value: 1.0 algo_backend: train_type: - default_value: INCREMENTAL + default_value: Incremental # Training resources. max_nodes: 1 diff --git a/otx/algorithms/detection/configs/rotated_detection/configuration.yaml b/otx/algorithms/detection/configs/rotated_detection/configuration.yaml index 4f6c2420a4b..9091a47232f 100644 --- a/otx/algorithms/detection/configs/rotated_detection/configuration.yaml +++ b/otx/algorithms/detection/configs/rotated_detection/configuration.yaml @@ -245,21 +245,21 @@ algo_backend: header: Algo backend parameters train_type: affects_outcome_of: TRAINING - default_value: INCREMENTAL + default_value: Incremental description: Training scheme option that determines how to train the model editable: True enum_name: TrainType header: Train type options: - INCREMENTAL: "INCREMENTAL" - SEMISUPEVISED: "SEMISUPERVISED" + Incremental: "Incremental" + SEMISUPEVISED: "Semisupervised" type: SELECTABLE ui_rules: action: DISABLE_EDITING operator: AND rules: [] type: UI_RULES - value: INCREMENTAL + value: Incremental visible_in_ui: True warning: null type: PARAMETER_GROUP diff --git a/otx/algorithms/detection/configs/rotated_detection/efficientnetb2b_maskrcnn/template.yaml b/otx/algorithms/detection/configs/rotated_detection/efficientnetb2b_maskrcnn/template.yaml index c863f176cc6..c652c833a0a 100644 --- a/otx/algorithms/detection/configs/rotated_detection/efficientnetb2b_maskrcnn/template.yaml +++ b/otx/algorithms/detection/configs/rotated_detection/efficientnetb2b_maskrcnn/template.yaml @@ -49,7 +49,7 @@ hyper_parameters: default_value: 1.0 algo_backend: train_type: - default_value: INCREMENTAL + default_value: Incremental # Training resources. max_nodes: 1 diff --git a/otx/algorithms/detection/configs/rotated_detection/resnet50_maskrcnn/template.yaml b/otx/algorithms/detection/configs/rotated_detection/resnet50_maskrcnn/template.yaml index 3593f5e6a09..ff7992857e0 100644 --- a/otx/algorithms/detection/configs/rotated_detection/resnet50_maskrcnn/template.yaml +++ b/otx/algorithms/detection/configs/rotated_detection/resnet50_maskrcnn/template.yaml @@ -49,7 +49,7 @@ hyper_parameters: default_value: 1.0 algo_backend: train_type: - default_value: INCREMENTAL + default_value: Incremental # Training resources. max_nodes: 1 diff --git a/otx/algorithms/detection/tasks/inference.py b/otx/algorithms/detection/tasks/inference.py index 89434ae1e60..efcd43788c1 100644 --- a/otx/algorithms/detection/tasks/inference.py +++ b/otx/algorithms/detection/tasks/inference.py @@ -81,8 +81,8 @@ logger = get_logger() RECIPE_TRAIN_TYPE = { - TrainType.SEMISUPERVISED: "semisl.py", - TrainType.INCREMENTAL: "incremental.py", + TrainType.Semisupervised: "semisl.py", + TrainType.Incremental: "incremental.py", } @@ -356,8 +356,8 @@ def _init_test_data_cfg(self, dataset: DatasetEntity): return data_cfg def _update_stage_module(self, stage_module): - module_prefix = {TrainType.INCREMENTAL: "Incr", TrainType.SEMISUPERVISED: "SemiSL"} - if self._train_type == TrainType.SEMISUPERVISED and stage_module == "DetectionExporter": + module_prefix = {TrainType.Incremental: "Incr", TrainType.Semisupervised: "SemiSL"} + if self._train_type == TrainType.Semisupervised and stage_module == "DetectionExporter": stage_module = "SemiSLDetectionExporter" elif self._train_type in module_prefix and stage_module in [ "DetectionTrainer", diff --git a/otx/algorithms/segmentation/configs/configuration.yaml b/otx/algorithms/segmentation/configs/configuration.yaml index 0da91d335ba..132ab25a4d6 100644 --- a/otx/algorithms/segmentation/configs/configuration.yaml +++ b/otx/algorithms/segmentation/configs/configuration.yaml @@ -274,22 +274,22 @@ algo_backend: header: Algo backend parameters train_type: affects_outcome_of: TRAINING - default_value: INCREMENTAL + default_value: Incremental description: Training scheme option that determines how to train the model editable: True enum_name: TrainType header: Train type options: - INCREMENTAL: "INCREMENTAL" - SEMISUPERVISED: "SEMISUPERVISED" - SELFSUPERVISED: "SELFSUPERVISED" + Incremental: "Incremental" + Semisupervised: "Semisupervised" + Selfsupervised: "Selfsupervised" type: SELECTABLE ui_rules: action: DISABLE_EDITING operator: AND rules: [] type: UI_RULES - value: INCREMENTAL + value: Incremental visible_in_ui: True warning: null mem_cache_size: diff --git a/otx/algorithms/segmentation/configs/ocr_lite_hrnet_18/selfsl/hparam.yaml b/otx/algorithms/segmentation/configs/ocr_lite_hrnet_18/selfsl/hparam.yaml index c2259b834a8..c5ea68bbd4f 100644 --- a/otx/algorithms/segmentation/configs/ocr_lite_hrnet_18/selfsl/hparam.yaml +++ b/otx/algorithms/segmentation/configs/ocr_lite_hrnet_18/selfsl/hparam.yaml @@ -16,4 +16,4 @@ hyper_parameters: default_value: false algo_backend: train_type: - default_value: SELFSUPERVISED + default_value: Selfsupervised diff --git a/otx/algorithms/segmentation/configs/ocr_lite_hrnet_18/semisl/hparam.yaml b/otx/algorithms/segmentation/configs/ocr_lite_hrnet_18/semisl/hparam.yaml index 55395b0d84c..580462daa1e 100644 --- a/otx/algorithms/segmentation/configs/ocr_lite_hrnet_18/semisl/hparam.yaml +++ b/otx/algorithms/segmentation/configs/ocr_lite_hrnet_18/semisl/hparam.yaml @@ -3,4 +3,4 @@ hyper_parameters: parameter_overrides: algo_backend: train_type: - default_value: SEMISUPERVISED + default_value: Semisupervised diff --git a/otx/algorithms/segmentation/configs/ocr_lite_hrnet_18/template.yaml b/otx/algorithms/segmentation/configs/ocr_lite_hrnet_18/template.yaml index 548e2676bbc..ef3acd94560 100644 --- a/otx/algorithms/segmentation/configs/ocr_lite_hrnet_18/template.yaml +++ b/otx/algorithms/segmentation/configs/ocr_lite_hrnet_18/template.yaml @@ -38,7 +38,7 @@ hyper_parameters: default_value: 300 algo_backend: train_type: - default_value: INCREMENTAL + default_value: Incremental # Training resources. max_nodes: 1 diff --git a/otx/algorithms/segmentation/configs/ocr_lite_hrnet_18_mod2/selfsl/hparam.yaml b/otx/algorithms/segmentation/configs/ocr_lite_hrnet_18_mod2/selfsl/hparam.yaml index c2259b834a8..c5ea68bbd4f 100644 --- a/otx/algorithms/segmentation/configs/ocr_lite_hrnet_18_mod2/selfsl/hparam.yaml +++ b/otx/algorithms/segmentation/configs/ocr_lite_hrnet_18_mod2/selfsl/hparam.yaml @@ -16,4 +16,4 @@ hyper_parameters: default_value: false algo_backend: train_type: - default_value: SELFSUPERVISED + default_value: Selfsupervised diff --git a/otx/algorithms/segmentation/configs/ocr_lite_hrnet_18_mod2/semisl/hparam.yaml b/otx/algorithms/segmentation/configs/ocr_lite_hrnet_18_mod2/semisl/hparam.yaml index 55395b0d84c..580462daa1e 100644 --- a/otx/algorithms/segmentation/configs/ocr_lite_hrnet_18_mod2/semisl/hparam.yaml +++ b/otx/algorithms/segmentation/configs/ocr_lite_hrnet_18_mod2/semisl/hparam.yaml @@ -3,4 +3,4 @@ hyper_parameters: parameter_overrides: algo_backend: train_type: - default_value: SEMISUPERVISED + default_value: Semisupervised diff --git a/otx/algorithms/segmentation/configs/ocr_lite_hrnet_18_mod2/template.yaml b/otx/algorithms/segmentation/configs/ocr_lite_hrnet_18_mod2/template.yaml index fc1f1dfa889..92ba2428e52 100644 --- a/otx/algorithms/segmentation/configs/ocr_lite_hrnet_18_mod2/template.yaml +++ b/otx/algorithms/segmentation/configs/ocr_lite_hrnet_18_mod2/template.yaml @@ -47,7 +47,7 @@ hyper_parameters: default_value: 1.0 algo_backend: train_type: - default_value: INCREMENTAL + default_value: Incremental # Training resources. max_nodes: 1 diff --git a/otx/algorithms/segmentation/configs/ocr_lite_hrnet_s_mod2/selfsl/hparam.yaml b/otx/algorithms/segmentation/configs/ocr_lite_hrnet_s_mod2/selfsl/hparam.yaml index c2259b834a8..c5ea68bbd4f 100644 --- a/otx/algorithms/segmentation/configs/ocr_lite_hrnet_s_mod2/selfsl/hparam.yaml +++ b/otx/algorithms/segmentation/configs/ocr_lite_hrnet_s_mod2/selfsl/hparam.yaml @@ -16,4 +16,4 @@ hyper_parameters: default_value: false algo_backend: train_type: - default_value: SELFSUPERVISED + default_value: Selfsupervised diff --git a/otx/algorithms/segmentation/configs/ocr_lite_hrnet_s_mod2/semisl/hparam.yaml b/otx/algorithms/segmentation/configs/ocr_lite_hrnet_s_mod2/semisl/hparam.yaml index 55395b0d84c..580462daa1e 100644 --- a/otx/algorithms/segmentation/configs/ocr_lite_hrnet_s_mod2/semisl/hparam.yaml +++ b/otx/algorithms/segmentation/configs/ocr_lite_hrnet_s_mod2/semisl/hparam.yaml @@ -3,4 +3,4 @@ hyper_parameters: parameter_overrides: algo_backend: train_type: - default_value: SEMISUPERVISED + default_value: Semisupervised diff --git a/otx/algorithms/segmentation/configs/ocr_lite_hrnet_s_mod2/template.yaml b/otx/algorithms/segmentation/configs/ocr_lite_hrnet_s_mod2/template.yaml index 78b229b2e1d..c079a116738 100644 --- a/otx/algorithms/segmentation/configs/ocr_lite_hrnet_s_mod2/template.yaml +++ b/otx/algorithms/segmentation/configs/ocr_lite_hrnet_s_mod2/template.yaml @@ -48,7 +48,7 @@ hyper_parameters: default_value: 1.0 algo_backend: train_type: - default_value: INCREMENTAL + default_value: Incremental # Training resources. max_nodes: 1 diff --git a/otx/algorithms/segmentation/configs/ocr_lite_hrnet_x_mod3/selfsl/hparam.yaml b/otx/algorithms/segmentation/configs/ocr_lite_hrnet_x_mod3/selfsl/hparam.yaml index c2259b834a8..c5ea68bbd4f 100644 --- a/otx/algorithms/segmentation/configs/ocr_lite_hrnet_x_mod3/selfsl/hparam.yaml +++ b/otx/algorithms/segmentation/configs/ocr_lite_hrnet_x_mod3/selfsl/hparam.yaml @@ -16,4 +16,4 @@ hyper_parameters: default_value: false algo_backend: train_type: - default_value: SELFSUPERVISED + default_value: Selfsupervised diff --git a/otx/algorithms/segmentation/configs/ocr_lite_hrnet_x_mod3/semisl/hparam.yaml b/otx/algorithms/segmentation/configs/ocr_lite_hrnet_x_mod3/semisl/hparam.yaml index 55395b0d84c..580462daa1e 100644 --- a/otx/algorithms/segmentation/configs/ocr_lite_hrnet_x_mod3/semisl/hparam.yaml +++ b/otx/algorithms/segmentation/configs/ocr_lite_hrnet_x_mod3/semisl/hparam.yaml @@ -3,4 +3,4 @@ hyper_parameters: parameter_overrides: algo_backend: train_type: - default_value: SEMISUPERVISED + default_value: Semisupervised diff --git a/otx/algorithms/segmentation/configs/ocr_lite_hrnet_x_mod3/template.yaml b/otx/algorithms/segmentation/configs/ocr_lite_hrnet_x_mod3/template.yaml index af1383f58b7..2e95673f035 100644 --- a/otx/algorithms/segmentation/configs/ocr_lite_hrnet_x_mod3/template.yaml +++ b/otx/algorithms/segmentation/configs/ocr_lite_hrnet_x_mod3/template.yaml @@ -48,7 +48,7 @@ hyper_parameters: default_value: 1.0 algo_backend: train_type: - default_value: INCREMENTAL + default_value: Incremental # Training resources. max_nodes: 1 diff --git a/otx/algorithms/segmentation/tasks/inference.py b/otx/algorithms/segmentation/tasks/inference.py index 408696e3530..9cdd457dab2 100644 --- a/otx/algorithms/segmentation/tasks/inference.py +++ b/otx/algorithms/segmentation/tasks/inference.py @@ -74,9 +74,9 @@ RECIPE_TRAIN_TYPE = { - TrainType.SEMISUPERVISED: "semisl.py", - TrainType.INCREMENTAL: "incremental.py", - TrainType.SELFSUPERVISED: "selfsl.py", + TrainType.Semisupervised: "semisl.py", + TrainType.Incremental: "incremental.py", + TrainType.Selfsupervised: "selfsl.py", } @@ -191,7 +191,7 @@ def _init_recipe(self): # TODO: Need to remove the hard coding for supcon only. if ( self._train_type in RECIPE_TRAIN_TYPE - and self._train_type == TrainType.INCREMENTAL + and self._train_type == TrainType.Incremental and self._hyperparams.learning_parameters.enable_supcon and not self._model_dir.endswith("supcon") ): @@ -218,8 +218,8 @@ def _init_recipe(self): remove_from_configs_by_type(self._recipe_cfg.custom_hooks, "FreezeLayers") def _update_stage_module(self, stage_module: str): - module_prefix = {TrainType.SEMISUPERVISED: "SemiSL", TrainType.INCREMENTAL: "Incr"} - if self._train_type == TrainType.SEMISUPERVISED and stage_module == "SegExporter": + module_prefix = {TrainType.Semisupervised: "SemiSL", TrainType.Incremental: "Incr"} + if self._train_type == TrainType.Semisupervised and stage_module == "SegExporter": stage_module = "SemiSLSegExporter" elif self._train_type in module_prefix and stage_module in ["SegTrainer", "SegInferrer"]: stage_module = module_prefix[self._train_type] + stage_module diff --git a/otx/cli/manager/config_manager.py b/otx/cli/manager/config_manager.py index 1136c12ec32..8a4a59d0347 100644 --- a/otx/cli/manager/config_manager.py +++ b/otx/cli/manager/config_manager.py @@ -60,9 +60,9 @@ } TASK_TYPE_TO_SUB_DIR_NAME = { - "INCREMENTAL": "", - "SEMISUPERVISED": "semisl", - "SELFSUPERVISED": "selfsl", + "Incremental": "", + "Semisupervised": "semisl", + "Selfsupervised": "selfsl", } @@ -163,8 +163,8 @@ def _check_rebuild(self): print(f"[*] Rebuild model: {self.template.name} -> {self.args.model.upper()}") result = True template_train_type = self._get_train_type(ignore_args=True) - if self.args.train_type and template_train_type != self.args.train_type.upper(): - self.train_type = self.args.train_type.upper() + if self.args.train_type and template_train_type != self.args.train_type: + self.train_type = self.args.train_type print(f"[*] Rebuild train-type: {template_train_type} -> {self.train_type}") result = True return result @@ -192,10 +192,10 @@ def _get_train_type(self, ignore_args: bool = False) -> str: args_hyper_parameters = gen_params_dict_from_args(self.args) arg_algo_backend = args_hyper_parameters.get("algo_backend", False) if arg_algo_backend: - train_type = arg_algo_backend.get("train_type", {"value": "INCREMENTAL"}) # type: ignore - return train_type.get("value", "INCREMENTAL") + train_type = arg_algo_backend.get("train_type", {"value": "Incremental"}) # type: ignore + return train_type.get("value", "Incremental") if hasattr(self.args, "train_type") and self.mode in ("build", "train") and self.args.train_type: - self.train_type = self.args.train_type.upper() + self.train_type = self.args.train_type if self.train_type not in TASK_TYPE_TO_SUB_DIR_NAME: raise NotSupportedError(f"{self.train_type} is not currently supported by otx.") if self.train_type in TASK_TYPE_TO_SUB_DIR_NAME: @@ -203,9 +203,9 @@ def _get_train_type(self, ignore_args: bool = False) -> str: algo_backend = self.template.hyper_parameters.parameter_overrides.get("algo_backend", False) if algo_backend: - train_type = algo_backend.get("train_type", {"default_value": "INCREMENTAL"}) - return train_type.get("default_value", "INCREMENTAL") - return "INCREMENTAL" + train_type = algo_backend.get("train_type", {"default_value": "Incremental"}) + return train_type.get("default_value", "Incremental") + return "Incremental" def auto_task_detection(self, data_roots: str) -> str: """Detect task type automatically.""" diff --git a/otx/cli/tools/build.py b/otx/cli/tools/build.py index 0c5a4b3761f..246b2efb954 100644 --- a/otx/cli/tools/build.py +++ b/otx/cli/tools/build.py @@ -65,7 +65,7 @@ def get_args(): "--train-type", help=f"The currently supported options: {TASK_TYPE_TO_SUB_DIR_NAME.keys()}.", type=str, - default="incremental", + default="Incremental", ) parser.add_argument( "--work-dir", diff --git a/otx/cli/tools/train.py b/otx/cli/tools/train.py index 164210366ba..faffff85635 100644 --- a/otx/cli/tools/train.py +++ b/otx/cli/tools/train.py @@ -65,7 +65,7 @@ def get_args(): "--train-type", help=f"The currently supported options: {TASK_TYPE_TO_SUB_DIR_NAME.keys()}.", type=str, - default="incremental", + default="Incremental", ) parser.add_argument( "--load-weights", diff --git a/otx/core/data/adapter/__init__.py b/otx/core/data/adapter/__init__.py index 140d644728e..a51ef7c32f6 100644 --- a/otx/core/data/adapter/__init__.py +++ b/otx/core/data/adapter/__init__.py @@ -23,53 +23,53 @@ ADAPTERS = { TaskType.CLASSIFICATION: { - "INCREMENTAL": { + "Incremental": { "module_name": "classification_dataset_adapter", "class": "ClassificationDatasetAdapter", } }, TaskType.DETECTION: { - "INCREMENTAL": { + "Incremental": { "module_name": "detection_dataset_adapter", "class": "DetectionDatasetAdapter", } }, TaskType.ROTATED_DETECTION: { - "INCREMENTAL": { + "Incremental": { "module_name": "detection_dataset_adapter", "class": "DetectionDatasetAdapter", } }, TaskType.INSTANCE_SEGMENTATION: { - "INCREMENTAL": { + "Incremental": { "module_name": "detection_dataset_adapter", "class": "DetectionDatasetAdapter", } }, TaskType.SEGMENTATION: { - "INCREMENTAL": { + "Incremental": { "module_name": "segmentation_dataset_adapter", "class": "SegmentationDatasetAdapter", }, - "SELFSUPERVISED": { + "Selfsupervised": { "module_name": "segmentation_dataset_adapter", "class": "SelfSLSegmentationDatasetAdapter", }, }, TaskType.ANOMALY_CLASSIFICATION: { - "INCREMENTAL": { + "Incremental": { "module_name": "anomaly_dataset_adapter", "class": "AnomalyClassificationDatasetAdapter", } }, TaskType.ANOMALY_DETECTION: { - "INCREMENTAL": { + "Incremental": { "module_name": "anomaly_dataset_adapter", "class": "AnomalyDetectionDatasetAdapter", } }, TaskType.ANOMALY_SEGMENTATION: { - "INCREMENTAL": { + "Incremental": { "module_name": "anomaly_dataset_adapter", "class": "AnomalySegmentationDatasetAdapter", } @@ -79,13 +79,13 @@ ADAPTERS.update( { TaskType.ACTION_CLASSIFICATION: { - "INCREMENTAL": { + "Incremental": { "module_name": "action_dataset_adapter", "class": "ActionClassificationDatasetAdapter", } }, TaskType.ACTION_DETECTION: { - "INCREMENTAL": { + "Incremental": { "module_name": "action_dataset_adapter", "class": "ActionDetectionDatasetAdapter", } @@ -107,18 +107,18 @@ def get_dataset_adapter( Args: task_type: A task type such as ANOMALY_CLASSIFICATION, ANOMALY_DETECTION, ANOMALY_SEGMENTATION, CLASSIFICATION, INSTANCE_SEGMENTATION, DETECTION, CLASSIFICATION, ROTATED_DETECTION, SEGMENTATION. - train_type: train type such as INCREMENTAL and SELFSUPERVISED. - SELFSUPERVISED is only supported for SEGMENTATION. + train_type: train type such as Incremental and Selfsupervised. + Selfsupervised is only supported for SEGMENTATION. train_data_roots: the path of data root for training data val_data_roots: the path of data root for validation data test_data_roots: the path of data root for test data unlabeled_data_roots: the path of data root for unlabeled data """ - train_type_to_be_called = TrainType.INCREMENTAL.value + train_type_to_be_called = TrainType.Incremental.value # FIXME : Hardcoded solution for self-sl for seg - if task_type == TaskType.SEGMENTATION and train_type == TrainType.SELFSUPERVISED.value: - train_type_to_be_called = TrainType.SELFSUPERVISED.value + if task_type == TaskType.SEGMENTATION and train_type == TrainType.Selfsupervised.value: + train_type_to_be_called = TrainType.Selfsupervised.value module_root = "otx.core.data.adapter." module = importlib.import_module(module_root + ADAPTERS[task_type][train_type_to_be_called]["module_name"]) diff --git a/tests/e2e/cli/classification/test_classification.py b/tests/e2e/cli/classification/test_classification.py index a3278f0eb13..fe0e12498e8 100644 --- a/tests/e2e/cli/classification/test_classification.py +++ b/tests/e2e/cli/classification/test_classification.py @@ -303,7 +303,7 @@ def test_otx_train(self, template, tmp_dir_path): tmp_dir_path = tmp_dir_path / "multi_class_cls/test_semisl" args_semisl = copy.deepcopy(args0) args_semisl["--unlabeled-data-roots"] = args["--train-data-roots"] - args_semisl["train_params"].extend(["--algo_backend.train_type", "SEMISUPERVISED"]) + args_semisl["train_params"].extend(["--algo_backend.train_type", "Semisupervised"]) otx_train_testing(template, tmp_dir_path, otx_dir, args_semisl) @e2e_pytest_component @@ -322,7 +322,7 @@ def test_otx_multi_gpu_train_semisl(self, template, tmp_dir_path): tmp_dir_path = tmp_dir_path / "multi_class_cls/test_multi_gpu_semisl" args_semisl_multigpu = copy.deepcopy(args0) args_semisl_multigpu["--unlabeled-data-roots"] = args["--train-data-roots"] - args_semisl_multigpu["train_params"].extend(["--algo_backend.train_type", "SEMISUPERVISED"]) + args_semisl_multigpu["train_params"].extend(["--algo_backend.train_type", "Semisupervised"]) args_semisl_multigpu["--gpus"] = "0,1" otx_train_testing(template, tmp_dir_path, otx_dir, args_semisl_multigpu) @@ -757,7 +757,7 @@ def test_otx_multi_gpu_train(self, template, tmp_dir_path): "--learning_parameters.learning_rate", "1e-07", "--algo_backend.train_type", - "SELFSUPERVISED", + "Selfsupervised", ], } diff --git a/tests/e2e/cli/detection/test_detection.py b/tests/e2e/cli/detection/test_detection.py index 24c5d5b6274..da82aec22c6 100644 --- a/tests/e2e/cli/detection/test_detection.py +++ b/tests/e2e/cli/detection/test_detection.py @@ -68,7 +68,7 @@ "--learning_parameters.batch_size", "4", "--algo_backend.train_type", - "SEMISUPERVISED", + "Semisupervised", ], } diff --git a/tests/e2e/cli/segmentation/test_segmentation.py b/tests/e2e/cli/segmentation/test_segmentation.py index 96086fa25eb..1df46ecfba1 100644 --- a/tests/e2e/cli/segmentation/test_segmentation.py +++ b/tests/e2e/cli/segmentation/test_segmentation.py @@ -276,7 +276,7 @@ def test_otx_multi_gpu_train(self, template, tmp_dir_path): "--learning_parameters.batch_size", "4", "--algo_backend.train_type", - "SEMISUPERVISED", + "Semisupervised", ], } @@ -317,7 +317,7 @@ def test_otx_multi_gpu_train_semisl(self, template, tmp_dir_path): "--learning_parameters.batch_size", "4", "--algo_backend.train_type", - "SELFSUPERVISED", + "Selfsupervised", ], } diff --git a/tests/integration/cli/classification/test_classification.py b/tests/integration/cli/classification/test_classification.py index ee26e5cbc35..459ef89c033 100644 --- a/tests/integration/cli/classification/test_classification.py +++ b/tests/integration/cli/classification/test_classification.py @@ -53,7 +53,7 @@ "--learning_parameters.batch_size", "4", "--algo_backend.train_type", - "SELFSUPERVISED", + "Selfsupervised", ], } @@ -190,7 +190,7 @@ def test_otx_train_semisl(self, template, tmp_dir_path): tmp_dir_path = tmp_dir_path / "multi_class_cls/test_semisl" args_semisl = copy.deepcopy(args) args_semisl["--unlabeled-data-roots"] = args["--train-data-roots"] - args_semisl["train_params"].extend(["--algo_backend.train_type", "SEMISUPERVISED"]) + args_semisl["train_params"].extend(["--algo_backend.train_type", "Semisupervised"]) otx_train_testing(template, tmp_dir_path, otx_dir, args_semisl) @e2e_pytest_component @@ -201,7 +201,7 @@ def test_otx_multi_gpu_train_semisl(self, template, tmp_dir_path): tmp_dir_path = tmp_dir_path / "multi_class_cls/test_multi_gpu_semisl" args_semisl_multigpu = copy.deepcopy(args) args_semisl_multigpu["--unlabeled-data-roots"] = args["--train-data-roots"] - args_semisl_multigpu["train_params"].extend(["--algo_backend.train_type", "SEMISUPERVISED"]) + args_semisl_multigpu["train_params"].extend(["--algo_backend.train_type", "Semisupervised"]) args_semisl_multigpu["--gpus"] = "0,1" otx_train_testing(template, tmp_dir_path, otx_dir, args_semisl_multigpu) @@ -308,7 +308,7 @@ def test_otx_train_semisl(self, template, tmp_dir_path): tmp_dir_path = tmp_dir_path / "multi_label_cls" / "test_semisl" args_semisl = copy.deepcopy(args_m) args_semisl["--unlabeled-data-roots"] = args_m["--train-data-roots"] - args_semisl["train_params"].extend(["--algo_backend.train_type", "SEMISUPERVISED"]) + args_semisl["train_params"].extend(["--algo_backend.train_type", "Semisupervised"]) otx_train_testing(template, tmp_dir_path, otx_dir, args_semisl) diff --git a/tests/integration/cli/detection/test_detection.py b/tests/integration/cli/detection/test_detection.py index 7e071a1ee35..44a92ad812c 100644 --- a/tests/integration/cli/detection/test_detection.py +++ b/tests/integration/cli/detection/test_detection.py @@ -48,7 +48,7 @@ "--learning_parameters.batch_size", "4", "--algo_backend.train_type", - "SEMISUPERVISED", + "Semisupervised", ], } diff --git a/tests/integration/cli/segmentation/test_segmentation.py b/tests/integration/cli/segmentation/test_segmentation.py index be027226fb6..54557124f8a 100644 --- a/tests/integration/cli/segmentation/test_segmentation.py +++ b/tests/integration/cli/segmentation/test_segmentation.py @@ -54,7 +54,7 @@ "--learning_parameters.batch_size", "4", "--algo_backend.train_type", - "SEMISUPERVISED", + "Semisupervised", ], } @@ -68,7 +68,7 @@ "--learning_parameters.batch_size", "4", "--algo_backend.train_type", - "SELFSUPERVISED", + "Selfsupervised", ], } diff --git a/tests/integration/cli/test_cli.py b/tests/integration/cli/test_cli.py index 1653f0cf939..825a811750b 100644 --- a/tests/integration/cli/test_cli.py +++ b/tests/integration/cli/test_cli.py @@ -36,9 +36,9 @@ "default": "EfficientNet-B0", "--task": "classification", "--model": "MobileNet-V3-large-1x", - "--train-type": "semisupervised", + "--train-type": "Semisupervised", }, - "detection": {"default": "ATSS", "--task": "detection", "--model": "SSD", "--train-type": "semisupervised"}, + "detection": {"default": "ATSS", "--task": "detection", "--model": "SSD", "--train-type": "Semisupervised"}, } @@ -59,19 +59,19 @@ def test_otx_build_rebuild(self, tmp_dir_path, case): tmp_dir_path = tmp_dir_path / "test_rebuild" / case # 1. Only Task build_arg = {"--task": rebuild_args[case]["--task"]} - expected = {"model": rebuild_args[case]["default"], "train_type": "INCREMENTAL"} + expected = {"model": rebuild_args[case]["default"], "train_type": "Incremental"} otx_build_testing(tmp_dir_path, build_arg, expected=expected) # 2. Change Model build_arg = {"--model": rebuild_args[case]["--model"]} - expected = {"model": rebuild_args[case]["--model"], "train_type": "INCREMENTAL"} + expected = {"model": rebuild_args[case]["--model"], "train_type": "Incremental"} otx_build_testing(tmp_dir_path, build_arg, expected=expected) # 3. Change Train-type build_arg = {"--train-type": rebuild_args[case]["--train-type"]} expected = {"model": rebuild_args[case]["--model"], "train_type": rebuild_args[case]["--train-type"]} otx_build_testing(tmp_dir_path, build_arg, expected=expected) # 4. Change to Default - build_arg = {"--model": rebuild_args[case]["default"], "--train-type": "INCREMENTAL"} - expected = {"model": rebuild_args[case]["default"], "train_type": "INCREMENTAL"} + build_arg = {"--model": rebuild_args[case]["default"], "--train-type": "Incremental"} + expected = {"model": rebuild_args[case]["default"], "train_type": "Incremental"} otx_build_testing(tmp_dir_path, build_arg, expected=expected) diff --git a/tests/regression/classification/test_classification.py b/tests/regression/classification/test_classification.py index 49a0593f014..f19fc6a72fd 100644 --- a/tests/regression/classification/test_classification.py +++ b/tests/regression/classification/test_classification.py @@ -170,7 +170,7 @@ def test_otx_train_semisl(self, template, tmp_dir_path): "--learning_parameters.num_iters", REGRESSION_TEST_EPOCHS, "--algo_backend.train_type", - "SEMISUPERVISED", + "Semisupervised", ] train_start_time = timer() otx_train_testing(template, tmp_dir_path, otx_dir, args_semisl) @@ -228,7 +228,7 @@ def test_otx_train_selfsl(self, template, tmp_dir_path): "--learning_parameters.num_iters", "10", "--algo_backend.train_type", - "SELFSUPERVISED", + "Selfsupervised", ] # Self-supervised Training diff --git a/tests/regression/detection/test_detection.py b/tests/regression/detection/test_detection.py index 5837682e381..309fc539804 100644 --- a/tests/regression/detection/test_detection.py +++ b/tests/regression/detection/test_detection.py @@ -169,7 +169,7 @@ def test_otx_train_semisl(self, template, tmp_dir_path): "--learning_parameters.num_iters", REGRESSION_TEST_EPOCHS, "--algo_backend.train_type", - "SEMISUPERVISED", + "Semisupervised", ] train_start_time = timer() otx_train_testing(template, tmp_dir_path, otx_dir, args_semisl) diff --git a/tests/regression/segmentation/test_segmentation.py b/tests/regression/segmentation/test_segmentation.py index e179559ce2c..f194245fd5a 100644 --- a/tests/regression/segmentation/test_segmentation.py +++ b/tests/regression/segmentation/test_segmentation.py @@ -170,7 +170,7 @@ def test_otx_train_semisl(self, template, tmp_dir_path): "--learning_parameters.num_iters", REGRESSION_TEST_EPOCHS, "--algo_backend.train_type", - "SEMISUPERVISED", + "Semisupervised", ] train_start_time = timer() otx_train_testing(template, tmp_dir_path, otx_dir, args_semisl) @@ -221,7 +221,7 @@ def test_otx_train_selfsl(self, template, tmp_dir_path): args_selfsl = config_selfsl["data_path"] selfsl_train_args = copy.deepcopy(args_selfsl) - selfsl_train_args["train_params"] = ["params", "--algo_backend.train_type", "SELFSUPERVISED"] + selfsl_train_args["train_params"] = ["params", "--algo_backend.train_type", "Selfsupervised"] # Self-supervised Training train_start_time = timer() diff --git a/tests/test_suite/run_test_command.py b/tests/test_suite/run_test_command.py index f385ce47382..f443b61a598 100644 --- a/tests/test_suite/run_test_command.py +++ b/tests/test_suite/run_test_command.py @@ -813,7 +813,7 @@ def otx_build_testing(root, args: Dict[str, str], expected: Dict[str, str]): assert template_config.name == expected["model"] assert ( template_config.hyper_parameters.parameter_overrides.algo_backend.train_type.default_value - == expected["train_type"].upper() + == expected["train_type"] ) diff --git a/tests/unit/algorithms/action/tools/test_action_sample_classification.py b/tests/unit/algorithms/action/tools/test_action_sample_classification.py index 472907637dc..f821864bb39 100644 --- a/tests/unit/algorithms/action/tools/test_action_sample_classification.py +++ b/tests/unit/algorithms/action/tools/test_action_sample_classification.py @@ -50,7 +50,7 @@ def test_load_test_dataset() -> None: class MockTemplate: task_type = TaskType.ACTION_CLASSIFICATION hyper_parameters = Config( - {"parameter_overrides": {"algo_backend": {"train_type": {"default_value": TrainType.INCREMENTAL.value}}}} + {"parameter_overrides": {"algo_backend": {"train_type": {"default_value": TrainType.Incremental.value}}}} ) dataset, label_schema = load_test_dataset(MockTemplate()) diff --git a/tests/unit/algorithms/action/tools/test_action_sample_detection.py b/tests/unit/algorithms/action/tools/test_action_sample_detection.py index c002337526b..b774a6af8b7 100644 --- a/tests/unit/algorithms/action/tools/test_action_sample_detection.py +++ b/tests/unit/algorithms/action/tools/test_action_sample_detection.py @@ -51,7 +51,7 @@ def test_load_test_dataset() -> None: class MockTemplate: task_type = TaskType.ACTION_DETECTION hyper_parameters = Config( - {"parameter_overrides": {"algo_backend": {"train_type": {"default_value": TrainType.INCREMENTAL.value}}}} + {"parameter_overrides": {"algo_backend": {"train_type": {"default_value": TrainType.Incremental.value}}}} ) dataset, label_schema = load_test_dataset(MockTemplate()) diff --git a/tests/unit/cli/manager/test_config_manager.py b/tests/unit/cli/manager/test_config_manager.py index ce7900cef7e..c53d56f1153 100644 --- a/tests/unit/cli/manager/test_config_manager.py +++ b/tests/unit/cli/manager/test_config_manager.py @@ -138,7 +138,7 @@ def test_export_data_cfg(self, mocker, config_manager): def test_build_workspace(self, mocker): # Setup task_type = "CLASSIFICATION" - train_type = "SEMISUPERVISED" + train_type = "Semisupervised" workspace_path = "./otx-workspace" args = mocker.Mock() args.autosplit = None @@ -345,7 +345,7 @@ def test_configure_template(self, mocker): "otx.cli.manager.config_manager.ConfigManager.check_workspace", return_value=True ) mocker.patch("otx.cli.manager.config_manager.ConfigManager._get_template", return_value=mock_template) - mocker.patch("otx.cli.manager.config_manager.ConfigManager._get_train_type", return_value="INCREMENTAL") + mocker.patch("otx.cli.manager.config_manager.ConfigManager._get_train_type", return_value="Incremental") mock_parse_model_template = mocker.patch( "otx.cli.manager.config_manager.parse_model_template", return_value=mock_template ) @@ -358,7 +358,7 @@ def test_configure_template(self, mocker): # Then assert config_manager.task_type == "CLASSIFICATION" assert config_manager.model == "template_name" - assert config_manager.train_type == "INCREMENTAL" + assert config_manager.train_type == "Incremental" config_manager.mode = "build" mocker.patch("otx.cli.manager.config_manager.ConfigManager._check_rebuild", return_value=True) @@ -366,7 +366,7 @@ def test_configure_template(self, mocker): assert config_manager.rebuild assert config_manager.task_type == "CLASSIFICATION" assert config_manager.model == "template_name" - assert config_manager.train_type == "INCREMENTAL" + assert config_manager.train_type == "Incremental" mock_check_workspace.return_value = False mocker.patch("pathlib.Path.exists", return_value=True) @@ -382,7 +382,7 @@ def test_configure_template(self, mocker): config_manager.configure_template() assert config_manager.task_type == "CLASSIFICATION" assert config_manager.model == "template_name" - assert config_manager.train_type == "INCREMENTAL" + assert config_manager.train_type == "Incremental" @e2e_pytest_unit def test__check_rebuild(self, mocker): @@ -405,7 +405,7 @@ def test__check_rebuild(self, mocker): config_manager.args.model = "SSD" config_manager.template.name = "ATSS" - config_manager.args.train_type = "SEMISUPERVISED" + config_manager.args.train_type = "Semisupervised" assert config_manager._check_rebuild() @e2e_pytest_unit @@ -433,7 +433,7 @@ def test_configure_data_config(self, mocker): mock_args.mode = "build" config_manager = ConfigManager(mock_args) - config_manager.train_type = "INCREMENTAL" + config_manager.train_type = "Incremental" config_manager.configure_data_config(update_data_yaml=True) mock_configure_dataset.assert_called_once() @@ -446,27 +446,27 @@ def test_configure_data_config(self, mocker): @e2e_pytest_unit def test__get_train_type(self, mocker): mock_args = mocker.MagicMock() - mock_params_dict = {"algo_backend": {"train_type": {"value": "SEMISUPERVISED"}}} + mock_params_dict = {"algo_backend": {"train_type": {"value": "Semisupervised"}}} mock_configure_dataset = mocker.patch( "otx.cli.manager.config_manager.gen_params_dict_from_args", return_value=mock_params_dict ) config_manager = ConfigManager(args=mock_args) config_manager.mode = "build" - assert config_manager._get_train_type() == "SEMISUPERVISED" + assert config_manager._get_train_type() == "Semisupervised" - config_manager.args.train_type = "INCREMENTAL" + config_manager.args.train_type = "Incremental" mock_configure_dataset.return_value = {} - assert config_manager._get_train_type() == "INCREMENTAL" + assert config_manager._get_train_type() == "Incremental" mock_template = mocker.MagicMock() mock_template.hyper_parameters.parameter_overrides = { - "algo_backend": {"train_type": {"default_value": "SELFSUPERVISED"}} + "algo_backend": {"train_type": {"default_value": "Selfsupervised"}} } config_manager.template = mock_template - assert config_manager._get_train_type(ignore_args=True) == "SELFSUPERVISED" + assert config_manager._get_train_type(ignore_args=True) == "Selfsupervised" config_manager.template.hyper_parameters.parameter_overrides = {} - assert config_manager._get_train_type(ignore_args=True) == "INCREMENTAL" + assert config_manager._get_train_type(ignore_args=True) == "Incremental" @e2e_pytest_unit def test_auto_task_detection(self, mocker): diff --git a/tests/unit/cli/tools/test_build.py b/tests/unit/cli/tools/test_build.py index d54652c58bf..3ddb60689bc 100644 --- a/tests/unit/cli/tools/test_build.py +++ b/tests/unit/cli/tools/test_build.py @@ -16,7 +16,7 @@ def test_get_args(mocker): "--unlabeled-data-roots": "unlabeled/data/root", "--unlabeled-file-list": "unlabeled/file/list", "--task": "detection", - "--train-type": "SEMISUPERVISED", + "--train-type": "Semisupervised", "--work-dir": "work/dir/path", "--model": "SSD", "--backbone": "torchvision.resnet18", @@ -37,7 +37,7 @@ def test_get_args(mocker): assert parsed_args.unlabeled_file_list == "unlabeled/file/list" assert parsed_args.work_dir == "work/dir/path" assert parsed_args.task == "detection" - assert parsed_args.train_type == "SEMISUPERVISED" + assert parsed_args.train_type == "Semisupervised" assert parsed_args.model == "SSD" assert parsed_args.backbone == "torchvision.resnet18" diff --git a/tests/unit/core/data/adapter/test_init.py b/tests/unit/core/data/adapter/test_init.py index 031a8b2ebd6..b647a53715f 100644 --- a/tests/unit/core/data/adapter/test_init.py +++ b/tests/unit/core/data/adapter/test_init.py @@ -13,7 +13,7 @@ @e2e_pytest_unit @pytest.mark.parametrize("task_name", TASK_NAME_TO_TASK_TYPE.keys()) -@pytest.mark.parametrize("train_type", [TrainType.INCREMENTAL.value]) +@pytest.mark.parametrize("train_type", [TrainType.Incremental.value]) def test_get_dataset_adapter_incremental(task_name, train_type): root_path = os.getcwd() task_type = TASK_NAME_TO_TASK_TYPE[task_name] @@ -35,7 +35,7 @@ def test_get_dataset_adapter_incremental(task_name, train_type): @e2e_pytest_unit @pytest.mark.parametrize("task_name", ["classification"]) -@pytest.mark.parametrize("train_type", [TrainType.SELFSUPERVISED.value]) +@pytest.mark.parametrize("train_type", [TrainType.Selfsupervised.value]) def test_get_dataset_adapter_selfsl_classification(task_name, train_type): root_path = os.getcwd() task_type = TASK_NAME_TO_TASK_TYPE[task_name] @@ -56,7 +56,7 @@ def test_get_dataset_adapter_selfsl_classification(task_name, train_type): @e2e_pytest_unit @pytest.mark.parametrize("task_name", ["segmentation"]) -@pytest.mark.parametrize("train_type", [TrainType.SELFSUPERVISED.value]) +@pytest.mark.parametrize("train_type", [TrainType.Selfsupervised.value]) def test_get_dataset_adapter_selfsl_segmentation(task_name, train_type): root_path = os.getcwd() task_type = TASK_NAME_TO_TASK_TYPE[task_name]