Skip to content

Commit c5b41d9

Browse files
authored
[RELEASE][DOC] Fix wrong info in documentation (#1849)
* updated dataset formats info. Fix for multilabel classification * revert file * revert file. minor * added warning to instance segmentation * revert changes
1 parent 4f1a47c commit c5b41d9

File tree

5 files changed

+31
-27
lines changed

5 files changed

+31
-27
lines changed

docs/source/guide/explanation/algorithms/classification/multi_label_classification.rst

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,15 @@ For supervised learning we use the following algorithms components:
2323
Dataset Format
2424
**************
2525

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>
2832
2933
.. 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.
3135

3236
Please, refer to our :doc:`dedicated tutorial <../../../tutorials/base/how_to_train/classification>` for more information how to train, validate and optimize classification models.
3337

docs/source/guide/explanation/algorithms/object_detection/object_detection.rst

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Object Detection
22
================
33

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.
55
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.
66

77
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:
2222

2323
- ``Additional training techniques``
2424
- ``Early stopping``: To add adaptability to the training pipeline and prevent overfitting. You can use early stopping like the below command.
25-
25+
2626
.. code-block::
2727
2828
$ otx train {TEMPLATE} ... \
2929
params \
3030
--learning_parameters.enable_early_stopping=True
3131
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+
3434
- ``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.
3535

3636

3737
**************
3838
Dataset Format
3939
**************
4040

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
43-
`YOLO <https://openvinotoolkit.github.io/datumaro/docs/formats/yolo/>`_ dataset format.
41+
At the current point we support `COCO <https://cocodataset.org/#format-data>`_ and
42+
`Pascal-VOC <https://openvinotoolkit.github.io/datumaro/docs/formats/pascal_voc/>`_ dataset formats.
4443
Learn more about the formats by following the links above. Here is an example of expected format for COCO dataset:
4544

4645
.. code::
@@ -82,7 +81,7 @@ We support the following ready-to-use model templates:
8281
| `Custom_Object_Detection_Gen3_ATSS <https://github.com/openvinotoolkit/training_extensions/blob/develop/otx/algorithms/detection/configs/detection/mobilenetv2_atss/template.yaml>`_ | ATSS | 20.6 | 9.1 |
8382
+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+---------+---------------------+-----------------+
8483

85-
`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.
8685
`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.
8786
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.
8887
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
132131

133132
- ``Additional training techniques``: Other than that, we use several solutions that apply to supervised learning (No bias Decay, Augmentations, Early stopping, LR conditioning.).
134133

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.
136135

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.
138137

139138
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.
140139

141140
+---------+--------------------------------------------+
142-
| Dataset | Sampled COCO dataset |
141+
| Dataset | Sampled COCO dataset |
143142
+=========+=====================+======================+
144143
| | SL | Semi-SL |
145144
+---------+---------------------+----------------------+

docs/source/guide/explanation/algorithms/segmentation/instance_segmentation.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ For the supervised training we use the following algorithms components:
4040
Dataset Format
4141
**************
4242

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.
4444
If you have your dataset in those formats, then you can simply run using one line of code:
4545

4646
.. code-block::

docs/source/guide/explanation/algorithms/segmentation/semantic_segmentation.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ Dataset Format
4242

4343
For the dataset handling inside OpenVINO™ Training Extensions, we use `Dataset Management Framework (Datumaro) <https://github.com/openvinotoolkit/datumaro>`_.
4444

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.
4646
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:
4747

4848
.. code-block::
@@ -90,7 +90,7 @@ Whereas the ``Lite-HRNet-s-mod2`` is the lightweight architecture for fast infer
9090
Semi-supervised Learning
9191
************************
9292

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>`_.
9494

9595
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.
9696
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.

docs/source/guide/tutorials/base/how_to_train/instance_segmentation.rst

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,10 @@ The process has been tested on the following configuration.
2626
Setup virtual environment
2727
*************************
2828

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>`
3030
to create a universal virtual environment for OpenVINO™ Training Extensions.
3131

32-
2. Activate your virtual
32+
2. Activate your virtual
3333
environment:
3434

3535
.. code-block::
@@ -43,7 +43,7 @@ environment:
4343
Dataset preparation
4444
***************************
4545

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>`_
4747
provided by OpenVINO™ Training Extensions.
4848

4949
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:
7373
...
7474
7575
.. 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,
7777
the tutorial and dataset here are for reference only.
7878

7979
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
102102
| INSTANCE_SEGMENTATION | Custom_Counting_Instance_Segmentation_MaskRCNN_EfficientNetB2B | MaskRCNN-EfficientNetB2B | otx/algorithms/detection/configs/instance_segmentation/efficientnetb2b_maskrcnn/template.yaml |
103103
+-----------------------+----------------------------------------------------------------+--------------------------+-----------------------------------------------------------------------------------------------+
104104
105-
2. We need to create
105+
2. We need to create
106106
OpenVINO™ Training Extensions workspace first.
107107

108108
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
142142

143143
For more information, see :doc:`quick start guide <../../../get_started/quick_start_guide/cli_commands>` or :ref:`detection example <detection_workspace>`.
144144

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.
147148

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.
149150
The content of the ``otx-workspace-INSTANCE_SEGMENTATION/data.yaml`` for dataset should have absolute paths and will be similar to that:
150151

151152
.. note::
@@ -255,7 +256,7 @@ The output of ``./outputs/performance.json`` consists of a dict with target metr
255256
Export
256257
*********
257258

258-
1. ``otx export`` exports a trained Pytorch `.pth` model to the
259+
1. ``otx export`` exports a trained Pytorch `.pth` model to the
259260
OpenVINO™ Intermediate Representation (IR) format.
260261

261262
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.
277278
2023-02-21 22:38:21,894 | INFO : run task done.
278279
2023-02-21 22:38:21,940 | INFO : Exporting completed
279280
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
281282
the exported model and the PyTorch model.
282283

283284
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

Comments
 (0)