python-face-relighting icon indicating copy to clipboard operation
python-face-relighting copied to clipboard

My test results are as shown in the figure. It feels like the value overflows. How can I solve this problem?

Open carfei opened this issue 5 years ago • 5 comments

portrait_o2 portrait_o3 portrait_o4 portrait_o6 My test results are as shown in the figure. It feels like the value overflows. How can I solve this problem?Thanks!

carfei avatar Mar 10 '20 07:03 carfei

portrait_o2 portrait_o3 portrait_o4 portrait_o6 My test results are as shown in the figure. It feels like the value overflows. How can I solve this problem?Thanks!

The relighting algorithm combines (colors, 3d-vertices, normals) as features, you can try to use colors alone as features and check the results, which should works independent of the 3d reconstruction process.

pengbo-learn avatar Mar 11 '20 14:03 pengbo-learn

Thank you for your reply. I have reorganized and calculated the three features of the color, 3d-vertices, and normals separately, but it is still the wrong result before. The error results are the same when there are the color characteristics. I don't understand the code that you put on git to modify those color parameters, which caused me to have such error results. I hope to hear your answer, thank you!

At 2020-03-11 22:16:20, "PengBo" [email protected] wrote:

My test results are as shown in the figure. It feels like the value overflows. How can I solve this problem?Thanks!

The relighting algorithm combines (colors, 3d-vertices, normals) as features, you can try to use colors alone as features and check the results, which should works independent of the 3d reconstruction process.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe.

carfei avatar Mar 12 '20 05:03 carfei

Thank you for your reply. I have reorganized and calculated the three features of the color, 3d-vertices, and normals separately, but it is still the wrong result before. The error results are the same when there are the color characteristics. I don't understand the code that you put on git to modify those color parameters, which caused me to have such error results. I hope to hear your answer, thank you! At 2020-03-11 22:16:20, "PengBo" [email protected] wrote: My test results are as shown in the figure. It feels like the value overflows. How can I solve this problem?Thanks! The relighting algorithm combines (colors, 3d-vertices, normals) as features, you can try to use colors alone as features and check the results, which should works independent of the 3d reconstruction process. — You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe.

"I don't understand the code that you put on git to modify those color parameters, which caused me to have such error results". You could paste the lines of code which is confusing so we can discuss better. The colors are normalized to [0, 1], relighted, constrained to [0, 1], then transformed back to [0, 255].

pengbo-learn avatar Mar 13 '20 03:03 pengbo-learn

This has already been done in the code you provided, and it seems that this is not the cause. out_colors[out_colors < 0] = 0;out_colors[out_colors > 1] = 1;out_colors = (out_colors*255).astype('uint8').

At 2020-03-13 11:30:49, "PengBo" [email protected] wrote:

Thank you for your reply. I have reorganized and calculated the three features of the color, 3d-vertices, and normals separately, but it is still the wrong result before. The error results are the same when there are the color characteristics. I don't understand the code that you put on git to modify those color parameters, which caused me to have such error results. I hope to hear your answer, thank you! At 2020-03-11 22:16:20, "PengBo" [email protected] wrote: My test results are as shown in the figure. It feels like the value overflows. How can I solve this problem?Thanks! The relighting algorithm combines (colors, 3d-vertices, normals) as features, you can try to use colors alone as features and check the results, which should works independent of the 3d reconstruction process. — You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe.

"I don't understand the code that you put on git to modify those color parameters, which caused me to have such error results". You could paste the lines of code which is confusing so we can discuss better. The colors are normalized to [0, 1], relighted, constrained to [0, 1], then transformed back to [0, 255].

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe.

carfei avatar Mar 13 '20 05:03 carfei

Try to change the line out_colors = (out_colors*255).astype('uint8') to out_colors = (out_colors*255).astype('float')

The problem comes from numeric overflow of the 'uint8' data type

fantasy-fish avatar Mar 28 '20 01:03 fantasy-fish