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

Enhance classification task's model performance #2749

Merged
merged 8 commits into from
Jan 3, 2024

Conversation

vinnamkim
Copy link
Contributor

@vinnamkim vinnamkim commented Dec 26, 2023

Summary

  1. Memory caching

    • Fix the bug that the memory cache handler tries to resize and cache an image although there is no space on its memory pool.
    • Fix the bug that multiprocessing.Manager can be shutdown not in the main thread (dataloader's worker thread).
    • Reuse the resized image during caching
  2. Change image decoder from OpenCV to PIL

    • Change the default image color channel format as RGB and remove the BGR to RGB color channel format conversion in the data preprocessor.
  3. Set pin_memory=True in DataLoader.

  4. Utilize a stacked tensor for a batch of images rather than a list of individual images.

    • This approach is necessary to eliminate the need for stacking image tensors in the main thread.

  • This is the performance comparison according to this PR
    image

How to test

I updated our unit tests related to this change and the integration tests must guard the correct training pipeline.

Checklist

  • I have added unit tests to cover my changes.​
  • I have added integration tests to cover my changes.​
  • I have added e2e tests for validation.
  • I have added the description of my changes into CHANGELOG in my target branch (e.g., CHANGELOG in develop).​
  • I have updated the documentation in my target branch accordingly (e.g., documentation in develop).
  • I have linked related issues.

License

  • I submit my code changes under the same Apache 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) 2023 Intel Corporation
# SPDX-License-Identifier: Apache-2.0

Signed-off-by: Kim, Vinnam <vinnam.kim@intel.com>
Signed-off-by: Kim, Vinnam <vinnam.kim@intel.com>
Signed-off-by: Kim, Vinnam <vinnam.kim@intel.com>
Signed-off-by: Kim, Vinnam <vinnam.kim@intel.com>
@github-actions github-actions bot added TEST Any changes in tests OTX 2.0 labels Dec 26, 2023
- Correctly shutdown Memcaching instance for consecutive train function calls

Signed-off-by: Kim, Vinnam <vinnam.kim@intel.com>
@vinnamkim vinnamkim marked this pull request as ready for review December 26, 2023 07:24
harimkang
harimkang previously approved these changes Dec 26, 2023
Copy link
Contributor

@harimkang harimkang left a comment

Choose a reason for hiding this comment

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

LGTM

sungmanc
sungmanc previously approved these changes Dec 26, 2023
@vinnamkim vinnamkim dismissed stale reviews from sungmanc and harimkang via 70582d9 January 2, 2024 09:22
@vinnamkim
Copy link
Contributor Author

vinnamkim commented Jan 2, 2024

@vinnamkim vinnamkim marked this pull request as draft January 2, 2024 09:51
Signed-off-by: Kim, Vinnam <vinnam.kim@intel.com>
@vinnamkim vinnamkim marked this pull request as ready for review January 2, 2024 11:06
Signed-off-by: Kim, Vinnam <vinnam.kim@intel.com>
@vinnamkim vinnamkim merged commit 2300245 into openvinotoolkit:v2 Jan 3, 2024
7 checks passed
@vinnamkim vinnamkim deleted the enhance/perf-classification branch January 3, 2024 07:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
TEST Any changes in tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants