Skip to content

Commit

Permalink
[Bug] Fix Kinetics format to have media (openvinotoolkit#1223)
Browse files Browse the repository at this point in the history
<!-- Contributing guide:
https://github.com/openvinotoolkit/datumaro/blob/develop/CONTRIBUTING.md
-->

### Summary

<!--
Resolves openvinotoolkit#111 and openvinotoolkit#222.
Depends on openvinotoolkit#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 openvinotoolkit#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
```
  • Loading branch information
wonjuleee authored Dec 15, 2023
1 parent 76467bc commit 4c96422
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
(<https://github.com/openvinotoolkit/datumaro/pull/1220>)
- Fix broken link to supported formats in readme
(<https://github.com/openvinotoolkit/datumaro/pull/1221>)
- Fix Kinetics data format to have media data
(<https://github.com/openvinotoolkit/datumaro/pull/1223>)

## 16/11/2023 - Release 1.5.1
### Enhancements
Expand Down
12 changes: 7 additions & 5 deletions src/datumaro/plugins/data_formats/kinetics.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,11 +65,13 @@ def _media_files(self, subset):
return self._subset_media_files[subset]

subset_path = self._subset_path(subset)
self._subset_media_files[subset] = {
osp.splitext(osp.basename(f))[0]: osp.join(subset_path, f)
for f in os.listdir(subset_path)
if osp.splitext(osp.basename(f))[1] in VIDEO_EXTENSIONS
}

self._subset_media_files[subset] = {}
for root, _, files in os.walk(subset_path):
for f in files:
key, file_extension = osp.splitext(f)
if file_extension.lstrip(".") in VIDEO_EXTENSIONS:
self._subset_media_files[subset][key] = osp.join(root, f)

return self._subset_media_files[subset]

Expand Down

0 comments on commit 4c96422

Please sign in to comment.