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

[About align ratio] #10

Closed
CaptainEven opened this issue Jul 16, 2021 · 6 comments
Closed

[About align ratio] #10

CaptainEven opened this issue Jul 16, 2021 · 6 comments

Comments

@CaptainEven
Copy link

CaptainEven commented Jul 16, 2021

What is [align ratio] used for? I'm confused about the align-ratio...
How to set the align ratio in train_HDRUNet.yml if train on custom dataset?

#### datasets
datasets:
  train:
    name: Single_LDR2HDR
    mode: LQGT_condition
    dataroot_LQ: /mnt/diskc/even/Ldr2HdrData/medium_sub
    dataroot_GT: /mnt/diskc/even/Ldr2HdrData/gt_sub
    dataroot_ratio: /data0/NTIRE2021_HDR/000_Train_SingleFrame_FirstStage/alignratio
    use_shuffle: true
    n_workers: 4 #  8
    batch_size: 16
    GT_size: 160
    use_flip: true
    use_rot: true
    condition: image
@chxy95
Copy link
Owner

chxy95 commented Jul 16, 2021

@CaptainEven The alignratio is unique to this dataset provided by the organizer. You should modify the scripts related to data reading to fit your own data.

@CaptainEven
Copy link
Author

@chxy95 Thank you for your reply and explanation!
I'm very interested in your method!
I want to train on my custom dataset(LDR seq and HDR counterpart(generated using MEF methods)),
but i don't know the actual meaning of alignratio in your code.

  1. Could you please explain about alignratio, or how i need to provide the alignratio in the training process?
  2. Can alignratio be excluded from the training process? As far as i know, alignration is not necessary in general Single image HDR reconstruction right?

@chxy95
Copy link
Owner

chxy95 commented Jul 19, 2021

@CaptainEven The alignratio is used to normalize the HDR value into [0, 1], since the value range of the provided HDR is [0, +∞) encoded in uint16 data.

@CaptainEven
Copy link
Author

CaptainEven commented Jul 19, 2021

@chxy95 Thank you for your explanation!A seqence in my custom dataset is composed of 3 LDR jpg format image, and its GT jpg HDR image, how to set the alignratio value, 255 correct?

As far as i know, the provided HDR GT is a png format image, its RGB range in [0-255] right? I don't understand "HDR is [0, +∞) encoded in uint16 data"...

@chxy95
Copy link
Owner

chxy95 commented Jul 19, 2021

@CaptainEven The provided HDR GT is in uint16 png format of range [0-65535]. You can think that the alignratio for SDR images is 255, so values in [0, 255] can be normalized to [0, 1] divided by 255. For the provided HDR, maximum of an HDR image would be set to 65535 for writing, thus the alignratio is equal to 65535 / image.max(). When read, pixel values should be divided by the alignratio to normalize to [0, maximum]. For example, a nomalized HDR image with range in [0, 500] have an alignration with 65535/500. When saved, the image is in range [0, 65535]. When read, the image is divided by the alignratio to normalize to the range [0, 500]. If you still have any problem, you should check the provided dataset and scripts of data-io carefully to better understand the data.

@CaptainEven
Copy link
Author

@chxy95 Thanks for your detailed explanation again! I got it!

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

2 participants