habitat-lab icon indicating copy to clipboard operation
habitat-lab copied to clipboard

what is the relationship between xxx.semantic.txt and xxx.semantic.glb?

Open zuixiaosanlang opened this issue 1 year ago • 10 comments

i get a rgb image from xxx.semantic.glb image and the floor RGB=(33, 185, 0)

but i cannot find a close color in xxx.semantic.txt about floor.

my code: image

image

zuixiaosanlang avatar Aug 24 '23 02:08 zuixiaosanlang

Hey @zuixiaosanlang I believe your understanding is correct. The hex color in the text file should map to the color of the painted texture region in the .glb asset. We render a flat shaded image of that texture.

If you can provide the specific scene name here we can take a closer look.

aclegg3 avatar Aug 24 '23 14:08 aclegg3

Hi @zuixiaosanlang ~~The GLAQ4DNUx5U.semantic.txt semantic text file should contain 907 entries, but it seems the file you are reading in only has 23. GLAQ4DNUx5U.semantic.txt~~

Actually, the color you are seeing, (33, 185, 0), maps to 0x21B900 which does not seem to be present in that semantic txt file. This bears further investigation. Thank you for bringing this to our attention.

jturner65 avatar Aug 24 '23 14:08 jturner65

When I launch the scene in habitat using a pinhole camera, I get the semantic mapping for the floor to be 339_floor, which is color 0x87E719/ rgb : 135, 231, 35. How are you getting the color query result for the floor?

viewer_00861_GLAQ4DNUx5U

jturner65 avatar Aug 24 '23 15:08 jturner65

@jturner65 Hi, 0x87E719 should be rgb : 135, 231, 25. 0x19=1*16+9=25

use MeshLab tool to compare: image

image

image

the floor color in your picture should be rgb(62, 204, 2), hex: 0x3ecc02

zuixiaosanlang avatar Aug 25 '23 01:08 zuixiaosanlang

Hi @aclegg3 00861-GLAQ4DNUx5U

also you can check other scene, for example 00006-HkseAnWCgqk. it is the same problem.

If it's my fault, please correct me. thanks.

zuixiaosanlang avatar Aug 28 '23 01:08 zuixiaosanlang

@jturner65 Hi, 0x87E719 should be rgb : 135, 231, 25. 0x19=1*16+9=25

Yes, that was a typo on my part, apologies, and thank you for correcting it.

Please let me know what mechanism you are using to query the color in your original post, so that as I attempt to figure out any potential issues I can follow the same pathway you did.

Thank you!

jturner65 avatar Aug 28 '23 17:08 jturner65

@jturner65 Hi, i create tensor: image

get rgb image from xxx.semantic.glb: image

save rgb image: image

then i check the floor color in rgb image, compared whith xxx.semantic.txt.

zuixiaosanlang avatar Aug 31 '23 01:08 zuixiaosanlang

Are you setting up the sensor as a semantic sensor?

jturner65 avatar Aug 31 '23 21:08 jturner65

Hi, @jturner65 if i set sensor as a semantic sensor, i got all zeros. image

then next line run failed batch = batch_obs([observations])

image

image

zuixiaosanlang avatar Sep 04 '23 07:09 zuixiaosanlang

@jturner65 i run the code and cannot get the semantic label.

https://aihabitat.org/docs/habitat-sim/image-extractor.html image

image

and my env: image

thanks.

zuixiaosanlang avatar Sep 04 '23 08:09 zuixiaosanlang