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

Image tile and output 16 bit depth png #12

Open
Lee-lithium opened this issue Apr 25, 2022 · 3 comments
Open

Image tile and output 16 bit depth png #12

Lee-lithium opened this issue Apr 25, 2022 · 3 comments

Comments

@Lee-lithium
Copy link

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. :)

@jiaxi-jiang
Copy link
Owner

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.

@Lee-lithium
Copy link
Author

Lee-lithium commented Apr 26, 2022

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.

@eeyrw
Copy link

eeyrw commented May 1, 2023

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?

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

3 participants