Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

support for yolo dataset loading and saving #86

Merged
merged 11 commits into from
May 9, 2023

Conversation

SkalskiP
Copy link
Collaborator

@SkalskiP SkalskiP commented May 7, 2023

Description

YOLO Dataset loader is designed to be as flexible as possible to allow data consistency for both mixed and non-mixed datasets. You can test API in this example notebook.

  • box dataset

download - 2023-05-08T143022 501

  • mask dataset

download - 2023-05-08T143026 472

  • non-mixed datasets

download (100)

API

  • To load a consistent YOLO dataset. Only boxes or boxes and polygons.
dataset = sv.Dataset.from_yolo(
    images_directory_path=f"{dataset.location}/train/images",
    annotations_directory_path=f"{dataset.location}/train/labels",
    data_yaml_path=f"{dataset.location}/data.yaml",
    force_masks=False
)
  • Force consistent mask loading from mixed-label YOLO dataset.
dataset = sv.Dataset.from_yolo(
    images_directory_path=f"{dataset.location}/train/images",
    annotations_directory_path=f"{dataset.location}/train/labels",
    data_yaml_path=f"{dataset.location}/data.yaml",
    force_masks=True
)

@SkalskiP SkalskiP requested a review from Jacobsolawetz May 8, 2023 19:40
@SkalskiP SkalskiP self-assigned this May 9, 2023
@SkalskiP SkalskiP merged commit eaf5b7e into main May 9, 2023
>>> project = rf.workspace(WORKSPACE_ID).project(PROJECT_ID)
>>> dataset = project.version(PROJECT_VERSION).download("voc")

>>> train_dataset = sv.Dataset.from_yolo(

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔥 splits are separate sv Datasets?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah. You load every split as a separate sv.Dataset but that is pretty much the standard approach. Torch Datasets and Dataloaders work the same way. But I think we will build some utils to split and merge datasets to.

@SkalskiP SkalskiP deleted the feature/support_yolo_dataset_loading branch August 8, 2023 09:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants