Skip to content

Commit 96be71e

Browse files
Update library/src/otx/data/dataset/base.py
Co-authored-by: Copilot <[email protected]>
1 parent 72a904a commit 96be71e

File tree

1 file changed

+7
-1
lines changed
  • library/src/otx/data/dataset

1 file changed

+7
-1
lines changed

library/src/otx/data/dataset/base.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,8 +155,14 @@ def collate_fn(self) -> Callable:
155155

156156
@abc.abstractmethod
157157
def get_idx_list_per_classes(self, use_string_label: bool = False) -> dict[int | str, list[int]]:
158-
"""Get a dictionary with class labels as keys and lists of corresponding sample indices as values."""
158+
"""Get a dictionary mapping class labels to lists of corresponding sample indices.
159159
160+
Args:
161+
use_string_label (bool, optional): If True, use string labels as keys; otherwise, use integer labels. Defaults to False.
162+
163+
Returns:
164+
dict[int | str, list[int]]: A dictionary where each key is a class label (int or str) and each value is a list of sample indices belonging to that class.
165+
"""
160166
@property
161167
def task_type(self) -> OTXTaskType | None:
162168
"""OTX Task Type for the dataset. Can be None if no task is defined."""

0 commit comments

Comments
 (0)