Skip to content

Commit 5ca24e1

Browse files
authored
Update multi-label document and conversion script (#2358)
Update docs, label convert script
1 parent a123ca7 commit 5ca24e1

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ Dataset Format
2424
**************
2525

2626
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/src/otx/algorithms/classification/utils/convert_coco_to_multilabel.py>` to help with conversion.
27+
Specifically, this format should be converted in our `internal representation <https://github.com/openvinotoolkit/training_extensions/tree/develop/tests/assets/datumaro_multilabel>`_ first. We provided a `script <https://github.com/openvinotoolkit/training_extensions/blob/develop/src/otx/algorithms/classification/utils/convert_coco_to_multilabel.py>` to help with conversion.
2828
To convert the COCO data format to our internal one, run this script in similar way:
2929

3030
.. code-block::
@@ -35,6 +35,9 @@ To convert the COCO data format to our internal one, run this script in similar
3535

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

38+
.. note::
39+
For now, "___" is a symbol to distinguish the multi-label format. So, it must be included at the front of the label name.
40+
3841
******
3942
Models
4043
******

src/otx/algorithms/classification/utils/convert_coco_to_multilabel.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ def coco_to_datumaro_multilabel(ann_file_path: str, data_root_dir: str, output:
6161
overall_classes: List = coco_dataset.get_classes()
6262
for class_name in overall_classes:
6363
multilabel_ann_format["categories"]["label"]["label_groups"].append(
64-
{"name": str(class_name), "group_type": "exclusive", "labels": [str(class_name)]}
64+
{"name": f"___{str(class_name)}", "group_type": "exclusive", "labels": [str(class_name)]}
6565
)
6666

6767
multilabel_ann_format["categories"]["label"]["labels"].append(

0 commit comments

Comments
 (0)