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

Bug during RGB converting in data pipeline #2584

Closed
wonjuleee opened this issue Oct 30, 2023 · 4 comments
Closed

Bug during RGB converting in data pipeline #2584

wonjuleee opened this issue Oct 30, 2023 · 4 comments
Labels
BUG Something isn't working

Comments

@wonjuleee
Copy link
Contributor

wonjuleee commented Oct 30, 2023

Describe the bug

When creating Image from datumato media, the media has been already converted to RGB as described in both cases

  1. Image from path:
    return cv2.cvtColor(cv2.imread(self.__file_path), cv2.COLOR_BGR2RGB)
  2. Image from data:
    return cv2.cvtColor(data, cv2.COLOR_BGR2RGB)

But this has been again converted to RGB in data pipeline, for instances, in classification tasks:

__img_norm_cfg = dict(mean=[123.675, 116.28, 103.53], std=[58.395, 57.12, 57.375], to_rgb=True)

As a result, there are some performance drop with current data pipelines..

to_rgb True (as-is) False (to-be)
CIFAR100 (#2500 training data) Acc: 0.423 / E2E time: 120.16 sec Acc: 0.473 / E2E time: 159.17 sec
CUB200 (#1200 training data) Acc: 0.615 / E2E time: 41.27 sec Acc: 0.680 / E2E time: 41.92 sec

Steps to Reproduce

  1. Turn to_rgb=False
  2. Do experiments

Environment:

  • OS: Ubuntu 20.04
  • Framework version: PyTorch 2.0
  • Python version: Python 3.10
  • OpenVINO version:
  • CUDA/cuDNN version: 11.7
  • GPU model and memory: RTX3090
@wonjuleee wonjuleee added the BUG Something isn't working label Oct 30, 2023
@sovrasov
Copy link
Contributor

If datumaro image is the only source of images in OTX train, we have to make similar changes in all our components. As far as I understand, this change won't affect pytorch models, so we don't have to change OV-related things.

@sungmanc
Copy link
Contributor

Thanks for the reporting, I attached the reason of this issue and made a PR for that.

@goodsong81
Copy link
Contributor

@sungmanc Can we close this issue by #2585 ?

@sungmanc
Copy link
Contributor

sungmanc commented Nov 1, 2023

@sungmanc Can we close this issue by #2585 ?

Ah, thanks.

@sungmanc sungmanc closed this as completed Nov 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
BUG Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants