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

Mergeback 1.7.0 to develop #1538

Merged
merged 9 commits into from
Jun 19, 2024
Merged

Conversation

yunchu
Copy link
Contributor

@yunchu yunchu commented Jun 19, 2024

Summary

How to test

Checklist

  • I have added unit tests to cover my changes.​
  • I have added integration tests to cover my changes.​
  • I have added the description of my changes into CHANGELOG.​
  • I have updated the documentation accordingly

License

  • I submit my code changes under the same MIT 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).
# Copyright (C) 2024 Intel Corporation
#
# SPDX-License-Identifier: MIT

yunchu and others added 9 commits May 9, 2024 11:30
…notoolkit#1491)

<!-- Contributing guide:
https://github.com/openvinotoolkit/datumaro/blob/develop/CONTRIBUTING.md
-->

### Summary
Enabled support for 'Video' media type in the datumaro format to support
annotations by video or video range.
Note that the video has a closed interval of [start_frame, end_frame].

<!--
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 -->
- [x] I have added unit tests to cover my changes.​
- [x] 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).​
- [x] 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.
- [x] I have updated the license header for each file (see an example
below).

```python
# Copyright (C) 2024 Intel Corporation
#
# SPDX-License-Identifier: MIT
```
…oolkit#1501)

### Summary

- Ticket no. 141409
- There was a significant performance degradation on `decode_by_pil()`
if `ImageColorChannel.COLOR_BGR`.
- Improve it by returning a numpy array rather than `PIL.Image` and
using `cv2.cvtColor()` rather than `np.flip()`.

### How to test

- `tests/unit/test_image.py` covers this change.
- Compare performance with this code (dataset: Imagenette2)

| before | after |
| :-: | :-: |
|
![image](https://github.com/openvinotoolkit/datumaro/assets/26541465/3fd115b0-26b3-4a71-b058-0153cea96b98)
|
![image](https://github.com/openvinotoolkit/datumaro/assets/26541465/cb32adb6-cc70-4aef-9ab4-a47b862f1947)
|
| 00:51<00:00, 361.65it/s | 00:19<00:00, 859.39it/s |


### 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

- [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.
- [x] 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: Kim, Vinnam <vinnam.kim@intel.com>
…ing use case (openvinotoolkit#1503)

### Summary

- Ticket no. 141410
- Datumaro has been maintaining every mask as a binary mask
representation. This is because of flexibility on manipulating dataset
level management (e.g., label remapping). However, this design can bring
performance degradation in case of model training use case. For example,
semantic segmentation model training uses 2d mask filled in an integer
value for each pixel. However, during importing a dataset, Datumaro
should convert it to a collection of binary masks. It makes impossible
to use the integer mask directly, so that it requires a 2d complexity
computation cost to merge the imported binary masks into an integer
mask.
- To resolve this performance degradation, this PR introduces a new
interface on `dataset_item.annotations` by introducing
`Annotation(list[Annotation])` class. This class extends the pure Python
list to equip more utility functions. At the same time, the utility
function we introduce this time is
`dataset_item.annotations.get_semantic_seg_mask()`. This function
bypasses binary mask conversion to construct an integer mask used for
semantic segmentation model training.

### How to test
- Added unit tests to cover this change (mainly in
`tests/unit/test_annotation.py`).
- This is a performance test on the semantic segmentation model training
use case. Throughput improvement on getting a semantic segmentation mask
is ~3x (31.38 it/s -> 99.31 it/s).

![image](https://github.com/openvinotoolkit/datumaro/assets/26541465/df082285-6a67-4444-9331-63ec43b0a03b)

### 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.
- [x] 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: Kim, Vinnam <vinnam.kim@intel.com>
…lkit#1507)

<!-- Contributing guide:
https://github.com/openvinotoolkit/datumaro/blob/develop/CONTRIBUTING.md
-->

### Summary


![image](https://github.com/openvinotoolkit/datumaro/assets/89109581/dfaf5ac6-1876-4904-814e-21bf32c6f27e)

about 25 times faster computation compared to previous RLE mask based
area computation

<!--
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 -->
- [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

- [ ] 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
```
<!-- Contributing guide:
https://github.com/openvinotoolkit/datumaro/blob/develop/CONTRIBUTING.md
-->

### Summary

For the 100K generation of Polygon annotations, the time consumption was
1.69 secs to 1.46 secs (about 15% faster).

import_from | coco
-- | --
before | 34.77 s
after | 31.53 s


![image](https://github.com/openvinotoolkit/datumaro/assets/89109581/5c840092-f87d-458d-bc41-b2b3f015112c)


### 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.​
- [ ] 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) 2024 Intel Corporation
#
# SPDX-License-Identifier: MIT
```
@yunchu yunchu requested review from a team as code owners June 19, 2024 01:56
@yunchu yunchu requested review from wonjuleee and removed request for a team June 19, 2024 01:56
Copy link

codecov bot commented Jun 19, 2024

Codecov Report

Attention: Patch coverage is 86.17021% with 26 lines in your changes missing coverage. Please review.

Project coverage is 81.06%. Comparing base (44cc56a) to head (4e31e07).
Report is 73 commits behind head on develop.

Files Patch % Lines
src/datumaro/components/media.py 85.93% 4 Missing and 5 partials ⚠️
src/datumaro/components/annotation.py 78.94% 5 Missing and 3 partials ⚠️
src/datumaro/plugins/data_formats/datumaro/base.py 75.00% 4 Missing and 2 partials ⚠️
...umaro/plugins/data_formats/datumaro_binary/base.py 33.33% 1 Missing and 1 partial ⚠️
...datumaro/plugins/data_formats/datumaro/exporter.py 92.85% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #1538      +/-   ##
===========================================
+ Coverage    80.85%   81.06%   +0.20%     
===========================================
  Files          271      276       +5     
  Lines        30689    32359    +1670     
  Branches      6197     6575     +378     
===========================================
+ Hits         24815    26231    +1416     
- Misses        4489     4684     +195     
- Partials      1385     1444      +59     
Flag Coverage Δ
ubuntu-20.04_Python-3.10 81.05% <86.17%> (+0.20%) ⬆️
windows-2022_Python-3.10 81.03% <86.17%> (+0.20%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@yunchu yunchu merged commit d72d589 into openvinotoolkit:develop Jun 19, 2024
8 checks passed
@yunchu yunchu deleted the mergeback/1.7.0 branch June 19, 2024 04:11
@yunchu yunchu restored the mergeback/1.7.0 branch June 19, 2024 04:13
yunchu added a commit that referenced this pull request Jun 19, 2024
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.

4 participants