Skip to content

Commit

Permalink
Merge branch 'develop' into gz/v2.1_xai_tiling
Browse files Browse the repository at this point in the history
  • Loading branch information
GalyaZalesskaya authored Apr 11, 2024
2 parents 4d553bc + e8e5673 commit a0d35cc
Show file tree
Hide file tree
Showing 28 changed files with 3,326 additions and 136 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/code_scan.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
- name: Freeze dependencies
run: pip-compile --extra=docs,base,mmlab,anomaly -o requirements.txt pyproject.toml
- name: Trivy Scanning
uses: aquasecurity/trivy-action@062f2592684a31eb3aa050cc61e7ca1451cecd3d # 0.18.0
uses: aquasecurity/trivy-action@d710430a6722f083d3b36b8339ff66b32f22ee55 # 0.19.0
with:
trivy-config: ".ci/trivy.yaml"
scan-type: "fs"
Expand Down
1 change: 1 addition & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ recursive-include src/otx *.yaml
recursive-include src/otx *.json
recursive-include src/otx requirements.txt
recursive-include src/otx README.md
recursive-include src/otx LICENSE
recursive-exclude src/otx *.c
graft tests
global-exclude *.py[cod]
17 changes: 15 additions & 2 deletions docs/source/guide/tutorials/base/export.rst
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,20 @@ using the command below:
--export_format EXPORTABLE_CODE
--work-dir outputs/deploy
After that, you can use the resulting ``openvino.zip`` archive in other applications.
After that, you can use the resulting ``exportable_code.zip`` archive in other applications.

4. It is also possible to pass already exported/optimized OpenVINO IR model
to create archive with demo and pack in the IR model.

.. code-block:: shell
(otx) ...$ otx export -c CONFIG
--checkpoint {OPENVINO_IR.XML}
--work-dir outputs/deploy
.. note::

You can also obtain ``exportable_code.zip`` right away during model optimization passing ``export_demo_package=True`` parameter to CLI or API call.

*************
Demonstration
Expand All @@ -75,7 +88,7 @@ Demonstration
Using the exported demo, we're able to run the model in the demonstration mode outside of this repository, using only the ported ``.zip`` archive with minimum required packages.
The demo allows us to apply our model on the custom data or the online footage from a web camera and see how it will work in a real-life scenario. It is not required to install OTX or PyTorch.

1. Unzip the ``openvino.zip``
1. Unzip the ``exportable_code.zip``
archive.

