ARM-software / sesr

Super-Efficient Super Resolution
Apache License 2.0
89 stars 15 forks source link

Creating RGB image #10

Closed MuhammetAkcann closed 2 years ago

MuhammetAkcann commented 2 years ago

The model takes only the y channel of the input image and outputs only the y channel. How can we generate rgb images from the model.

kbhardwa commented 2 years ago

There are several codes out there that can help convert a y-cb-cr based image into rgb. One example is given here. Essentially, for testing pipeline, when we initially convert an image into y-channel, we also compute the cb and cr (chroma) channels of the low resolution image. The cb and cr are upscaled using simple nearest neighbor interpolation (this is a standard practice). Then the concatenated y-cb-cr are converted back into rgb (where y is coming from SR). The above repo has the necessary rgb to y-cb-cr conversion functions (check under helper -> utility.py). Please note that you may (or may not) need to divide or multiply by 255 depending on whether the functions in above repo expect the image to be between [0, 1] or [0, 255]. Also, see image alignment functions in the above repo in order to avoid pixel shifts, etc.

We will try to release our eval pipeline that creates full RGB images but it is not currently planned.