Skip to content

Albumentations-Pipeline is applied to BGR not to RGB #8641

@UnglvKitDe

Description

@UnglvKitDe

Search before asking

  • I have searched the YOLOv5 issues and found no similar bug report.

YOLOv5 Component

No response

Bug

As written here in step 3, Albumentations internally uses the RGB format and not the BGR format of opencv. However, the data is currently passed internally as BGR:

yolov5/utils/dataloaders.py

Lines 626 to 628 in 92e47b8

# Albumentations
img, labels = self.albumentations(img, labels)
nl = len(labels) # update after albumentations

img = img.transpose((2, 0, 1))[::-1] # HWC to CHW, BGR to RGB

Or am I missing something?

Environment

YOLOv5 torch 1.11 (cuda 11.3) and 1.12 (cuda 11.6)

Minimal Reproducible Example

No response

Additional

No response

Are you willing to submit a PR?

  • Yes I'd like to help by submitting a PR!

Metadata

Metadata

Assignees

No one assigned

    Labels

    TODOHigh priority itemsbugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions