You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/source/guide/explanation/algorithms/classification/multi_label_classification.rst
+7-3Lines changed: 7 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -23,11 +23,15 @@ For supervised learning we use the following algorithms components:
23
23
Dataset Format
24
24
**************
25
25
26
-
As it is a common practice to use object detection datasets in the academic area, we support the most popular object detection formats: `COCO <https://cocodataset.org/#format-data>`_.
27
-
Specifically, these formats will be converted in our `internal representation <https://github.com/openvinotoolkit/training_extensions/tree/develop/data/datumaro_multilabel>`_ via the `Datumaro <https://github.com/openvinotoolkit/datumaro>`_ dataset handler.
26
+
As it is a common practice to use object detection datasets in the academic area, we support the most popular object detection format: `COCO <https://cocodataset.org/#format-data>`_.
27
+
Specifically, this format should be converted in our `internal representation <https://github.com/openvinotoolkit/training_extensions/tree/develop/data/datumaro_multilabel>`_ first. We provided a `script <https://github.com/openvinotoolkit/training_extensions/blob/develop/otx/algorithms/classification/utils/convert_coco_to_multilabel.py>` to help with conversion.
28
+
To convert the COCO data format to our internal one, run this script in similar way:
29
+
30
+
.. code-block::
31
+
python convert_coco_to_multilabel.py --ann_file_path <path to .json COCO annotations> --data_root_dir <path to images folder> --output <output path to save annotations>
28
32
29
33
.. note::
30
-
Names of the annotations files and overall dataset structure should be the same as the original `COCO <https://cocodataset.org/#format-data>`_.
34
+
Names of the annotations files and overall dataset structure should be the same as the original `COCO <https://cocodataset.org/#format-data>`_. You need to convert train and validation sets separately.
31
35
32
36
Please, refer to our :doc:`dedicated tutorial <../../../tutorials/base/how_to_train/classification>` for more information how to train, validate and optimize classification models.
Copy file name to clipboardExpand all lines: docs/source/guide/explanation/algorithms/object_detection/object_detection.rst
+10-11Lines changed: 10 additions & 11 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,7 +1,7 @@
1
1
Object Detection
2
2
================
3
3
4
-
Object detection is a computer vision task where it's needed to locate objects, finding their bounding boxes coordinates together with defining class.
4
+
Object detection is a computer vision task where it's needed to locate objects, finding their bounding boxes coordinates together with defining class.
5
5
The input is an image, and the output is a pair of coordinates for bouding box corners and a class number for each detected object.
6
6
7
7
The common approach to building object detection architecture is to take a feature extractor (backbone), that can be inherited from the classification task.
@@ -22,25 +22,24 @@ For the supervised training we use the following algorithms components:
22
22
23
23
- ``Additional training techniques``
24
24
- ``Early stopping``: To add adaptability to the training pipeline and prevent overfitting. You can use early stopping like the below command.
25
-
25
+
26
26
.. code-block::
27
27
28
28
$ otx train {TEMPLATE} ... \
29
29
params \
30
30
--learning_parameters.enable_early_stopping=True
31
31
32
-
- `Anchor clustering for SSD <https://arxiv.org/abs/2211.17170>`_: This model highly relies on predefined anchor boxes hyperparameter that impacts the size of objects, which can be detected. So before training, we collect object statistics within dataset, cluster them and modify anchor boxes sizes to fit the most for objects the model is going to detect.
33
-
32
+
- `Anchor clustering for SSD <https://arxiv.org/abs/2211.17170>`_: This model highly relies on predefined anchor boxes hyperparameter that impacts the size of objects, which can be detected. So before training, we collect object statistics within dataset, cluster them and modify anchor boxes sizes to fit the most for objects the model is going to detect.
33
+
34
34
- ``Backbone pretraining``: we pretrained MobileNetV2 backbone on large `ImageNet21k <https://github.com/Alibaba-MIIL/ImageNet21K>`_ dataset to improve feature extractor and learn better and faster.
35
35
36
36
37
37
**************
38
38
Dataset Format
39
39
**************
40
40
41
-
At the current point we support `COCO <https://cocodataset.org/#format-data>`_,
42
-
`Pascal-VOC <https://openvinotoolkit.github.io/datumaro/docs/formats/pascal_voc/>`_ and
`ATSS <https://arxiv.org/abs/1912.02424>`_ is a good medium-range model that works well and fast in most cases.
84
+
`ATSS <https://arxiv.org/abs/1912.02424>`_ is a good medium-range model that works well and fast in most cases.
86
85
`SSD <https://arxiv.org/abs/1512.02325>`_ and `YOLOX <https://arxiv.org/abs/2107.08430>`_ are light models, that a perfect for the fastest inference on low-power hardware.
87
86
YOLOX achieved the same accuracy as SSD, and even outperforms its inference on CPU 1.5 times, but requires 3 times more time for training due to `Mosaic augmentation <https://arxiv.org/pdf/2004.10934.pdf>`_, which is even more than for ATSS.
88
87
So if you have resources for a long training, you can pick the YOLOX model.
@@ -132,14 +131,14 @@ Overall, OpenVINO™ Training Extensions utilizes powerful techniques for improv
132
131
133
132
- ``Additional training techniques``: Other than that, we use several solutions that apply to supervised learning (No bias Decay, Augmentations, Early stopping, LR conditioning.).
134
133
135
-
Please, refer to the :doc:`tutorial <../../../tutorials/advanced/semi_sl>` how to train semi supervised learning.
134
+
Please, refer to the :doc:`tutorial <../../../tutorials/advanced/semi_sl>` how to train semi supervised learning.
136
135
137
-
In the table below the mAP on toy data sample from `COCO <https://cocodataset.org/#home>`_ dataset using our pipeline is presented.
136
+
In the table below the mAP on toy data sample from `COCO <https://cocodataset.org/#home>`_ dataset using our pipeline is presented.
138
137
139
138
We sample 400 images that contain one of [person, car, bus] for labeled train images. And 4000 images for unlabeled images. For validation 100 images are selected from val2017.
Copy file name to clipboardExpand all lines: docs/source/guide/explanation/algorithms/segmentation/instance_segmentation.rst
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -40,7 +40,7 @@ For the supervised training we use the following algorithms components:
40
40
Dataset Format
41
41
**************
42
42
43
-
For the dataset handling inside OpenVINO™ Training Extensions, we use `Dataset Management Framework (Datumaro) <https://github.com/openvinotoolkit/datumaro>`_. For instance segmentation we support `COCO <https://cocodataset.org/#format-data>`_ and `Pascal-VOC <https://openvinotoolkit.github.io/datumaro/docs/formats/pascal_voc/>`_ dataset formats.
43
+
For the dataset handling inside OpenVINO™ Training Extensions, we use `Dataset Management Framework (Datumaro) <https://github.com/openvinotoolkit/datumaro>`_. For instance segmentation we support `COCO <https://cocodataset.org/#format-data>`_ dataset format.
44
44
If you have your dataset in those formats, then you can simply run using one line of code:
Copy file name to clipboardExpand all lines: docs/source/guide/explanation/algorithms/segmentation/semantic_segmentation.rst
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -42,7 +42,7 @@ Dataset Format
42
42
43
43
For the dataset handling inside OpenVINO™ Training Extensions, we use `Dataset Management Framework (Datumaro) <https://github.com/openvinotoolkit/datumaro>`_.
44
44
45
-
At this end we support `Pascal VOC <https://openvinotoolkit.github.io/datumaro/docs/formats/pascal_voc/>`_ and `Common Semantic Segmentation <https://openvinotoolkit.github.io/datumaro/docs/formats/common_semantic_segmentation/>`_ data formats.
45
+
At this end we support `Common Semantic Segmentation <https://openvinotoolkit.github.io/datumaro/docs/formats/common_semantic_segmentation/>`_ data format.
46
46
If you organized supported dataset format, starting training will be very simple. We just need to pass a path to the root folder and desired model template to start training:
47
47
48
48
.. code-block::
@@ -90,7 +90,7 @@ Whereas the ``Lite-HRNet-s-mod2`` is the lightweight architecture for fast infer
90
90
Semi-supervised Learning
91
91
************************
92
92
93
-
To solve :ref:`Semi-supervised learning <semi_sl_explanation>` problem for the semantic segmentation we use the `Mean Teacher algorithm <https://arxiv.org/abs/1703.01780>`_.
93
+
To solve :ref:`Semi-supervised learning <semi_sl_explanation>` problem for the semantic segmentation we use the `Mean Teacher algorithm <https://arxiv.org/abs/1703.01780>`_.
94
94
95
95
The basic idea of this approach is to use two models during training: a "student" model, which is the main model being trained, and a "teacher" model, which acts as a guide for the student model.
96
96
The student model is updated based on the ground truth annotations (for the labeled data) and pseudo-labels (for the unlabeled data) which are the predictions of the teacher model.
Copy file name to clipboardExpand all lines: docs/source/guide/tutorials/base/how_to_train/instance_segmentation.rst
+11-10Lines changed: 11 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -26,10 +26,10 @@ The process has been tested on the following configuration.
26
26
Setup virtual environment
27
27
*************************
28
28
29
-
1. You can follow the installation process from a :doc:`quick start guide <../../../get_started/quick_start_guide/installation>`
29
+
1. You can follow the installation process from a :doc:`quick start guide <../../../get_started/quick_start_guide/installation>`
30
30
to create a universal virtual environment for OpenVINO™ Training Extensions.
31
31
32
-
2. Activate your virtual
32
+
2. Activate your virtual
33
33
environment:
34
34
35
35
.. code-block::
@@ -43,7 +43,7 @@ environment:
43
43
Dataset preparation
44
44
***************************
45
45
46
-
1. Let's use the simple toy dataset `Car, Tree, Bug dataset <https://github.com/openvinotoolkit/training_extensions/tree/develop/tests/assets/car_tree_bug>`_
46
+
1. Let's use the simple toy dataset `Car, Tree, Bug dataset <https://github.com/openvinotoolkit/training_extensions/tree/develop/tests/assets/car_tree_bug>`_
47
47
provided by OpenVINO™ Training Extensions.
48
48
49
49
This dataset contains images of simple car, tree, bug with the annotation for instance segmentation.
@@ -73,7 +73,7 @@ we will need the following file structure:
73
73
...
74
74
75
75
.. warning::
76
-
There may be features that don't work properly with the current toy dataset. We recommend that you proceed with a proper training and validation dataset,
76
+
There may be features that don't work properly with the current toy dataset. We recommend that you proceed with a proper training and validation dataset,
77
77
the tutorial and dataset here are for reference only.
78
78
79
79
We will update this tutorial with larger public datasets soon.
@@ -102,7 +102,7 @@ The list of supported templates for instance segmentation is available with the
Let's prepare an OpenVINO™ Training Extensions instance segmentation workspace running the following command:
@@ -142,10 +142,11 @@ It will create **otx-workspace-INSTANCE_SEGMENTATION** with all necessary config
142
142
143
143
For more information, see :doc:`quick start guide <../../../get_started/quick_start_guide/cli_commands>` or :ref:`detection example <detection_workspace>`.
144
144
145
-
3. Next, we need to update
146
-
train/validation set configuration in ``data.yaml``.
145
+
.. warning::
146
+
Note, that we can't run CLI commands for instance segmentation via model name, since the same models are utilized for different algorithm and the behavior can be unpredictable.
147
+
Please, use the template path or template ID instead.
147
148
148
-
To simplify the command line functions calling, we may create a ``data.yaml`` file with annotations info and pass it as a ``--data`` parameter.
149
+
To simplify the command line functions calling, we may create a ``data.yaml`` file with annotations info and pass it as a ``--data`` parameter.
149
150
The content of the ``otx-workspace-INSTANCE_SEGMENTATION/data.yaml`` for dataset should have absolute paths and will be similar to that:
150
151
151
152
.. note::
@@ -255,7 +256,7 @@ The output of ``./outputs/performance.json`` consists of a dict with target metr
255
256
Export
256
257
*********
257
258
258
-
1. ``otx export`` exports a trained Pytorch `.pth` model to the
259
+
1. ``otx export`` exports a trained Pytorch `.pth` model to the
It allows running the model on the Intel hardware much more efficient, especially on the CPU. Also, the resulting IR model is required to run POT optimization. IR model consists of 2 files: ``openvino.xml`` for weights and ``openvino.bin`` for architecture.
@@ -277,7 +278,7 @@ and save the exported model to the ``openvino_model`` folder.
277
278
2023-02-21 22:38:21,894 | INFO : run task done.
278
279
2023-02-21 22:38:21,940 | INFO : Exporting completed
279
280
280
-
3. We can check the accuracy of the IR model and the consistency between
281
+
3. We can check the accuracy of the IR model and the consistency between
281
282
the exported model and the PyTorch model.
282
283
283
284
You can use ``otx train`` directly without ``otx build``. It will be required to add ``--train-data-roots`` and ``--val-data-roots`` in the command line:
0 commit comments