Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add label groups for hierarchical classification in ImageNet (#1645)
<!-- Contributing guide: https://github.com/openvinotoolkit/datumaro/blob/develop/CONTRIBUTING.md --> ### Summary This PR adds grouping of labels (directories for the ImageNet case) by their groups (parent directories). For example, for the following folder structure ``` . ├── label_1 │ └── label_1_1 │ └── 1.jpg └── label_2 └── label_2_1 └── 2.jpg ``` label groups will be `label_1` and `label_2`. **Note**: for the higher depth of nesting, names of groups will be relative paths of second-to-last directories. For the following case: ``` . ├── label_1 │ └── label_1_1 │ └── label_1_1_1 │ └── 1.jpg │ └── label_2 └── label_2_1 └── label_2_1_1 └── 2.jpg ``` label groups will be `label_1/label_1_1` and `label_2/label_2_1`. <!-- Resolves #111 and #222. Depends on #1000 (for series of dependent commits). This PR introduces this capability to make the project better in this and that. - Added this feature - Removed that feature - Fixed the problem #1234 --> ### How to test <!-- Describe the testing procedure for reviewers, if changes are not fully covered by unit tests or manual testing can be complicated. --> ### Checklist <!-- Put an 'x' in all the boxes that apply --> - [x] I have added unit tests to cover my changes. - [ ] I have added integration tests to cover my changes. - [x] I have added the description of my changes into [CHANGELOG](https://github.com/openvinotoolkit/datumaro/blob/develop/CHANGELOG.md). - [ ] I have updated the [documentation](https://github.com/openvinotoolkit/datumaro/tree/develop/docs) accordingly ### License - [x] I submit _my code changes_ under the same [MIT License](https://github.com/openvinotoolkit/datumaro/blob/develop/LICENSE) that covers the project. Feel free to contact the maintainers if that's a concern. - [ ] I have updated the license header for each file (see an example below). ```python # Copyright (C) 2024 Intel Corporation # # SPDX-License-Identifier: MIT ``` --------- Signed-off-by: Ilya Trushkin <[email protected]>
- Loading branch information