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.3.0 (+2.2.0.rc12) to develop #4072

Merged
merged 12 commits into from
Oct 29, 2024
Merged
7 changes: 0 additions & 7 deletions .ci/docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,9 @@
FROM nvidia/cuda:12.1.0-runtime-ubuntu20.04@sha256:c1869c30f46fff478a37ed58d9dace7e08519541274f03424d0b78bd35b2c73a AS python_base_cuda
LABEL maintainer="OpenVINO Training Extensions Development Team"

ARG HTTP_PROXY
ARG HTTPS_PROXY
ARG NO_PROXY
ARG uid
ARG gid

# Setup proxies
ENV http_proxy=$HTTP_PROXY
ENV https_proxy=$HTTPS_PROXY
ENV no_proxy=$NO_PROXY
ENV DEBIAN_FRONTEND="noninteractive"

# hadolint ignore=DL3008
Expand Down
3 changes: 0 additions & 3 deletions .ci/docker/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,6 @@ fi
TAG=$1

docker build -f ./Dockerfile \
--build-arg HTTP_PROXY="${http_proxy:?}" \
--build-arg HTTPS_PROXY="${https_proxy:?}" \
--build-arg NO_PROXY="${no_proxy:?}" \
--build-arg ACTIONS_RUNNER_VER="$ACTIONS_RUNNER_VER" \
--build-arg gid="$(id -g)" \
--build-arg uid="$UID" \
Expand Down
8 changes: 1 addition & 7 deletions .ci/docker/start-runner.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/bash

GPU_ID="all"
VER_CUDA="11.7.1"
VER_CUDA="12.1.0"
TAG_RUNNER="latest"
ADDITIONAL_LABELS=""
MOUNT_PATH=""
Expand Down Expand Up @@ -149,9 +149,6 @@ if [ "$DEBUG_CONTAINER" = true ]; then
--name "$CONTAINER_NAME" \
-e NVIDIA_VISIBLE_DEVICES="$GPU_ID" \
${ENV_FLAGS} \
-e http_proxy=http://proxy-chain.intel.com:911 \
-e https_proxy=http://proxy-chain.intel.com:912 \
-e no_proxy=intel.com,.intel.com,localhost,127.0.0.0/8 \
${MOUNT_FLAGS} \
${CACHE_MOUNT_FLAGS} \
"$DOCKER_REG_ADDR"/ote/ci/cu"$VER_CUDA"/runner:"$TAG_RUNNER"; RET=$?
Expand All @@ -172,9 +169,6 @@ else
--name "$CONTAINER_NAME" \
-e NVIDIA_VISIBLE_DEVICES="$GPU_ID" \
${ENV_FLAGS} \
-e http_proxy=http://proxy-chain.intel.com:911 \
-e https_proxy=http://proxy-chain.intel.com:912 \
-e no_proxy=intel.com,.intel.com,localhost,127.0.0.0/8 \
${MOUNT_FLAGS} \
${CACHE_MOUNT_FLAGS} \
"$DOCKER_REG_ADDR"/ote/ci/cu"$VER_CUDA"/runner:"$TAG_RUNNER"; RET=$?
Expand Down
32 changes: 29 additions & 3 deletions .github/workflows/pre_merge.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -101,9 +101,6 @@ jobs:
- task: "multi_cls_classification"
- task: "multi_label_classification"
- task: "hlabel_classification"
- task: "detection"
- task: "instance_segmentation"
- task: "semantic_segmentation"
- task: "visual_prompting"
- task: "zero_shot_visual_prompting"
- task: "anomaly_classification"
Expand All @@ -127,3 +124,32 @@ jobs:
rm /tmp/requirements.txt
- name: Run Integration Test
run: tox -vv -e integration-test-${{ matrix.task }}
Integration-Test-Large:
if: |
github.event.pull_request.draft == false &&
!(startsWith(github.event.pull_request.title, '[WIP]'))
runs-on: [self-hosted, linux, x64, dev, dmount]
needs: Unit-Test
strategy:
fail-fast: false
matrix:
include:
- task: "detection"
- task: "instance_segmentation"
- task: "semantic_segmentation"
name: Integration-Test-Large-${{ matrix.task }}-py310
steps:
- name: Checkout repository
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: Install Python
uses: actions/setup-python@39cd14951b08e74b54015e9e001cdefcf80e669f # v5.1.1
with:
python-version: "3.10"
- name: Install tox
run: |
python -m pip install --require-hashes --no-deps -r .ci/requirements.txt
pip-compile --generate-hashes --output-file=/tmp/requirements.txt --extra=ci_tox pyproject.toml
python -m pip install --require-hashes --no-deps -r /tmp/requirements.txt
rm /tmp/requirements.txt
- name: Run Integration Test
run: tox -vv -e integration-test-${{ matrix.task }}
92 changes: 66 additions & 26 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,76 +7,80 @@ All notable changes to this project will be documented in this file.
### New features

