question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Reorder channel layer for smooth native RGB - BGR

See original GitHub issue

Here’s why we have that policy:.

Keras developers respond to issues. We want to focus on work that benefits the whole community, e.g., fixing bugs and adding features. Support only helps individuals. GitHub also notifies thousands of people when issues are filed. We want them to see you communicating an interesting problem, rather than being redirected to Stack Overflow.

System information.

  • TensorFlow version (you are using): 2.7
  • Are you willing to contribute it (Yes/No): Yes

Describe the feature and the current behavior/state.

The feature is a tf.keras layer to let us reorder the channels of a specific dimension on during the feedforward operation without having to rely on custom implementation. This would be nice to finetune and deploy models with RGB and BGR without having to change the software that calls the TF Serving API.

Will this change the current api? How?

rgb2bgr_layer = tf.keras.layers.ReorderChannel(axis=-1, order[2, 1, 0])

Who will benefit from this feature? Everyone who wants to try and deploy different models without changing the software that calls the TF Serving API.

Contributing

  • Do you want to contribute a PR? (yes/no): yes
  • If yes, please read this page for instructions
  • Briefly describe your candidate solution(if contributing): Create a ReorderChannel layer that receives parameters as “axis” and order. It will reorder the channels of the axis according to the axis. Simple as that.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
LukeWoodcommented, Dec 8, 2021

Let’s move this conversation to keras-cv: https://github.com/keras-team/keras-cv/issues/20 @piEsposito

1reaction
piEspositocommented, Dec 3, 2021

@old-school-kid you are welcome. Thank you for giving me the opportunity to make that clear.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Reorder channel layer for smooth native RGB - BGR · Issue #20
I think reorder channels would have a more general purpose, so we could build that and on top of that the rgb to...
Read more >
Is there any reason for changing the channels order of an ...
Specifically, if a neural network was trained in BGR ordering, if you loaded in images in RGB format then the reversal of the...
Read more >
Basic Image Processing In Python - Part 1 | Codementor
imread loads image as RGB (or RGBA), but OpenCV assumes the image to be BGR or BGRA (BGR is the default OpenCV colour...
Read more >
GStreamer Plugin Details - NVIDIA Documentation Center
The low-level library (libnvds_infer) operates on any of INT8 RGB, BGR, or GRAY data with ... Specifies the data type and order for...
Read more >
Example: Rearrange Channels using an Expression
When we open the resulting Rearranged channels image, we see it uses RGB data channel ordering, showing the characteristically otherworldly tones of RGB...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found