Skip to content

Conversation

@IgorSusmelj
Copy link
Contributor

Changes

  • add explicit support for datasets that have wrong relative paths in the .yaml file such as
.
├── README.dataset.txt
├── README.roboflow.txt
├── data.yaml
├── test
│   ├── images
│   └── labels
├── train
│   ├── images
│   └── labels
└── valid
    ├── images
    └── labels

10 directories, 3 files

with data.yaml content of:

train: ../train/images
val: ../valid/images
test: ../test/images

nc: 3
names: ['0', '1', '2']

roboflow:
  workspace: ilyes-talbi-ptwsp
  project: futbol-players
  version: 9
  license: Public Domain

How it has been tested

  • new unit tests

@MalteEbner
Copy link
Contributor

Copy link
Contributor

@MalteEbner MalteEbner left a comment

Choose a reason for hiding this comment

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

While this fixes it for the case of roboflow datasets, it makes it fail for cases where the ../ is intended. Are you sure this is what we want?

Suggestion: Handle it the way ultralytics does it.

Copy link
Contributor

@MalteEbner MalteEbner left a comment

Choose a reason for hiding this comment

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

LGTM

return _create_config


class TestYOLOv8BaseInput:
Copy link
Contributor

Choose a reason for hiding this comment

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

Please keep the leading underscore. This makes it easy to find the corresponding test class for every class via STRG-F. The test class should always be named Test{ClassName} while keeping all leading and trailing underscores.
See our style guide: https://www.notion.so/getlightly/Python-testing-78e2dc49baf340178fa44ce20031c52e

Suggested change
class TestYOLOv8BaseInput:
class Test_YOLOv8BaseInput:



class TestYOLOv8BaseInput:
class TestGetCategories:
Copy link
Contributor

Choose a reason for hiding this comment

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

Having a class within a class is something I haven't seen yet. I think it is ok. However, I would have preferred the keeping the usual naming of

test_get_categories_from_dict_format
test_get_categories_from_list_format
test_get_categories_from_yaml_block_format
test_get_categories_invalid_names

That would make the tests shorter and remove the extra class in a class. It would also allow to fin the tests corresponding to a method faster via STRG-F.

Copy link
Contributor

Choose a reason for hiding this comment

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

Same for the other classes within classes

Feel free to resolve.

@IgorSusmelj IgorSusmelj merged commit d2b9af4 into main Mar 12, 2025
2 checks passed
@IgorSusmelj IgorSusmelj deleted the yolov8-parse-roboflow-datasets-is branch March 12, 2025 11:51
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.

3 participants