hmr2.0 icon indicating copy to clipboard operation
hmr2.0 copied to clipboard

Why does my results different from you?

Open STRUGGLE1999 opened this issue 2 years ago • 8 comments

Hello,your project really interested me,and thank you for you work.But I have a question that I have successfully executed the demo.py,but I just got different result about the picture of 3D Mesh Overlay.

图片

Look ,the background of third picture is black,but your picture is not the same as mine,why?

STRUGGLE1999 avatar Jul 22 '22 04:07 STRUGGLE1999

Hello,your project really interested me,and thank you for you work.But I have a question that I have successfully executed the demo.py,but I just got different result about the picture of 3D Mesh Overlay.

图片

Look ,the background of third picture is black,but your picture is not the same as mine,why?

I've met the same question. You may try this at trimesh_renderer.py

 # alpha_mesh = image[:, :, 3] / 255.0
 binary_image = cv2.cvtColor(image, cv2.COLOR_RGB2GRAY)
 alpha_mesh = binary_image[:, :] / 255.0
 alpha_mesh = (np.array(alpha_mesh) != 0).astype(np.uint8)

It will distinguish the mesh from the original image, so it will be correct when composing them together.

fmx789 avatar Jul 26 '22 10:07 fmx789

Hello,your project really interested me,and thank you for you work.But I have a question that I have successfully executed the demo.py,but I just got different result about the picture of 3D Mesh Overlay. 图片 Look ,the background of third picture is black,but your picture is not the same as mine,why?

I've met the same question. You may try this at trimesh_renderer.py

 # alpha_mesh = image[:, :, 3] / 255.0
 binary_image = cv2.cvtColor(image, cv2.COLOR_RGB2GRAY)
 alpha_mesh = binary_image[:, :] / 255.0
 alpha_mesh = (np.array(alpha_mesh) != 0).astype(np.uint8)

It will distinguish the mesh from the original image, so it will be correct when composing them together.

Hi,is this correct according to your method?In function def call()? 图片

STRUGGLE1999 avatar Jul 26 '22 11:07 STRUGGLE1999

Hello,your project really interested me,and thank you for you work.But I have a question that I have successfully executed the demo.py,but I just got different result about the picture of 3D Mesh Overlay. 图片 Look ,the background of third picture is black,but your picture is not the same as mine,why?

I've met the same question. You may try this at trimesh_renderer.py

 # alpha_mesh = image[:, :, 3] / 255.0
 binary_image = cv2.cvtColor(image, cv2.COLOR_RGB2GRAY)
 alpha_mesh = binary_image[:, :] / 255.0
 alpha_mesh = (np.array(alpha_mesh) != 0).astype(np.uint8)

It will distinguish the mesh from the original image, so it will be correct when composing them together.

Hi,is this correct according to your method?In function def call()? 图片

Nope, it should be written like this:

if img is not None:
    img = cv2.cvtColor(img, cv2.COLOR_RGB2RGBA)
    x1, x2 = 0, img.shape[1]
    y1, y2 = 0, img.shape[0]

    # alpha_mesh = image[:, :, 3] / 255.0
    binary_image = cv2.cvtColor(image, cv2.COLOR_RGB2GRAY)
    alpha_mesh = binary_image[:, :] / 255.0
    alpha_mesh = (np.array(alpha_mesh) != 0).astype(np.uint8)
    alpha_image = 1.0 - alpha_mesh

fmx789 avatar Jul 26 '22 11:07 fmx789

Hello,your project really interested me,and thank you for you work.But I have a question that I have successfully executed the demo.py,but I just got different result about the picture of 3D Mesh Overlay. 图片 Look ,the background of third picture is black,but your picture is not the same as mine,why?

I've met the same question. You may try this at trimesh_renderer.py

 # alpha_mesh = image[:, :, 3] / 255.0
 binary_image = cv2.cvtColor(image, cv2.COLOR_RGB2GRAY)
 alpha_mesh = binary_image[:, :] / 255.0
 alpha_mesh = (np.array(alpha_mesh) != 0).astype(np.uint8)

It will distinguish the mesh from the original image, so it will be correct when composing them together.

Hi,is this correct according to your method?In function def call()? 图片

Nope, it should be written like this:

if img is not None:
    img = cv2.cvtColor(img, cv2.COLOR_RGB2RGBA)
    x1, x2 = 0, img.shape[1]
    y1, y2 = 0, img.shape[0]

    # alpha_mesh = image[:, :, 3] / 255.0
    binary_image = cv2.cvtColor(image, cv2.COLOR_RGB2GRAY)
    alpha_mesh = binary_image[:, :] / 255.0
    alpha_mesh = (np.array(alpha_mesh) != 0).astype(np.uint8)
    alpha_image = 1.0 - alpha_mesh

Yes, you are right, thank you very much, I have got correct picture, thanks again!

STRUGGLE1999 avatar Jul 26 '22 12:07 STRUGGLE1999

how you guys can run this code ? I have error when I run demo.py code

TharHtetAungg avatar May 17 '23 14:05 TharHtetAungg

how you guys can run this code ? I have error when I run demo.py code

ME TOO

zoeyhaiyan1 avatar May 28 '23 07:05 zoeyhaiyan1

how you guys can run this code ? I have error when I run demo.py code

ME TOO

I have run the demo successfully in this experiment, and I share approach in CSDN, maybe you can visit https://blog.csdn.net/qq_45257495/article/details/125944038

STRUGGLE1999 avatar Jun 01 '23 01:06 STRUGGLE1999

how you guys can run this code ? I have error when I run demo.py code

I have run the demo in this experiment, and I share approach in CSDN, maybe you can visit https://blog.csdn.net/qq_45257495/article/details/125944038

STRUGGLE1999 avatar Jun 01 '23 01:06 STRUGGLE1999