mbzuai-metaverse / VOODOO3D-official

Official implementation for the paper "VOODOO 3D: Volumetric Portrait Disentanglement for One-Shot 3D Head Reenactment"
https://p0lyfish.github.io/voodoo3d
MIT License
119 stars 4 forks source link

Explicitly passing `rgb2bgr=False` needed? #9

Open yakhyo opened 2 weeks ago

yakhyo commented 2 weeks ago

Thanks for your work, I noticed while running test_voodoo3d.py with default configs the generated output is in BGR format.

https://github.com/mbzuai-metaverse/VOODOO3D-official/blob/89dd2bea888e91ed7e62bac8d0a53c927b071f92/test_voodoo3d.py#L109-L112

To resolve this, the code needs to be changed to following, adding rgb2bgr=True param ->

out_hr = tensor2img(out['image'], rgb2bgr=False, min_max=(-1, 1))

source_img = tensor2img(source_data['image'][0], rgb2bgr=False, min_max=(-1, 1))
driver_img = tensor2img(driver_data['image'][0], rgb2bgr=False, min_max=(-1, 1))
P0lyFish commented 2 weeks ago

It's depend on what are you going to do with the output. In my sample code, I saved the images using cv2 which requires BGR order format.

yakhyo commented 2 weeks ago

Well, below you can see the difference. Or is it intended behavior?

With default model output: image

Adding rgb2bgr=False to tensor2img function: image

JZArray commented 2 weeks ago

It's depend on what are you going to do with the output. In my sample code, I saved the images using cv2 which requires BGR order format.

@P0lyFish Could you release codes for MegaPortraits? I have opened one issue to ask this question, why you ignore it? You said you would release these codes in another issue.