Open jasminsehic opened 5 months ago
Hi @jasminsehic, during the validation step, there's no need to extract 'S'. You can simply comment out the code related to 'S' during the validation process.
Feel free to contact me if there remains any questions.
Thank you @mdyao
I commented out the code related to S
and got a bit further.
I have the following testdata
files I downloaded from your Google Drive
When I run python test.py -opt options/test/test.yml
I get the following error.
Is it possible I have configured something wrong in the test.yml or maybe something wrong with testdata?
24-03-27 20:54:19.219 - INFO: Random seed: 10
24-03-27 20:54:19.413 - INFO: Dataset [JSHDataset - SIDD] is created.
24-03-27 20:54:19.413 - INFO: Number of train images: 39,840, iters: 4,980
24-03-27 20:54:19.413 - INFO: Total epochs needed: 121 for iters 600,000
24-03-27 20:54:19.417 - INFO: Dataset [JSHDataset - SIDD_val] is created.
24-03-27 20:54:19.417 - INFO: Number of val images in [SIDD_val]: 28
24-03-27 20:54:19.735 - INFO: Loading model for G [./model.pth] ...
24-03-27 20:54:19.970 - INFO: Model [InvHDR_Model] is created.
24-03-27 20:54:19.970 - INFO: Start training from epoch: 0, iter: 0
Traceback (most recent call last):
File "C:\Users\Andrea\Development\HDR-BiTNet\test.py", line 229, in <module>
main()
File "C:\Users\Andrea\Development\HDR-BiTNet\test.py", line 217, in main
curr_psnr = compute_psnr(HDR_pred_ori, HDR_img_ori, 1023)
File "C:\Users\Andrea\Development\HDR-BiTNet\test.py", line 76, in compute_psnr
mse = np.mean(np.square(img_orig - img_out))
ValueError: operands could not be broadcast together with shapes (3,7680,4320) (3,3840,2160)
Here is my test.yml
#### general settings
name: InvHDR_ResUnit_test
use_tb_logger: False
model: InvHDR
scale: 2
gpu_ids: [0]
#### datasets
datasets:
train:
name: SIDD
mode: JSH_train
dataroot_HDR: './train/HDR_youtube_80.mat' # path to training Clean images
dataroot_SDR: './train/SDR_youtube_80.mat' # path to training Noisy images
use_shuffle: true
n_workers: 8 # per GPU
batch_size: 8
use_flip: true
use_rot: true
val:
name: SIDD_val
mode: JSH_val
dataroot_SDR: './testdata/testset_SDR.mat' # path to validation Clean images
dataroot_HDR: './testdata/testset_HDR.mat' # path to validation Noisy images
#### network structures
network_G:
which_model_G:
subnet_type: Resnet
subnet_type_sgt: AFF
in_nc: 3
out_nc: 3
block_num: [8, 8]
scale: 2
#### path
path:
root:
pretrain_model_G: './model.pth'
strict_load: true
resume_state: ~
#### training settings: learning rate scheme, loss
train:
lr_G: !!float 1e-4
beta1: 0.9
beta2: 0.999
niter: 600000
warmup_iter: -1 # no warm up
lr_scheme: MultiStepLR
lr_steps: [50000, 100000, 150000, 200000, 500000]
lr_gamma: 0.5
pixel_criterion_forw: l2
pixel_criterion_back: l1
manual_seed: 10
val_freq: !!float 2000
vgg16_model:
lambda_fit_forw: 10
lambda_vgg_forw: 0.
lambda_structure_forw: 1
lambda_orth_forw: 1
lambda_rec_back: 1
lambda_structure_back: 1
lambda_orth_back: 1
weight_decay_G: !!float 1e-8
gradient_clipping: 10
#### logger
logger:
print_freq: 1
save_checkpoint_freq: !!float 5000
Hi @jasminsehic.
Based on the error message from the code, it seems that the resolution of img_orig
is twice that of 4K, while img_out
is at 4K resolution.
My code aims to convert LR-SDR
to HR-HDR
(or vice versa), thus involving changes in resolution.
The expected input-output scenario should be as follows:
LR-SDR
to HR-HDR
, the network's input should be one frame of LR-SDR
, and the output should be one frame of HR-HDR
.HR-HDR
to LR-SDR
, the network's input should be one frame of HR-HDR
, and the output should be one frame of LR-SDR
.HR-HDR
to HR-HDR
,the network's input should be one frame of HR-HDR
, and the output should be one frame of HR-HDR
.Currently, I'm not convenient to run the code. Could you please help verify the resolutions of the ''input frame'', img_orig
, and img_out
?
I think the solution is concealed within the resolution.
Thank you!
hello! I checked the shape of these data, and found that in the get_current_visuals, the shape of self.fake.H is already (3,7680,4320), which causes the shape of the later HDR_pred to also change, which is inconsistent with the shape of the HDR_img_ori (3, 3840, 2160), how to solve this? Could this be a problem with net_G structure?
Hello, thank you for your repository!
I am having trouble executing the test, I was hoping you could provide some guidance @mdyao ?
I got as far as modifying this line to load the SDR file but I then get the following error below. Do you have any advice what I am doing wrong?