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

Add channel_dims argument to CombineChannels/SplitChannels #99

Open
johnnychen94 opened this issue Aug 14, 2021 · 0 comments
Open

Add channel_dims argument to CombineChannels/SplitChannels #99

johnnychen94 opened this issue Aug 14, 2021 · 0 comments

Comments

@johnnychen94
Copy link
Collaborator

johnnychen94 commented Aug 14, 2021

Internally, CombineChannels uses ImageCore.colorview to do the work, which requires the data layout to be CHW. When deal with deep learning frameworks, it's often the case that we need to handle HWC/WHC layout.

Previously, CombineChannels(RGB) interpret rand(3, 4, 4) as a 4x4 RGB image and errors for rand(4, 4, 3). And SplitChannels() unconditionally interpret rand(RGB, 4, 4) as 3x4x4 numerical array.

So the idea is to let CombineChannels(RGB, 3) interpret rand(4, 4, 3) as a 4x4 RGB image, and to let SplitChannels(3) interpret rand(RGB, 4, 4) as 4x4x3 numerical array.

Edit: When I opened this issue I didn't realize that PermuteDims is also an Augmentor operation; there are two very similar names in Base permutedims and PermutedDimsArray. PermuteDims is no doubt more generic than channel_dims argument proposed here. Thus this proposal is only to make things more convenient for a very specific usage; it doesn't fill any missing functionalities.

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

No branches or pull requests

1 participant