diff --git a/.github/workflows/pr_comment_trigger.yaml b/.github/workflows/pr_comment_trigger.yaml index 367746bb0c..b016a7d35b 100644 --- a/.github/workflows/pr_comment_trigger.yaml +++ b/.github/workflows/pr_comment_trigger.yaml @@ -43,7 +43,7 @@ jobs: - name: Print current branch run: echo "$(git branch)" - + - name: Install Python uses: actions/setup-python@v5 with: diff --git a/CHANGELOG.md b/CHANGELOG.md index 2a2e33f627..67ffa246e0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,11 @@ All notable changes to this project will be documented in this file. ## \[Unreleased\] +### New features + +- Add MobileNetV4 medium recipe + (https://github.com/open-edge-platform/training_extensions/pull/4341) + ### Enhancements - Bump OV and NNCF to 2025.1 diff --git a/README.md b/README.md index 2a78dd1f04..e7df6e72d3 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,7 @@ [![python](https://img.shields.io/badge/python-3.10%2B-green)]() [![pytorch](https://img.shields.io/badge/pytorch-2.5%2B-orange)]() -[![openvino](https://img.shields.io/badge/openvino-2025.0-purple)]() +[![openvino](https://img.shields.io/badge/openvino-2025.1-purple)]() diff --git a/pyproject.toml b/pyproject.toml index 58e855c4c3..4794b95bce 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -78,7 +78,7 @@ base = [ "lightning==2.4.0", "torchmetrics==1.6.0", "pytorchcv==0.0.67", - "timm==1.0.3", + "timm==1.0.10", "openvino==2025.1", "openvino-model-api==0.3.0.2", "onnx==1.17.0", diff --git a/src/otx/engine/utils/auto_configurator.py b/src/otx/engine/utils/auto_configurator.py index e0932bfbeb..e457d4c544 100644 --- a/src/otx/engine/utils/auto_configurator.py +++ b/src/otx/engine/utils/auto_configurator.py @@ -48,8 +48,8 @@ } TASK_PER_DATA_FORMAT = { - "imagenet_with_subset_dirs": [OTXTaskType.MULTI_CLASS_CLS, OTXTaskType.H_LABEL_CLS], - "datumaro": [OTXTaskType.MULTI_LABEL_CLS], + "imagenet_with_subset_dirs": [OTXTaskType.MULTI_CLASS_CLS], + "datumaro": [OTXTaskType.MULTI_LABEL_CLS, OTXTaskType.H_LABEL_CLS], "coco_person_keypoints": [OTXTaskType.KEYPOINT_DETECTION], "coco_instances": [ OTXTaskType.DETECTION, diff --git a/src/otx/recipe/classification/h_label_cls/mobilenet_v4_medium.yaml b/src/otx/recipe/classification/h_label_cls/mobilenet_v4_medium.yaml new file mode 100644 index 0000000000..f1f68b01cd --- /dev/null +++ b/src/otx/recipe/classification/h_label_cls/mobilenet_v4_medium.yaml @@ -0,0 +1,42 @@ +model: + class_path: otx.algo.classification.hlabel_models.timm_model.TimmModelHLabelCls + init_args: + model_name: mobilenetv4_conv_medium.e500_r224_in1k + + optimizer: + class_path: torch.optim.SGD + init_args: + lr: 0.0058 + momentum: 0.9 + weight_decay: 0.0001 + + scheduler: + class_path: otx.core.schedulers.LinearWarmupSchedulerCallable + init_args: + num_warmup_steps: 10 + main_scheduler_callable: + class_path: lightning.pytorch.cli.ReduceLROnPlateau + init_args: + mode: max + factor: 0.5 + patience: 3 + monitor: val/accuracy + +engine: + task: H_LABEL_CLS + device: auto + +callback_monitor: val/accuracy + +data: ../../_base_/data/classification.yaml +overrides: + max_epochs: 90 + + callbacks: + - class_path: otx.algo.callbacks.adaptive_early_stopping.EarlyStoppingWithWarmup + init_args: + patience: 5 + + data: + task: H_LABEL_CLS + data_format: datumaro diff --git a/src/otx/recipe/classification/multi_class_cls/mobilenet_v4.yaml b/src/otx/recipe/classification/multi_class_cls/mobilenet_v4_medium.yaml similarity index 86% rename from src/otx/recipe/classification/multi_class_cls/mobilenet_v4.yaml rename to src/otx/recipe/classification/multi_class_cls/mobilenet_v4_medium.yaml index 03d60241df..787ba9e9e3 100644 --- a/src/otx/recipe/classification/multi_class_cls/mobilenet_v4.yaml +++ b/src/otx/recipe/classification/multi_class_cls/mobilenet_v4_medium.yaml @@ -1,14 +1,17 @@ model: class_path: otx.algo.classification.multiclass_models.timm_model.TimmModelMulticlassCls init_args: - model_name: mobilenetv4_conv_small + model_name: mobilenetv4_conv_medium.e500_r224_in1k label_info: 1000 + freeze_backbone: False + optimizer: class_path: torch.optim.SGD init_args: lr: 0.0058 momentum: 0.9 weight_decay: 0.0001 + scheduler: class_path: otx.core.schedulers.LinearWarmupSchedulerCallable init_args: @@ -20,13 +23,17 @@ model: factor: 0.5 patience: 3 monitor: val/accuracy + engine: task: MULTI_CLASS_CLS device: auto + callback_monitor: val/accuracy -data: ../../base/data/classification.yaml + +data: ../../_base_/data/classification.yaml overrides: max_epochs: 90 + callbacks: - class_path: otx.algo.callbacks.adaptive_early_stopping.EarlyStoppingWithWarmup init_args: diff --git a/src/otx/recipe/classification/multi_label_cls/mobilenet_v4_medium.yaml b/src/otx/recipe/classification/multi_label_cls/mobilenet_v4_medium.yaml new file mode 100644 index 0000000000..9dc86b50d2 --- /dev/null +++ b/src/otx/recipe/classification/multi_label_cls/mobilenet_v4_medium.yaml @@ -0,0 +1,41 @@ +model: + class_path: otx.algo.classification.multilabel_models.timm_model.TimmModelMultilabelCls + init_args: + model_name: mobilenetv4_conv_medium.e500_r224_in1k + label_info: 1000 + + optimizer: + class_path: torch.optim.SGD + init_args: + lr: 0.0058 + momentum: 0.9 + weight_decay: 0.0005 + + scheduler: + class_path: otx.core.schedulers.LinearWarmupSchedulerCallable + init_args: + num_warmup_steps: 10 + main_scheduler_callable: + class_path: lightning.pytorch.cli.ReduceLROnPlateau + init_args: + mode: max + factor: 0.5 + patience: 3 + monitor: val/accuracy + +engine: + task: MULTI_LABEL_CLS + device: auto + +callback_monitor: val/accuracy + +data: ../../_base_/data/classification.yaml +overrides: + data: + task: MULTI_LABEL_CLS + data_format: datumaro + + callbacks: + - class_path: otx.algo.callbacks.adaptive_early_stopping.EarlyStoppingWithWarmup + init_args: + patience: 5