.. code-block::
Expand Down
54 changes: 29 additions & 25 deletions docs/source/guide/tutorials/base/how_to_train/classification.rst
Original file line number Diff line number Diff line change
Expand Up @@ -85,10 +85,10 @@ please keep the exact same name for the train/val/test folder, to identify the d
├── tulips
val
├── daisy
├── ...
├── ...
test
├── daisy
├── ...
├── ...
*********
Training
Expand All @@ -108,26 +108,26 @@ The list of supported recipes for classification is available with the command l
.. code-block:: shell
(otx) ...$ otx find --task MULTI_CLASS_CLS
┏━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
┃ Task ┃ Model Name ┃ Recipe Path ┃
┡━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┩
│ MULTI_CLASS_CLS │ openvino_model │ src/otx/recipe/classification/multi_class_cls/openvino_model.yaml │
│ MULTI_CLASS_CLS │ tv_efficientnet_b0 │ src/otx/recipe/classification/multi_class_cls/tv_efficientnet_b0.yaml │
│ MULTI_CLASS_CLS │ tv_resnet_50 │ src/otx/recipe/classification/multi_class_cls/tv_resnet_50.yaml │
│ MULTI_CLASS_CLS │ efficientnet_v2_light │ src/otx/recipe/classification/multi_class_cls/efficientnet_v2_light.yaml │
│ MULTI_CLASS_CLS │ tv_efficientnet_b3 │ src/otx/recipe/classification/multi_class_cls/tv_efficientnet_b3.yaml │
│ MULTI_CLASS_CLS │ efficientnet_b0_light │ src/otx/recipe/classification/multi_class_cls/efficientnet_b0_light.yaml │
│ MULTI_CLASS_CLS │ tv_efficientnet_v2_l │ src/otx/recipe/classification/multi_class_cls/tv_efficientnet_v2_l.yaml │
│ MULTI_CLASS_CLS │ tv_efficientnet_b1 │ src/otx/recipe/classification/multi_class_cls/tv_efficientnet_b1.yaml │
│ MULTI_CLASS_CLS │ tv_mobilenet_v3_small │ src/otx/recipe/classification/multi_class_cls/tv_mobilenet_v3_small.yaml │
│ MULTI_CLASS_CLS │ otx_mobilenet_v3_large │ src/otx/recipe/classification/multi_class_cls/otx_mobilenet_v3_large.yaml │
│ MULTI_CLASS_CLS │ otx_deit_tiny │ src/otx/recipe/classification/multi_class_cls/otx_deit_tiny.yaml │
│ MULTI_CLASS_CLS │ tv_efficientnet_b4 │ src/otx/recipe/classification/multi_class_cls/tv_efficientnet_b4.yaml │
│ MULTI_CLASS_CLS │ otx_efficientnet_v2 │ src/otx/recipe/classification/multi_class_cls/otx_efficientnet_v2.yaml │
│ MULTI_CLASS_CLS │ mobilenet_v3_large_light │ src/otx/recipe/classification/multi_class_cls/mobilenet_v3_large_light.yaml │
│ MULTI_CLASS_CLS │ otx_efficientnet_b0 │ src/otx/recipe/classification/multi_class_cls/otx_efficientnet_b0.yaml │
│ MULTI_CLASS_CLS │ otx_dino_v2 │ src/otx/recipe/classification/multi_class_cls/otx_dino_v2.yaml │
│ MULTI_CLASS_CLS │ otx_dino_v2_linear_probe │ src/otx/recipe/classification/multi_class_cls/otx_dino_v2_linear_probe.yaml │
┏━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
┃ Task ┃ Model Name ┃ Recipe Path ┃
┡━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┩
│ MULTI_CLASS_CLS │ openvino_model │ src/otx/recipe/classification/multi_class_cls/openvino_model.yaml │
│ MULTI_CLASS_CLS │ tv_efficientnet_b0 │ src/otx/recipe/classification/multi_class_cls/tv_efficientnet_b0.yaml │
│ MULTI_CLASS_CLS │ tv_resnet_50 │ src/otx/recipe/classification/multi_class_cls/tv_resnet_50.yaml │
│ MULTI_CLASS_CLS │ efficientnet_v2_light │ src/otx/recipe/classification/multi_class_cls/efficientnet_v2_light.yaml │
│ MULTI_CLASS_CLS │ tv_efficientnet_b3 │ src/otx/recipe/classification/multi_class_cls/tv_efficientnet_b3.yaml │
│ MULTI_CLASS_CLS │ efficientnet_b0_light │ src/otx/recipe/classification/multi_class_cls/efficientnet_b0_light.yaml │
│ MULTI_CLASS_CLS │ tv_efficientnet_v2_l │ src/otx/recipe/classification/multi_class_cls/tv_efficientnet_v2_l.yaml │
│ MULTI_CLASS_CLS │ tv_efficientnet_b1 │ src/otx/recipe/classification/multi_class_cls/tv_efficientnet_b1.yaml │
│ MULTI_CLASS_CLS │ tv_mobilenet_v3_small │ src/otx/recipe/classification/multi_class_cls/tv_mobilenet_v3_small.yaml │
│ MULTI_CLASS_CLS │ otx_mobilenet_v3_large │ src/otx/recipe/classification/multi_class_cls/otx_mobilenet_v3_large.yaml │
│ MULTI_CLASS_CLS │ otx_deit_tiny │ src/otx/recipe/classification/multi_class_cls/otx_deit_tiny.yaml │
│ MULTI_CLASS_CLS │ tv_efficientnet_b4 │ src/otx/recipe/classification/multi_class_cls/tv_efficientnet_b4.yaml │
│ MULTI_CLASS_CLS │ otx_efficientnet_v2 │ src/otx/recipe/classification/multi_class_cls/otx_efficientnet_v2.yaml │
│ MULTI_CLASS_CLS │ mobilenet_v3_large_light │ src/otx/recipe/classification/multi_class_cls/mobilenet_v3_large_light.yaml │
│ MULTI_CLASS_CLS │ otx_efficientnet_b0 │ src/otx/recipe/classification/multi_class_cls/otx_efficientnet_b0.yaml │
│ MULTI_CLASS_CLS │ otx_dino_v2 │ src/otx/recipe/classification/multi_class_cls/otx_dino_v2.yaml │
│ MULTI_CLASS_CLS │ otx_dino_v2_linear_probe │ src/otx/recipe/classification/multi_class_cls/otx_dino_v2_linear_probe.yaml │
└─────────────────┴──────────────────────────┴────────────────────────────────────────────────────────────────────────────────┘
.. tab-item:: API
Expand All @@ -136,7 +136,7 @@ The list of supported recipes for classification is available with the command l
from otx.engine.utils.api import list_models
model_lists = list_models(task="MULTI_CLASS_CLS", pattern="*efficient")
model_lists = list_models(task="MULTI_CLASS_CLS", pattern="*efficient")
print(model_lists)
'''
[
Expand Down Expand Up @@ -486,7 +486,7 @@ with OpenVINO™ PTQ.

.. code-block:: shell
(otx) ...$ otx optimize --work_dir otx-workspace \
(otx) ...$ otx optimize --work_dir otx-workspace \
--checkpoint otx-workspace/20240312_052847/exported_model.xml
...
Expand All @@ -505,6 +505,10 @@ with OpenVINO™ PTQ.
The optimization time highly relies on the hardware characteristics, for example on Intel(R) Core(TM) i9-10980XE it took about 9 seconds.
Please note, that PTQ will take some time without logging to optimize the model.

.. note::

You can also pass ``export_demo_package=True`` parameter to obtain ``exportable_code.zip`` archive with packed optimized model and demo package. Please refer to :doc:`export tutorial <../export>`.

3. Finally, we can also evaluate the optimized model by passing
it to the ``otx test`` function.

Expand All @@ -514,7 +518,7 @@ it to the ``otx test`` function.

.. code-block:: shell
(otx) ...$ otx test --work_dir otx-workspace \
(otx) ...$ otx test --work_dir otx-workspace \
--checkpoint otx-workspace/20240312_055042/optimized_model.xml \
--engine.device cpu
Expand Down
20 changes: 12 additions & 8 deletions docs/source/guide/tutorials/base/how_to_train/detection.rst
Original file line number Diff line number Diff line change
Expand Up @@ -129,12 +129,12 @@ The list of supported recipes for object detection is available with the command
.. code-block:: shell
(otx) ...$ otx find --task DETECTION --pattern atss
┏━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
┃ Task ┃ Model Name ┃ Recipe Path ┃
┡━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┩
│ DETECTION │ atss_mobilenetv2_tile │ src/otx/recipe/detection/atss_mobilenetv2_tile.yaml │
│ DETECTION │ atss_resnext101 │ src/otx/recipe/detection/atss_resnext101.yaml │
│ DETECTION │ atss_mobilenetv2 │ src/otx/recipe/detection/atss_mobilenetv2.yaml │
┏━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
┃ Task ┃ Model Name ┃ Recipe Path ┃
┡━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┩
│ DETECTION │ atss_mobilenetv2_tile │ src/otx/recipe/detection/atss_mobilenetv2_tile.yaml │
│ DETECTION │ atss_resnext101 │ src/otx/recipe/detection/atss_resnext101.yaml │
│ DETECTION │ atss_mobilenetv2 │ src/otx/recipe/detection/atss_mobilenetv2.yaml │
└───────────┴───────────────────────┴────────────────────────────────────────────────────────────────┘
.. tab-item:: API
Expand Down Expand Up @@ -520,7 +520,7 @@ with OpenVINO™ PTQ.

.. code-block:: shell
(otx) ...$ otx optimize --work_dir otx-workspace \
(otx) ...$ otx optimize --work_dir otx-workspace \
--checkpoint otx-workspace/20240312_052847/exported_model.xml
...
Expand All @@ -539,6 +539,10 @@ with OpenVINO™ PTQ.
The optimization time highly relies on the hardware characteristics, for example on Intel(R) Core(TM) i9-11900 it took about 25 seconds.
Please note, that PTQ will take some time without logging to optimize the model.

.. note::

You can also pass ``export_demo_package=True`` parameter to obtain ``exportable_code.zip`` archive with packed optimized model and demo package. Please refer to :doc:`export tutorial <../export>`.

3. Finally, we can also evaluate the optimized model by passing
it to the ``otx test`` function.

Expand All @@ -548,7 +552,7 @@ it to the ``otx test`` function.

.. code-block:: shell
(otx) ...$ otx test --work_dir otx-workspace \
(otx) ...$ otx test --work_dir otx-workspace \
--checkpoint otx-workspace/20240312_055042/optimized_model.xml \
--engine.device cpu
Expand Down
Loading

0 comments on commit a0d35cc

Please sign in to comment.