Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 12 additions & 11 deletions luxonis_train/loaders/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,18 @@ The default loader used with `LuxonisTrain`. It can either load data from an alr

**Parameters:**

| Key | Type | Default value | Description |
| --------------------- | --------------------------------------------------------------------------------------------------------- | ------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `dataset_name` | `str` | `None` | Name of the dataset to load. If not provided, the `dataset_dir` must be provided instead |
| `dataset_dir` | `str` | `None` | Path to the directory containing the dataset. If not provided, the `dataset_name` must be provided instead. Can be a path to a local directory or a URL. The data can be in a zip archive. New `LuxonisDataset` will be created using data from this directory and saved under the provided `dataset_name` |
| `dataset_type` | `Literal["coco", "voc", "darknet", "yolov6", "yolov4", "createml", "tfcsv", "clsdir", "segmask"] \| None` | `None` | Type of the dataset. If not provided, the type will be inferred from the directory structure |
| `team_id` | `str \| None` | `None` | Optional unique team identifier for the cloud |
| `bucket_storage` | `Literal["local", "s3", "gcs"]` | `"local"` | Type of the bucket storage |
| `delete_existing` | `bool` | `False` | Whether to delete the existing dataset with the same name. Only relevant if `dataset_dir` is provided. Use if you want to reparse the directory in case the data changed |
| `update_mode` | `Literal["all", "missing"]` | `all` | Select whether to download all remote dataset media files or only those missing locally |
| `min_bbox_visibility` | `float` | `0.0` | Minimum fraction of the original bounding box that must remain visible after augmentation. |
| `bbox_area_threshold` | `float` | `0.0004` | Minimum area threshold for bounding boxes to be considered valid (relative units in [0,1]). Boxes (and their related keypoints) with area below this will be filtered out. |
| Key | Type | Default value | Description |
| ---------------------- | --------------------------------------------------------------------------------------------------------- | ------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `dataset_name` | `str` | `None` | Name of the dataset to load. If not provided, the `dataset_dir` must be provided instead |
| `dataset_dir` | `str` | `None` | Path to the directory containing the dataset. If not provided, the `dataset_name` must be provided instead. Can be a path to a local directory or a URL. The data can be in a zip archive. New `LuxonisDataset` will be created using data from this directory and saved under the provided `dataset_name` |
| `dataset_type` | `Literal["coco", "voc", "darknet", "yolov6", "yolov4", "createml", "tfcsv", "clsdir", "segmask"] \| None` | `None` | Type of the dataset. If not provided, the type will be inferred from the directory structure |
| `team_id` | `str \| None` | `None` | Optional unique team identifier for the cloud |
| `bucket_storage` | `Literal["local", "s3", "gcs"]` | `"local"` | Type of the bucket storage |
| `delete_existing` | `bool` | `False` | Whether to delete the existing dataset with the same name. Only relevant if `dataset_dir` is provided. Use if you want to reparse the directory in case the data changed |
| `update_mode` | `Literal["all", "missing"]` | `all` | Select whether to download all remote dataset media files or only those missing locally |
| `min_bbox_visibility` | `float` | `0.0` | Minimum fraction of the original bounding box that must remain visible after augmentation. |
| `bbox_area_threshold` | `float` | `0.0004` | Minimum area threshold for bounding boxes to be considered valid (relative units in [0,1]). Boxes (and their related keypoints) with area below this will be filtered out. |
| `class_order_per_task` | `dict[str, List[str]] \| None` | `None` | If provided, the classes for the specified tasks will be reordered in the dataset. |

**Data Shape Definitions:**

Expand Down
6 changes: 6 additions & 0 deletions luxonis_train/loaders/luxonis_loader_torch.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ def __init__(
filter_task_names: list[str] | None = None,
min_bbox_visibility: float = 0.0,
bbox_area_threshold: float = 0.0004,
class_order_per_task: dict[str, list[str]] | None = None,
seed: int | None = None,
**kwargs,
):
Expand Down Expand Up @@ -81,6 +82,9 @@ def __init__(
@type bbox_area_threshold: float
@param bbox_area_threshold: Minimum area threshold for bounding boxes to be considered valid. In the range [0, 1].
Default is 0.0004, which corresponds to a small area threshold to remove invalid bboxes and respective keypoints.
@type class_order_per_task: dict[str, list[str]] | None
@param class_order_per_task: Dictionary mapping task names to a list of class names.
If provided, the classes for the specified tasks will be reordered.
@type seed: Optional[int]
@param seed: The random seed to use for the augmentations.
"""
Expand All @@ -100,6 +104,8 @@ def __init__(
bucket_type=bucket_type,
bucket_storage=bucket_storage,
)
if class_order_per_task is not None:
self.dataset.set_class_order_per_task(class_order_per_task)
self.loader = LuxonisLoader(
dataset=self.dataset,
view=self.view,
Expand Down
Loading