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

does the imgs with _t.png is the final reslut ? #1

Open
zhangyunming opened this issue Jun 1, 2021 · 11 comments
Open

does the imgs with _t.png is the final reslut ? #1

zhangyunming opened this issue Jun 1, 2021 · 11 comments

Comments

@zhangyunming
Copy link

as said: The test results will be saved to ./results/testset_name.

does the imgs with _t.png is the final reslut ?

@chxy95
Copy link
Owner

chxy95 commented Jun 1, 2021

as said: The test results will be saved to ./results/testset_name.

does the imgs with _t.png is the final reslut ?

I cannot understand your question, but the test result of an image should be a reconstructed image with a align ratio encoded in a .npy file. The naming rules of this repo comply with the requirements of the NTIRE competition: example: for an input single image with filename ["0003_medium.png"] the output file should be ["0003.png", "0003_alignratio.npy"]. If you have any question about the naming relus or you want to change the rules, you can check the file ./codes/test.py of line 57-58 and modify the related functions in ./codes/utils/util.py.

@chxy95
Copy link
Owner

chxy95 commented Jun 1, 2021

@zhangyunming
It looks weird...
The HDR results need to be processed by tone-mapping for visualization.
Nonetheless, you'd better use the dataset provided by the competition organizer for validation.
Otherwise, you may get strange results due to the large difference in data distribution.

@zhangyunming
Copy link
Author

indeed , it looks weird,

the hdr result is get by :
捕获

any problem?

it is myown data.

@chxy95
Copy link
Owner

chxy95 commented Jun 1, 2021

@zhangyunming The code of visualization is for the competition data. It requires the Ground Truth to calculate parameters of the tone-mapping algorithm. You may use the tanh function to make an approximate visualization for your own data.

img = io.imread_uint16_png(img_path, alignratio_path)
img = np.clip(np.tanh(img), 0, 1) * 255
img = img.round().astype(np.uint8)
cv2.imwrite(save_path, cv2.cvtColor(img, cv2.COLOR_RGB2BGR))

@zhangyunming
Copy link
Author

use your code and the hdr result is all balck

@zhangyunming
Copy link
Author

for own data:
企业微信截图_16225481606061
(115)ev-
(115)ev-hdr

@chxy95
Copy link
Owner

chxy95 commented Jun 1, 2021

use your code and the hdr result is all balck

I edited the code and you can check it again. (forgot to multiply by 255.)

@zhangyunming
Copy link
Author

zhangyunming commented Jun 1, 2021

actually , i have *255, but the result still black , the pix is ~3-5, so is black.
i use the code :

hdr_image = io.imread_uint16_png('F:\zym_AI_tests\HDRUNet\codes\imgs\(121)ev-.jpg', 'F:\zym_AI_tests\HDRUNet\results\1\1\(121_alignratio.npy')
hdr_linear_image = hdr_image ** 3.8
norm_perc = np.percentile(hdr_linear_image, 99)

hdr_image = (m.tanh_norm_mu_tonemap(hdr_linear_image, norm_perc) * 255.).round().astype(np.uint8)
cv2.imshow("hdr_demo", cv2.cvtColor(hdr_image, cv2.COLOR_RGB2BGR))
cv2.imwrite('F:\zym_AI_tests\HDRUNet\codes\imgs\(121)ev-hdr.png', cv2.cvtColor(hdr_image, cv2.COLOR_RGB2BGR))
cv2.waitKey(0)

and the result above seems correct.

@chxy95
Copy link
Owner

chxy95 commented Jun 1, 2021

2.24 in hdr_linear_image = hdr_image ** 2.24 is the Gamma value, so it is unreasonable to change it into 3.8.
norm_perc is the key parameters calculated using the Ground Truth, and it's fine to change this value for a good view.

@zhangyunming
Copy link
Author

strange, i use your code:

img = io.imread_uint16_png('F:\zym_AI_tests\HDRUNet\codes\imgs\(121)ev-.jpg', 'F:\zym_AI_tests\HDRUNet\results\1\1\(121_alignratio.npy')
img = np.clip(np.tanh(img), 0, 1) * 255
img = img.round().astype(np.uint8)
cv2.imshow("hdr", cv2.cvtColor(img, cv2.COLOR_RGB2BGR))
print(img)
#cv2.imwrite(save_path, cv2.cvtColor(img, cv2.COLOR_RGB2BGR))
cv2.waitKey(0)

still black! print(img)
[0 0 1]
[0 0 0]
...
[3 3 3]
[3 3 3]
[3 3 3]]

...

[[1 1 1]
[1 1 1]
[1 1 1]
...
[1 1 1]
[1 1 1]
[1 1 1]]

[[1 1 1]
[1 1 1]
[1 1 1]
...
[1 1 1]
[1 1 1]
[1 1 1]]

[[1 1 1]
[1 1 1]
[1 1 1]
...
[1 1 1]
[1 1 1]
[1 1 1]]]

@chxy95
Copy link
Owner

chxy95 commented Jun 1, 2021

You can send the input image and the corresponding reconstructed image with the align ratio to this e-mail [email protected]. I will check it in my free time.

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