Skip to content

Commit ac53cc2

Browse files
authored
docs: add set_class_order_per_task() to the dataset docs
1 parent 5b52a33 commit ac53cc2

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

luxonis_ml/data/datasets/README.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,22 @@ The `push_to_cloud()` method is used to upload a local dataset to the specified
9999
| `update_mode` | `UpdateMode` | `UpdateMode.MISSING` | Whether to always push (overwrite) the dataset’s media folder to the cloud or only upload missing files. |
100100
| `bucket_storage` | `BucketStorage` | Required | The cloud storage destination to which local media files should be uploaded (e.g., GCS, S3, Azure). |
101101

102+
### Setting Class Order per Task
103+
104+
The `set_class_order_per_task()` method allows you to define a specific ordering of classes for one or more tasks, without rewriting the dataset’s metadata.
105+
106+
#### Parameters
107+
108+
| Parameter | Type | Default | Description |
109+
| ---------------------- | ---------------------- | -------- | ------------------------------------------------------------------------------------------------------------ |
110+
| `class_order_per_task` | `dict[str, list[str]]` | Required | Mapping of task names to ordered lists of class names. Class names must exactly match the dataset’s classes. |
111+
112+
#### Persistence & Usage Notes
113+
114+
* **View-only ordering**: This method does *not* rewrite the dataset’s stored metadata (since `rewrite_metadata=False`). Instead, it applies the new class order as a view on the dataset object.
115+
* **New classes**: If new classes are added to the dataset, you must call `set_class_order_per_task()` again to include and order them.
116+
* **Loader initialization**: For `LuxonisLoader`, apply class ordering *before* passing the dataset into the loader to avoid unintended reordering during loader setup.
117+
102118
## In-Depth Explanation of luxonis-ml Dataset Storage
103119

104120
### File Structure

0 commit comments

Comments
 (0)