openvinotoolkit / datumaro

Dataset Management Framework, a Python library and a CLI tool to build, analyze and manage Computer Vision datasets.
https://openvinotoolkit.github.io/datumaro/
MIT License
502 stars 125 forks source link

Documentation API do not mention `label` property for `dm.Bbox` class #1555

Open irmo322 opened 1 week ago

irmo322 commented 1 week ago

Hi,

The documentation shows an example of Bbox instantiation in https://openvinotoolkit.github.io/datumaro/latest/docs/get-started/quick-start-guide/examples.html

import numpy as np
import datumaro as dm

dataset = dm.Dataset.from_iterable([
  dm.DatasetItem(id='image1', subset='train',
    media=dm.Image.from_numpy(data=np.ones((5, 5, 3))),
    annotations=[
      dm.Bbox(1, 2, 3, 4, label=0),
    ]
  ),
  # ...
], categories=['cat', 'dog'])
dataset.export('test_dataset/', 'coco')

What is weird is that there is no mention of the label property in API reference https://openvinotoolkit.github.io/datumaro/latest/docs/reference/_autosummary/datumaro.components.annotation.html#datumaro.components.annotation.Bbox

Without the previous example, there is no way to learn in documentation that Bbox has a label. This is quite confusing for me.

By reading the source code, I see that label is defined in _Shape (parent of BBox), which is not documented.

I suggest to add _Shape properties in Bbox API documentation.