Skip to content

Commit bf39a62

Browse files
committed
Show media in the DatasetRecord example
The docstring described file and files, and its example used file. Both names are deprecated, so the example gave a warning. The docstring now describes media and names the deprecated forms.
1 parent bc36b3c commit bf39a62

1 file changed

Lines changed: 9 additions & 7 deletions

File tree

‎luxonis_ml/ldf/annotation.py‎

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2237,14 +2237,16 @@ def number(self, task_name: str, instance_id: int) -> int:
22372237
class DatasetRecord(BaseModelExtraForbid):
22382238
"""Dataset record containing file paths and its annotations.
22392239
2240-
A record is the unit of ingestion for `LuxonisDataset.add`. It may point
2241-
to one media source through ``file`` or to multiple synchronized sources
2242-
through ``files``, but never both -- passing both is an error, where
2243-
``files`` used to be silently discarded in favor of ``file``.
2240+
A record is the unit of ingestion for `LuxonisDataset.add`. Its
2241+
``media`` is one source: a path, an image or an array. For synchronized
2242+
sources, ``media`` maps each source name to its source. ``file`` and
2243+
``files`` are deprecated names of ``media``. A record that gives more
2244+
than one of the three is an error.
22442245
22452246
Annotations are grouped by task name, so one record can carry every
2246-
detection of a sample. The older flat forms still work: a single
2247-
detection, or a list of them, together with a ``task_name``.
2247+
detection of a sample. The older flat forms still work, but they are
2248+
deprecated: a single detection, or a list of them, together with a
2249+
``task_name``.
22482250
22492251
``sample_metadata`` stores **record-level metadata**. It is preserved by
22502252
native import/export and returned by `LuxonisLoader` as
@@ -2265,7 +2267,7 @@ class DatasetRecord(BaseModelExtraForbid):
22652267
.. code-block:: json
22662268
22672269
{
2268-
"file": "images/frame_001.jpg",
2270+
"media": "images/frame_001.jpg",
22692271
22702272
"sample_metadata": {
22712273
"record_id": 123,

0 commit comments

Comments
 (0)