Skip to content

Commit 4c96422

Browse files
authored
[Bug] Fix Kinetics format to have media (#1223)
<!-- Contributing guide: https://github.com/openvinotoolkit/datumaro/blob/develop/CONTRIBUTING.md --> ### Summary <!-- 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 --> - [ ] 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 - [ ] 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) 2023 Intel Corporation # # SPDX-License-Identifier: MIT ```
1 parent 76467bc commit 4c96422

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

CHANGELOG.md

+2
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
3333
(<https://github.com/openvinotoolkit/datumaro/pull/1220>)
3434
- Fix broken link to supported formats in readme
3535
(<https://github.com/openvinotoolkit/datumaro/pull/1221>)
36+
- Fix Kinetics data format to have media data
37+
(<https://github.com/openvinotoolkit/datumaro/pull/1223>)
3638

3739
## 16/11/2023 - Release 1.5.1
3840
### Enhancements

src/datumaro/plugins/data_formats/kinetics.py

+7-5
Original file line numberDiff line numberDiff line change
@@ -65,11 +65,13 @@ def _media_files(self, subset):
6565
return self._subset_media_files[subset]
6666

6767
subset_path = self._subset_path(subset)
68-
self._subset_media_files[subset] = {
69-
osp.splitext(osp.basename(f))[0]: osp.join(subset_path, f)
70-
for f in os.listdir(subset_path)
71-
if osp.splitext(osp.basename(f))[1] in VIDEO_EXTENSIONS
72-
}
68+
69+
self._subset_media_files[subset] = {}
70+
for root, _, files in os.walk(subset_path):
71+
for f in files:
72+
key, file_extension = osp.splitext(f)
73+
if file_extension.lstrip(".") in VIDEO_EXTENSIONS:
74+
self._subset_media_files[subset][key] = osp.join(root, f)
7375

7476
return self._subset_media_files[subset]
7577

0 commit comments

Comments
 (0)