Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge back 2.2.0.rc3 to develop #3963

Merged
merged 59 commits into from
Sep 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
59 commits
Select commit Hold shift + click to select a range
d1bd1d5
update for releases 2.2.0rc0
yunchu Aug 20, 2024
c16f985
Fix Classification explain forward issue (#3867)
harimkang Aug 21, 2024
cba5120
Fix e2e code error (#3871)
chuneuny-emily Aug 21, 2024
b807c9d
Add documentation about configurable input size (#3870)
eunwoosh Aug 21, 2024
2835aba
Fix zero-shot e2e (#3876)
sungchul2 Aug 23, 2024
ccf2d50
Fix DeiT for multi-label classification (#3881)
harimkang Aug 23, 2024
e577b6a
Fix Semi-SL for ViT accuracy drop (#3883)
harimkang Aug 23, 2024
d1dd2b0
Update docs for 2.2 (#3884)
harimkang Aug 23, 2024
c17a923
Fix mean and scale for segmentation task (#3885)
kprokofi Aug 23, 2024
d72feeb
Update MAPI in 2.2 (#3889)
sovrasov Aug 26, 2024
00ed3a0
Improve Semi-SL for LiteHRNet (small-medium case) (#3891)
kprokofi Aug 26, 2024
2c6b4de
Improve h-cls for eff models (#3893)
sooahleex Aug 26, 2024
0dc7a29
Fix maskrcnn swin nncf acc drop (#3900)
eugene123tw Aug 27, 2024
0d6799c
Add keypoint detection recipe for single object cases (#3903)
wonjuleee Aug 28, 2024
8115b52
Improve acc drop of efficientnetv2 for h-label cls (#3907)
sooahleex Aug 29, 2024
4c8555e
Fix pretrained weight cached dir for timm (#3909)
harimkang Aug 29, 2024
52221e3
Fix keypoint detection single obj recipe (#3915)
wonjuleee Aug 30, 2024
9265c59
Fix cached dir for timm & hugging-face (#3914)
harimkang Aug 30, 2024
5170736
Fix wrong template id mapping for anomaly (#3916)
yunchu Aug 30, 2024
f611cc1
Update script to allow setting otx version using env. variable (#3913)
yunchu Aug 30, 2024
425a479
Fix Datamodule creation for OV in AutoConfigurator (#3920)
harimkang Sep 2, 2024
7f1c7da
Update tpp file for 2.2.0 (#3921)
yunchu Sep 2, 2024
51d1adf
Fix names for ignored scope [HOT-FIX, 2.2.0] (#3924)
kprokofi Sep 3, 2024
2bcf1b2
Fix classification rt_info (#3922)
sovrasov Sep 3, 2024
112b2b2
Update label info (#3925)
ashwinvaidya17 Sep 4, 2024
929132d
Fix binary classification metric task (#3928)
harimkang Sep 5, 2024
706f99b
Improve MaskRCNN SwinT NNCF (#3929)
eugene123tw Sep 5, 2024
53a7d9a
Fix get_item for Chained Tasks in Classification (#3931)
harimkang Sep 5, 2024
c3749e3
Correct Keyerror for h-label cls in label_groups for dm_label_categor…
sooahleex Sep 5, 2024
98a9cac
Remove datumaro attribute id from tiling, add subset names (#3933)
eugene123tw Sep 6, 2024
d8e6454
Fix soft predictions for Semantic Segmentation (#3934)
kprokofi Sep 6, 2024
c2705df
Update STFPM config (#3935)
ashwinvaidya17 Sep 6, 2024
c2ccfc9
Add missing pretrained weights when creating a docker image (#3938)
harimkang Sep 6, 2024
8b747f9
Change default option 'full' to 'base' in otx install (#3937)
harimkang Sep 9, 2024
d43226e
Fix auto adapt batch size in Converter (#3939)
harimkang Sep 9, 2024
1d319cd
Fix hpo converter (#3940)
eunwoosh Sep 9, 2024
aaa2765
Fix tiling XAI out of range (#3943)
eugene123tw Sep 9, 2024
ac87b49
enable model export (#3952)
ashwinvaidya17 Sep 12, 2024
8f96f27
Move templates from OTX1.X to OTX2.X (#3951)
kprokofi Sep 12, 2024
0f87c86
Add missing tile recipes and various tile recipe changes (#3942)
eugene123tw Sep 12, 2024
c7efcbc
Support ImageFromBytes (#3948)
ashwinvaidya17 Sep 12, 2024
ecef545
Change categories mapping logic (#3946)
kprokofi Sep 13, 2024
b1ec8e7
Update for 2.2.0rc1 (#3956)
yunchu Sep 13, 2024
139ece5
merge conflicts
kprokofi Sep 18, 2024
aa31dca
Include Geti arrow dataset subset names (#3962)
eugene123tw Sep 20, 2024
93f1a55
Include full image with anno in case there's no tile in tile dataset …
eugene123tw Sep 20, 2024
45f9a24
Add type checker in converter for callable functions (optimizer, sche…
harimkang Sep 20, 2024
51fcb73
Update for 2.2.0rc2 (#3969)
yunchu Sep 20, 2024
7cb8b0d
Update CHANGELOG.md
kprokofi Sep 20, 2024
901fd16
fix semantic seg tests
kprokofi Sep 20, 2024
5971993
Merge branch 'kp/merge_back_2.2.0' of https://github.com/kprokofi/tra…
kprokofi Sep 20, 2024
a30ef81
fix detection tiling
kprokofi Sep 20, 2024
27ac89c
merge develop
kprokofi Sep 20, 2024
b45aea6
Merge branch 'develop' into kp/merge_back_2.2.0
harimkang Sep 23, 2024
b45fe11
Update test_tiling.py
harimkang Sep 23, 2024
4c8ecd1
Update test_tiling.py
harimkang Sep 23, 2024
cb3d903
Merge rc2
harimkang Sep 23, 2024
31b2504
fix unit test
kprokofi Sep 23, 2024
97dad60
Merge branch 'develop' into kp/merge_back_2.2.0
kprokofi Sep 23, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 22 additions & 4 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

All notable changes to this project will be documented in this file.

## \[unreleased\]
## \[2.2.0\]

### New features

Expand Down Expand Up @@ -45,15 +45,31 @@ All notable changes to this project will be documented in this file.
(<https://github.com/openvinotoolkit/training_extensions/pull/3769>)
- Refactoring `ConvModule` by removing `conv_cfg`, `norm_cfg`, and `act_cfg`
(<https://github.com/openvinotoolkit/training_extensions/pull/3783>, <https://github.com/openvinotoolkit/training_extensions/pull/3816>, <https://github.com/openvinotoolkit/training_extensions/pull/3809>)
- Support ImageFromBytes
(<https://github.com/openvinotoolkit/training_extensions/pull/3948>)
- Enable model export
(<https://github.com/openvinotoolkit/training_extensions/pull/3952>)
- Move templates from OTX1.X to OTX2.X
(<https://github.com/openvinotoolkit/training_extensions/pull/3951>)
- Include Geti arrow dataset subset names
(<https://github.com/openvinotoolkit/training_extensions/pull/3962>)
- Include full image with anno in case there's no tile in tile dataset
(<https://github.com/openvinotoolkit/training_extensions/pull/3964>)
- Add type checker in converter for callable functions (optimizer, scheduler)
(<https://github.com/openvinotoolkit/training_extensions/pull/3968>)

### Bug fixes

- Fix Combined Dataloader & unlabeled warmup loss in Semi-SL
(https://github.com/openvinotoolkit/training_extensions/pull/3723)
(<https://github.com/openvinotoolkit/training_extensions/pull/3723>)
- Revert #3579 to fix issues with replacing coco_instance with a different format in some dataset
(https://github.com/openvinotoolkit/training_extensions/pull/3753)
(<https://github.com/openvinotoolkit/training_extensions/pull/3753>)
- Add num_devices in Engine for multi-gpu training
(https://github.com/openvinotoolkit/training_extensions/pull/3778)
(<https://github.com/openvinotoolkit/training_extensions/pull/3778>)
- Add missing tile recipes and various tile recipe changes
(<https://github.com/openvinotoolkit/training_extensions/pull/3942>)
- Change categories mapping logic
(<https://github.com/openvinotoolkit/training_extensions/pull/3946>)

## \[v2.1.0\]

Expand Down Expand Up @@ -191,6 +207,8 @@ All notable changes to this project will be documented in this file.
(<https://github.com/openvinotoolkit/training_extensions/pull/3684>)
- Fix MaskRCNN SwinT NNCF Accuracy Drop
(<https://github.com/openvinotoolkit/training_extensions/pull/3685>)
- Fix MaskRCNN SwinT NNCF Accuracy Drop By Adding More PTQ Configs
(<https://github.com/openvinotoolkit/training_extensions/pull/3929>)

### Known issues

Expand Down
97 changes: 29 additions & 68 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -166,83 +166,44 @@ In addition to the examples above, please refer to the documentation for tutoria

---

## Updates

### v2.1.0 (3Q24)

> _**NOTES**_
>
> OpenVINO™ Training Extensions, version 2.1.0 does not include the latest functional and security updates. OpenVINO™ Training Extensions, version 2.2.0 is targeted to be released in September 2024 and will include additional functional and security updates. Customers should update to the latest version as it becomes available.
## Updates - v2.2.0 (3Q24)

### New features

- Add a flag to enable OV inference on dGPU
- Add early stopping with warmup. Remove mandatory background label in semantic segmentation task
- RTMDet-tiny enablement for detection task
- Add data_format validation and update in OTXDataModule
- Add torchvision.MaskRCNN
- Add Semi-SL for Multi-class Classification (EfficientNet-B0)
- Decoupling mmaction for action classification (MoviNet, X3D)
- Add Semi-SL Algorithms for mv3-large, effnet-v2, deit-tiny, dino-v2
- RTMDet-tiny enablement for detection task (export/optimize)
- Enable ruff & ruff-format into otx/algo/classification/backbones
- Add TV MaskRCNN Tile Recipe
- Add rotated det OV recipe
- Add RT-DETR model for Object Detection
- Add Multi-Label & H-label Classification with torchvision models
- Add Hugging-Face Model Wrapper for Classification
- Add LoRA finetuning capability for ViT Architectures
- Add Hugging-Face Model Wrapper for Object Detection
- Add Hugging-Face Model Wrapper for Semantic Segmentation
- Enable torch.compile to work with classification
- Add `otx benchmark` subcommand
- Add RTMPose for Keypoint Detection Task
- Add Semi-SL MeanTeacher algorithm for Semantic Segmentation
- Update head and h-label format for hierarchical label classification
- Support configurable input size

### Enhancements

- Change load_stat_dict to on_load_checkpoint
- Add try - except to keep running the remaining tests
- Update instance_segmentation.py to resolve conflict with 2.0.0
- Update XPU install
- Sync rgb order between torch and ov inference of action classification task
- Make Perf test available to load pervious Perf test to skip training stage
- Reenable e2e classification XAI tests
- Remove action detection task support
- Increase readability of pickling error log during HPO & fix minor bug
- Update RTMDet checkpoint url
- Refactor Torchvision Model for Classification Semi-SL
- Add coverage omit mm-related code
- Add docs semi-sl part
- Refactor docs design & Add contents
- Add execution example of auto batch size in docs
- Add Semi-SL for cls Benchmark Test
- Move value to device before logging for metric
- Add .codecov.yaml
- Update benchmark tool for otx2.1
- Collect pretrained weight binary files in one place
- Minimize compiled dependency files
- Update README & CODEOWNERS
- Update Engine's docstring & CLI --help outputs
- Align integration test to exportable code interface update for release branch
- Refactor exporter for anomaly task and fix a bug with exportable code
- Update pandas version constraint
- Include more models to export test into test_otx_e2e
- Move assigning tasks to Models from Engine to Anomaly Model Classes
- Refactoring detection modules
- Reimplement of ViT Architecture following TIMM
- Enable to override data configurations
- Enable to use input_size at transforms in recipe
- Enable to use polygon and bitmap mask as prompt inputs for zero-shot learning
- Refactoring `ConvModule` by removing `conv_cfg`, `norm_cfg`, and `act_cfg`
- Support ImageFromBytes
- enable model export
- Move templates from OTX1.X to OTX2.X
- Include Geti arrow dataset subset names
- Include full image with anno in case there's no tile in tile dataset
- Add type checker in converter for callable functions (optimizer, scheduler)

### Bug fixes

- Fix conflicts between develop and 2.0.0
- Fix polygon mask
- Fix vpm intg test error
- Fix anomaly
- Bug fix in Semantic Segmentation + enable DINOV2 export in ONNX
- Fix some export issues. Remove EXPORTABLE_CODE as export parameter.
- Fix `load_from_checkpoint` to apply original model's hparams
- Fix `load_from_checkpoint` args to apply original model's hparams
- Fix zero-shot `learn` for ov model
- Various fixes for XAI in 2.1
- Fix tests to work in a mm-free environment
- Fix a bug in benchmark code
- Update exportable code dependency & fix a bug
- Fix getting wrong shape during resizing
- Fix detection prediction outputs
- Fix RTMDet PTQ performance
- Fix segmentation fault on VPM PTQ
- Fix NNCF MaskRCNN-Eff accuracy drop
- Fix optimize with Semi-SL data pipeline
- Fix MaskRCNN SwinT NNCF Accuracy Drop
- Fix Combined Dataloader & unlabeled warmup loss in Semi-SL
- Revert #3579 to fix issues with replacing coco_instance with a different format in some dataset
- Add num_devices in Engine for multi-gpu training
- Add missing tile recipes and various tile recipe changes
- Change categories mapping logic

### Known issues

Expand Down
6 changes: 4 additions & 2 deletions docker/build.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
#!/bin/bash
# shellcheck disable=SC2154
# shellcheck disable=SC2154,SC2035,SC2046

OTX_VERSION=$(python -c 'import otx; print(otx.__version__)')
if [ "$OTX_VERSION" == "" ]; then
OTX_VERSION=$(python -c 'import otx; print(otx.__version__)')
fi
THIS_DIR=$(dirname "$0")

echo "Build OTX ${OTX_VERSION} CUDA Docker image..."
Expand Down
4 changes: 0 additions & 4 deletions docker/download_pretrained_weights.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,6 @@ def download_all() -> None:
msg = f"Skip {config_path} since it is not a PyTorch config."
logger.warning(msg)
continue
if "anomaly_" in str(config_path) or "dino_v2" in str(config_path) or "h_label_cls" in str(config_path):
msg = f"Skip {config_path} since those models show errors on instantiation."
logger.warning(msg)
continue

config = OmegaConf.load(config_path)
init_model = next(iter(partial_instantiate_class(config.model)))
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,116 @@
Configurable Input Size
=======================

The Configurable Input Size feature allows users to adjust the input resolution of their deep learning models
to balance between training and inference speed and model performance.
This flexibility enables users to tailor the input size to their specific needs without manually altering
the data pipeline configurations.

To utilize this feature, simply specify the desired input size as an argument during the train command.
Additionally, OTX ensures compatibility with model trained on non-default input sizes by automatically adjusting
the data pipeline to match the input size during other engine entry points.

Usage example:

.. code-block::

$ otx train \
--config ... \

.. tab-set::

.. tab-item:: API 1

.. code-block:: python

from otx.algo.detection.yolox import YOLOXS
from otx.core.data.module import OTXDataModule
from otx.engine import Engine

input_size = (512, 512)
model = YOLOXS(label_info=5, input_size=input_size) # should be tuple[int, int]
datamodule = OTXDataModule(..., input_size=input_size)
engine = Engine(model=model, datamodule=datamodule)
engine.train()

.. tab-item:: API 2

.. code-block:: python

from otx.core.data.module import OTXDataModule
from otx.engine import Engine

datamodule = OTXDataModule(..., input_size=(512, 512))
engine = Engine(model="yolox_s", datamodule=datamodule) # model input size will be aligned with the datamodule input size
engine.train()

.. tab-item:: CLI

.. code-block:: bash

(otx) ...$ otx train ... --data.input_size 512

.. _adaptive-input-size:

Adaptive Input Size
-------------------

The Adaptive Input Size feature intelligently determines an optimal input size for the model
by analyzing the dataset's statistics.
It operates in two distinct modes: "auto" and "downscale".
In "auto" mode, the input size may increase or decrease based on the dataset's characteristics.
In "downscale" mode, the input size will either decrease or remain unchanged, ensuring that the model training or inference speed deosn't drop.


To activate this feature, use the following command with the desired mode:

.. tab-set::

.. tab-item:: API

.. code-block:: python

from otx.algo.detection.yolox import YOLOXS
from otx.core.data.module import OTXDataModule
from otx.engine import Engine

datamodule = OTXDataModule(
...
adaptive_input_size="auto", # auto or downscale
input_size_multiplier=YOLOXS.input_size_multiplier, # should set the input_size_multiplier of the model
)
model = YOLOXS(label_info=5, input_size=datamodule.input_size)
engine = Engine(model=model, datamodule=datamodule)
engine.train()

.. tab-item:: CLI

.. code-block:: bash

(otx) ...$ otx train ... --data.adaptive_input_size "auto | downscale"

The adaptive process includes the following steps:

1. OTX computes robust statistics from the input dataset.

2. The initial input size is set based on the typical large image size within the dataset.

3. (Optional) The input size may be further refined to account for the sizes of objects present in the dataset.
The model's minimum recognizable object size, typically ranging from 16x16 to 32x32 pixels, serves as a reference to
proportionally adjust the input size relative to the average small object size observed in the dataset.
For instance, if objects are generally 64x64 pixels in a 512x512 image, the input size would be adjusted
to 256x256 to maintain detectability.

Adjustments are subject to the following constraints:

* If the recalculated input size exceeds the maximum image size determined in the previous step, it will be capped at that maximum size.
* If the recalculated input size falls below the minimum threshold defined by MIN_DETECTION_INPUT_SIZE, the input size will be scaled up. This is done by increasing the smaller dimension (width or height) to MIN_DETECTION_INPUT_SIZE while maintaining the aspect ratio, ensuring that the model's minimum criteria for object detection are met.

4. (downscale only) Any scale-up beyond the default model input size is restricted.


.. Note::
Opting for a smaller input size can be advantageous for datasets with lower-resolution images or larger objects,
as it may improve speed with minimal impact on model accuracy. However, it is important to consider that selecting
a smaller input size could affect model performance depending on the task, model architecture, and dataset
properties.
8 changes: 7 additions & 1 deletion docs/source/guide/explanation/additional_features/hpo.rst
Original file line number Diff line number Diff line change
Expand Up @@ -143,10 +143,16 @@ Here is explanation of all HPO configuration.

- **mode** (*str*, *default='max'*) - Optimization mode for the metric. It determines whether the metric should be maximized or minimized. The possible values are 'max' and 'min', respectively.

- **num_workers** (*int*, *default=1*) How many trials will be executed in parallel.
- **num_trials** (*int*, *default=None*) The number of training trials to perform during HPO. If not provided, the number of trials will be determined based on the expected time ratio. Defaults to None.

- **num_workers** (*int*, *default=None*) The number of trials that will be run concurrently.

- **expected_time_ratio** (*int*, *default=4*) How many times to use for HPO compared to training time.

- **metric_name** (*str*, *default=None*) The name of the performance metric to be optimized during HPO. If not specified, the metric will be selected based on the configured callbacks. Defaults to None.

- **adapt_bs_search_space_max_val** (*Literal["None", "Safe", "Full"]*, *default="None"*) Whether to execute `Auto-adapt batch size` prior to HPO. This step finds the maximum batch size value, which then serves as the upper limit for the batch size search space during HPO. For further information on `Auto-adapt batch size`, please refer to the `Auto-configuration` documentation. Defaults to "None".

- **maximum_resource** (*int*, *default=None*) - Maximum number of training epochs for each trial. When the training epochs reaches this value, the trial stop to train.

- **minimum_resource** (*int*, *default=None*) - Minimum number of training epochs for each trial. Each trial will run at least this epochs, even if the performance of the model is not improving.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,4 @@ Additional Features
fast_data_loading
tiling
class_incremental_sampler
configurable_input_size

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,3 @@ Action Recognition


action_classification
action_detection
4 changes: 2 additions & 2 deletions docs/source/guide/get_started/cli_commands.rst
Original file line number Diff line number Diff line change
Expand Up @@ -339,11 +339,11 @@ The results will be saved in ``./otx-workspace/`` folder by default. The output

(otx) ...$ otx train --model <model-class-path-or-name> --task <task-type> --data_root <dataset-root>

For example, if you want to use the ``otx.algo.detection.atss.ATSS`` model class, you can train it as shown below.
For example, if you want to use the ``otx.algo.classification.torchvision_model.TVModelForMulticlassCls`` model class, you can train it as shown below.

.. code-block:: shell

(otx) ...$ otx train --model otx.algo.detection.atss.ATSS --model.variant mobilenetv2 --task DETECTION ...
(otx) ...$ otx train --model otx.algo.classification.torchvision_model.TVModelForMulticlassCls --model.backbone mobilenet_v3_small ...

.. note::
You also can visualize the training using ``Tensorboard`` as these logs are located in ``<work_dir>/tensorboard``.
Expand Down
Loading
Loading