FBCNN icon indicating copy to clipboard operation
FBCNN copied to clipboard

Image tile and output 16 bit depth png

Open Lee-lithium opened this issue 2 years ago • 3 comments

Hello @jiaxi-jiang, Sorry to bother you,

I plan apply FBCNN for my non-photo content jpeg(2d drawing),
but I have some question about tool implement,
could you teach me about those question?

  1. I have some large jpeg(4441x6213) want apply FBCNN,
    but I don't have enough RAM to process this image,
    probably can implement tile function for FBCNN?

I find a split_imageset function in FBCNN utils_image.py,
I try to invoke this function,
but I haven't find a good method to implement split and merge function.

  1. I notice FBCNN output is 8 bit depth png, probably implement output(input) 16 bit depth png function, can get better result?

Thank you produce this amazing tool. :)

Lee-lithium avatar Apr 25 '22 19:04 Lee-lithium

Hello, thanks for your interest in our work!

  1. The function you mentioned is mainly used for generating small patches for fast training. For testing large images, please try to utilize the function test_split from utils_model.py: https://github.com/jiaxi-jiang/FBCNN/blob/main/utils/utils_model.py#L214

  2. For fair comparisons, we follow the convention of prior work to use 8 bit depth image for training and testing. Intuitively training with 16 bit depth images should be better for testing 16 bit depth images, but I think not necessary for testing 8 bit depth images. We can discuss more if you are interested in this part.

Feel free to ask me if you still have questions.

jiaxi-jiang avatar Apr 25 '22 20:04 jiaxi-jiang

Thank you for your reply :)

I notice other denoiser tile implement will affect inference process,
and sometime have visible merge border issue, could you teach me how to avoid those issue?

About 16 bit depth png output, I noitce can use single2uint16 implement, but not too much quality change.

img_E = util.single2uint16(img_E)

About 8 bit depth jpeg convert 16 bit depth input, still need convert to uint8, otherwise I will get a error output, I still work in progress on this part.

img = cv2.imread(path, -1) # 16 bit dpeth img = np.uint8(img) # to uint8

I plan implement input jpeg decode to uint16 and convert to float32 tensor,
result float32 convert uint16, and output png 16 bit depth,
maybe use high precision and reduce precision loss can let result better.

Lee-lithium avatar Apr 26 '22 15:04 Lee-lithium

Hello, thanks for your interest in our work!

  1. The function you mentioned is mainly used for generating small patches for fast training. For testing large images, please try to utilize the function test_split from utils_model.py: https://github.com/jiaxi-jiang/FBCNN/blob/main/utils/utils_model.py#L214
  2. For fair comparisons, we follow the convention of prior work to use 8 bit depth image for training and testing. Intuitively training with 16 bit depth images should be better for testing 16 bit depth images, but I think not necessary for testing 8 bit depth images. We can discuss more if you are interested in this part.

Feel free to ask me if you still have questions.

I just want to estimate QF of image. So can I just randomly crop a piece of image instead whole image? If it is possible what crop size is recommended? Using multiple random crop and calculate average QF will help?

eeyrw avatar May 01 '23 03:05 eeyrw