- Turn on/off classification augmentations
(https://github.com/openvinotoolkit/training_extensions/pull/4039)
(<https://github.com/openvinotoolkit/training_extensions/pull/4039>)

### Enhancements

- Update visual prompting pipeline for multi-label zero-shot learning support
(https://github.com/openvinotoolkit/training_extensions/pull/3993)
(<https://github.com/openvinotoolkit/training_extensions/pull/3993>)
- Update to work torch compile in detection
(https://github.com/openvinotoolkit/training_extensions/pull/4003)
(<https://github.com/openvinotoolkit/training_extensions/pull/4003>)
- Fix MaskRCNN/RTMDet-Inst/MaskRCNNTV Explain Mode
(https://github.com/openvinotoolkit/training_extensions/pull/4053)
(<https://github.com/openvinotoolkit/training_extensions/pull/4053>)

## \[2.3.0\]

### New features

- Add YOLOv9 model for Object Detection
(https://github.com/openvinotoolkit/training_extensions/pull/3917)
(<https://github.com/openvinotoolkit/training_extensions/pull/3917>, <https://github.com/openvinotoolkit/training_extensions/pull/4026>)
- Add OV inference for keypoint detection
(https://github.com/openvinotoolkit/training_extensions/pull/3970)
(<https://github.com/openvinotoolkit/training_extensions/pull/3970>)
- Add tiling for semantic segmentation
(https://github.com/openvinotoolkit/training_extensions/pull/3954)
(<https://github.com/openvinotoolkit/training_extensions/pull/3954>)
- Add 3D Object Detection task with MonoDETR model
(https://github.com/openvinotoolkit/training_extensions/pull/3979)
(<https://github.com/openvinotoolkit/training_extensions/pull/3979>)
- Add OpenVINO inference for 3D Object Detection task
(<https://github.com/openvinotoolkit/training_extensions/pull/4017>)

### Enhancements

- Upgrade OV, MAPI, and NNCF dependencies
(https://github.com/openvinotoolkit/training_extensions/pull/3967)
(<https://github.com/openvinotoolkit/training_extensions/pull/3967>)
- Instance Segmentation Model refactoring
(https://github.com/openvinotoolkit/training_extensions/pull/3865)
(<https://github.com/openvinotoolkit/training_extensions/pull/3865>)
- Bump torch and lightning to 2.4.0 versions
(https://github.com/openvinotoolkit/training_extensions/pull/3843)
(<https://github.com/openvinotoolkit/training_extensions/pull/3843>)
- Add mAP metric to evaluate multilabel classification
(https://github.com/openvinotoolkit/training_extensions/pull/3985)
(<https://github.com/openvinotoolkit/training_extensions/pull/3985>)

### Bug fixes

- Fix a wrong HPO log
(https://github.com/openvinotoolkit/training_extensions/pull/3972)
(<https://github.com/openvinotoolkit/training_extensions/pull/3972>)
- Update model name in rotated detection recipes
(<https://github.com/openvinotoolkit/training_extensions/pull/4028>)

## \[2.2.0\]

### New features

- Add RT-DETR model for Object Detection
(https://github.com/openvinotoolkit/training_extensions/pull/3741)
(<https://github.com/openvinotoolkit/training_extensions/pull/3741>)
- Add Multi-Label & H-label Classification with torchvision models
(https://github.com/openvinotoolkit/training_extensions/pull/3697)
(<https://github.com/openvinotoolkit/training_extensions/pull/3697>)
- Add Hugging-Face Model Wrapper for Classification
(https://github.com/openvinotoolkit/training_extensions/pull/3710)
(<https://github.com/openvinotoolkit/training_extensions/pull/3710>)
- Add LoRA finetuning capability for ViT Architectures
(https://github.com/openvinotoolkit/training_extensions/pull/3729)
(<https://github.com/openvinotoolkit/training_extensions/pull/3729>)
- Add Hugging-Face Model Wrapper for Object Detection
(https://github.com/openvinotoolkit/training_extensions/pull/3747)
(<https://github.com/openvinotoolkit/training_extensions/pull/3747>)
- Add Hugging-Face Model Wrapper for Semantic Segmentation
(https://github.com/openvinotoolkit/training_extensions/pull/3749)
(<https://github.com/openvinotoolkit/training_extensions/pull/3749>)
- Enable torch.compile to work with classification
(https://github.com/openvinotoolkit/training_extensions/pull/3758)
(<https://github.com/openvinotoolkit/training_extensions/pull/3758>)
- Add `otx benchmark` subcommand
(https://github.com/openvinotoolkit/training_extensions/pull/3762)
(<https://github.com/openvinotoolkit/training_extensions/pull/3762>)
- Add RTMPose for Keypoint Detection Task
(https://github.com/openvinotoolkit/training_extensions/pull/3781)
(<https://github.com/openvinotoolkit/training_extensions/pull/3781>, <https://github.com/openvinotoolkit/training_extensions/pull/4034>)
- Add Semi-SL MeanTeacher algorithm for Semantic Segmentation
(https://github.com/openvinotoolkit/training_extensions/pull/3801)
(<https://github.com/openvinotoolkit/training_extensions/pull/3801>)
- Update head and h-label format for hierarchical label classification
(https://github.com/openvinotoolkit/training_extensions/pull/3810)
(<https://github.com/openvinotoolkit/training_extensions/pull/3810>)
- Support configurable input size
(https://github.com/openvinotoolkit/training_extensions/pull/3788)
(<https://github.com/openvinotoolkit/training_extensions/pull/3788>)
- Add diffusion task
(https://github.com/openvinotoolkit/training_extensions/pull/3875)
(<https://github.com/openvinotoolkit/training_extensions/pull/3875>)

### Enhancements

Expand Down Expand Up @@ -104,9 +108,21 @@ All notable changes to this project will be documented in this file.
(<https://github.com/openvinotoolkit/training_extensions/pull/3968>)
- Change sematic segmentation to consider bbox only annotations
(<https://github.com/openvinotoolkit/training_extensions/pull/3996>)
- Relieve memory usage criteria on batch size 2 during adaptive batch size
(<https://github.com/openvinotoolkit/training_extensions/pull/4009>)
- Remove background label from RT Info for segmentation task
(<https://github.com/openvinotoolkit/training_extensions/pull/4011>)
- Prevent using too low confidence thresholds in detection
(<https://github.com/openvinotoolkit/training_extensions/pull/4018>)
- Update HPO interface
(<https://github.com/openvinotoolkit/training_extensions/pull/4035>)
- Bump onnx to 1.17.0 to omit CVE-2024-5187
(<https://github.com/openvinotoolkit/training_extensions/pull/4063>)

### Bug fixes

- Update anomaly base transforms to use square resizing
(<https://github.com/openvinotoolkit/training_extensions/pull/4059>)
- Fix Combined Dataloader & unlabeled warmup loss in Semi-SL
(<https://github.com/openvinotoolkit/training_extensions/pull/3723>)
- Revert #3579 to fix issues with replacing coco_instance with a different format in some dataset
Expand All @@ -119,6 +135,30 @@ All notable changes to this project will be documented in this file.
(<https://github.com/openvinotoolkit/training_extensions/pull/3946>)
- Fix config converter for tiling
(<https://github.com/openvinotoolkit/training_extensions/pull/3973>)
- Fix `BboxOverlaps2D` handling of empty ground-truth annotations in datasets.
(<https://github.com/openvinotoolkit/training_extensions/pull/4010>)
- Fix num_trials calculation on dataset length less than num_class
(<https://github.com/openvinotoolkit/training_extensions/pull/4014>)
- Fix out_features in HierarchicalCBAMClsHead
(<https://github.com/openvinotoolkit/training_extensions/pull/4016>)
- Fix multilabel_accuracy of MixedHLabelAccuracy
(<https://github.com/openvinotoolkit/training_extensions/pull/4042>)
- Fix wrong indices setting in HLabelInfo
(<https://github.com/openvinotoolkit/training_extensions/pull/4044>)
- Add legacy template LiteHRNet_18 template
(<https://github.com/openvinotoolkit/training_extensions/pull/4049>)
- Model templates: rename model_status value 'DISCONTINUED' to 'OBSOLETE'
(<https://github.com/openvinotoolkit/training_extensions/pull/4051>)
- Enable export of feature vectors for semantic segmentation task
(<https://github.com/openvinotoolkit/training_extensions/pull/4055>)
- Update MRCNN model export to include feature vector and saliency map
(<https://github.com/openvinotoolkit/training_extensions/pull/4056>)
- Upgrade MAPI in 2.2
(<https://github.com/openvinotoolkit/training_extensions/pull/4052>)
- Fix applying model's hparams when loading model from checkpoint
(<https://github.com/openvinotoolkit/training_extensions/pull/4057>)
- Fix incorrect all_groups order configuration in HLabelInfo
(<https://github.com/openvinotoolkit/training_extensions/pull/4067>)

## \[v2.1.0\]

Expand Down
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,9 @@ In addition to the examples above, please refer to the documentation for tutoria
- Include full image with anno in case there's no tile in tile dataset
- Add type checker in converter for callable functions (optimizer, scheduler)
- Change sematic segmentation to consider bbox only annotations
- Relieve memory usage criteria on batch size 2 during adaptive batch size
- Remove background label from RT Info for segmentation task
- Prevent using too low confidence thresholds in detection

### Bug fixes

Expand All @@ -206,6 +209,10 @@ In addition to the examples above, please refer to the documentation for tutoria
- Add missing tile recipes and various tile recipe changes
- Change categories mapping logic
- Fix config converter for tiling
- Fix num_trials calculation on dataset length less than num_class
- Fix out_features in HierarchicalCBAMClsHead
- Fix multilabel_accuracy of MixedHLabelAccuracy
- Fix wrong indices setting in HLabelInfo

### Known issues

Expand Down
9 changes: 8 additions & 1 deletion docs/source/guide/release_notes/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Releases
.. toctree::
:maxdepth: 1

v2.2.0 (2024.09)
v2.2.0 (2024.10)
----------------

New features
Expand Down Expand Up @@ -38,6 +38,9 @@ Enhancements
- Include full image with anno in case there's no tile in tile dataset
- Add type checker in converter for callable functions (optimizer, scheduler)
- Change sematic segmentation to consider bbox only annotations
- Relieve memory usage criteria on batch size 2 during adaptive batch size
- Remove background label from RT Info for segmentation task
- Prevent using too low confidence thresholds in detection

Bug fixes
^^^^^^^^^
Expand All @@ -48,6 +51,10 @@ Bug fixes
- Add missing tile recipes and various tile recipe changes
- Change categories mapping logic
- Fix config converter for tiling
- Fix num_trials calculation on dataset length less than num_class
- Fix out_features in HierarchicalCBAMClsHead
- Fix multilabel_accuracy of MixedHLabelAccuracy
- Fix wrong indices setting in HLabelInfo

v2.1.0 (2024.07)
----------------
Expand Down
6 changes: 3 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,8 @@ xpu = [
"timm==1.0.3",
"openvino==2024.4",
"openvino-dev==2024.4",
"openvino-model-api==0.2.4",
"onnx==1.16.2",
"openvino-model-api==0.2.5",
"onnx==1.17.0",
"onnxconverter-common==1.14.0",
"nncf==2.13.0",
"anomalib[core]==1.1.0",
Expand All @@ -96,7 +96,7 @@ base = [
"openvino==2024.4",
"openvino-dev==2024.4",
"openvino-model-api==0.2.4",
"onnx==1.16.2",
"onnx==1.17.0",
"onnxconverter-common==1.14.0",
"nncf==2.13.0",
"anomalib[core]==1.1.0",
Expand Down
2 changes: 1 addition & 1 deletion src/otx/algo/classification/heads/hlabel_cls_head.py
Original file line number Diff line number Diff line change
Expand Up @@ -355,7 +355,7 @@ def __init__(
self.fc_superclass = nn.Linear(in_channels * self.step_size[0] * self.step_size[1], num_multiclass_heads)
self.attention_fc = nn.Linear(num_multiclass_heads, in_channels * self.step_size[0] * self.step_size[1])
self.cbam = CBAM(in_channels)
self.fc_subclass = nn.Linear(in_channels * self.step_size[0] * self.step_size[1], num_single_label_classes)
self.fc_subclass = nn.Linear(in_channels * self.step_size[0] * self.step_size[1], num_classes)

self._init_layers()

Expand Down
4 changes: 2 additions & 2 deletions src/otx/algo/common/losses/cross_focal_loss.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import torch
import torch.nn.functional
from torch import Tensor, nn
from torch.cuda.amp import custom_fwd
from torch.amp import custom_fwd

from .focal_loss import py_sigmoid_focal_loss

Expand Down Expand Up @@ -79,7 +79,7 @@ def __init__(

self.cls_criterion = cross_sigmoid_focal_loss

@custom_fwd(cast_inputs=torch.float32)
@custom_fwd(cast_inputs=torch.float32, device_type="cuda")
def forward(
self,
pred: Tensor,
Expand Down
1 change: 1 addition & 0 deletions src/otx/algo/instance_segmentation/rtmdet_inst.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@ def _exporter(self) -> OTXModelExporter:
"opset_version": 11,
"autograd_inlining": False,
},
# TODO(Eugene): Add XAI support for RTMDetInst
output_names=["bboxes", "labels", "masks", "feature_vector", "saliency_map"] if self.explain_mode else None,
)

Expand Down
Loading
Loading