PSI-release icon indicating copy to clipboard operation
PSI-release copied to clipboard

scene_semantics of 'Werkraum'

Open Silverster98 opened this issue 3 years ago • 3 comments

Loading the 'Werkraum_withlabels.ply' with trimesh, I get a Trimesh object whose visual property is a TextureVisuals objects, while other scenes have a ColorVisuals. And I can't get the visual_colors without ColorVisuals. Besides, I tried to use to_color method to covert the TextureVisuals to ColorVisuals, but the converted RGB value of vertices are not correct. Can you provide a correct 'Werkraum_withlabels.ply' file?

Silverster98 avatar Feb 17 '22 08:02 Silverster98

I did not use Trimesh before, so I am not aware of this problem. Can you try other libs, and elaborate your problems? What is wrong with ‘Werkraum_withlabels.py`? The label is wrong, or it is not annotated?

On 17 Feb 2022, at 09:53, Zan Wang @.***> wrote:

Loading the 'Werkraum_withlabels.ply' with trimesh, I get a Trimesh object whose visual property is a TextureVisuals objects, while other scenes have a ColorVisuals. And I can't get the visual_colors without ColorVisuals. Besides, I tried to use to_color https://trimsh.org/trimesh.visual.texture.html#trimesh.visual.texture.TextureVisuals.to_color method to covert the TextureVisuals to ColorVisuals, but the converted RGB value of vertices are not correct. Can you provide a correct 'Werkraum_withlabels.ply' file?

— Reply to this email directly, view it on GitHub https://github.com/yz-cnsdqz/PSI-release/issues/31, or unsubscribe https://github.com/notifications/unsubscribe-auth/AD5BAGAJIKC7L5WOBOQRRJLU3SZQPANCNFSM5OUAHASA. Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub. You are receiving this because you are subscribed to this thread.

yz-cnsdqz avatar Feb 17 '22 09:02 yz-cnsdqz

I did not use Trimesh before, so I am not aware of this problem. Can you try other libs, and elaborate your problems? What is wrong with ‘Werkraum_withlabels.py`? The label is wrong, or it is not annotated? On 17 Feb 2022, at 09:53, Zan Wang @.***> wrote: Loading the 'Werkraum_withlabels.ply' with trimesh, I get a Trimesh object whose visual property is a TextureVisuals objects, while other scenes have a ColorVisuals. And I can't get the visual_colors without ColorVisuals. Besides, I tried to use to_color https://trimsh.org/trimesh.visual.texture.html#trimesh.visual.texture.TextureVisuals.to_color method to covert the TextureVisuals to ColorVisuals, but the converted RGB value of vertices are not correct. Can you provide a correct 'Werkraum_withlabels.ply' file? — Reply to this email directly, view it on GitHub <#31>, or unsubscribe https://github.com/notifications/unsubscribe-auth/AD5BAGAJIKC7L5WOBOQRRJLU3SZQPANCNFSM5OUAHASA. Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub. You are receiving this because you are subscribed to this thread.

When I load other scenes, e.g. MPH16, I can get a correct vertex color (label).

scene = trimesh.load('/Data/PROXE_ExpansionPack/scenes_semantics/MPH16_withlabels.ply', process=False)
print(scene.visual.vertex_colors[1000:1010:, :]) # scene.visual is a ColorVisuals object
"""
the output is:
[[  5   5   5 255]
 [  5   5   5 255]
 [ 35  35  35 255]
 [ 35  35  35 255]
 [ 35  35  35 255]
 [ 35  35  35 255]
 [ 35  35  35 255]
 [ 35  35  35 255]
 [ 35  35  35 255]
 [ 35  35  35 255]]
"""

but when I load Werkraum, the program raise an Exception

Traceback (most recent call last):
  File "visualize.py", line 352, in <module>
    print(scene.visual.vertex_colors[1000:1010:, :])
AttributeError: 'TextureVisuals' object has no attribute 'vertex_colors'

And I tried to use to_color() which can convert textured visuals to a ColorVisuals with vertex color calculated from texture. But the RGB value are not correct.

scene = trimesh.load('/Data/PROXE_ExpansionPack/scenes_semantics/Werkraum_withlabels.ply', process=False)
scene.visual = scene.visual.to_color() # scene.visual is a TextureVisuals object
print(scene.visual.vertex_colors[1000:1010:, :])
print(scene.visual.vertex_colors.min())
"""
the output is:
[[255 255 255 255]
 [255 255 255 255]
 [255 255 255 255]
 [255 255 255 255]
 [255 255 255 255]
 [255 255 255 255]
 [255 255 255 255]
 [255 255 255 255]
 [255 255 255 255]
 [255 255 255 255]]
255
"""

Silverster98 avatar Feb 17 '22 12:02 Silverster98

I will try open3d later..

Silverster98 avatar Feb 17 '22 12:02 Silverster98