Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Object_id to semantic_id mapping in ###_semantic.ply file of matterport #760

Closed
Singh-sid930 opened this issue Aug 22, 2020 · 7 comments
Closed

Comments

@Singh-sid930
Copy link

Singh-sid930 commented Aug 22, 2020

❓ Questions and Help

Hi,
I am looking to extract the semantic ids of each of the entire scenes. So far I see that there are object_ids and associated vertices in the _semantic.ply files for each scene.
Is there a mapping from the object_ids to the semantic (label) ids I can use?
Or am I just not looking in the right file to extract the semantic labels?

I am looking to create a top down semantic map of the scene that the robot move in at any given simulation.

Edit:

I went through this demo
https://aihabitat.org/docs/habitat-api/habitat-api-demo.html#scene-semantic-annotations

and I believe that gets me closer to the solution.

I am a little confused about what the dimensions represent.

  1. The centers are in world coordinates I believe?
  2. Are the dimensions (sizes) cubical dimensions from the center? I see some values of the dimensions are negative.

A coordinate level semantic information would be preferable which takes me back to the first question itself, about the coordinate object_id to semantic_id mapping.

@erikwijmans
Copy link
Contributor

This issue may be helpful for creating the mapping from object ID to label ID: #263

TLDR:

instance_id_to_label_id = {int(obj.id.split("_")[-1]): obj.category.index() for obj in sim.semantic_scene.objects}

@Singh-sid930
Copy link
Author

I have gone through that issue and I can see that the information for the labels and the associated centeroid coordinates and dimensions can be extracted.
Can you shed some light on the dimensions that are being extracted?
This to be exact.

dims:{obj.aabb.sizes}

Are these cubical semantic masks?

@erikwijmans
Copy link
Contributor

I am not sure what a "cubical semantic mask" is, but here is what those are:

Each object has an associated 3D bounding box (an oriented bounding box in the case of objects). obj.aabb is then the axis aligned bounding box containing the OBB.
obj.aabb.sizes are the lengths of the sides of the bounding box.
obj.aabb.center is the center of the bounding box.

These are in Habitat's coordinate frame, which is different then the coordinate frame of the mp3d dataset. The mp3d dataset is +Z up while habitat is +Y up.

@Singh-sid930
Copy link
Author

Thanks! I ended up working with the raw MP3d ply files and using the mapping that you suggested.

@Singh-sid930
Copy link
Author

Singh-sid930 commented Sep 10, 2020

Couple of questions:

  1. During the conversion of the instance id's to label id's it seems like there are a bunch of -1 label id's. Do these signify the un-classified but detected objects?
  2. Is the world coordinate frame of matter port 3d (raw data from .ply files) and the habitat sim aligned? if not, do we have the information of the transform between them? I understand that mp3d is -z gravity and habitat sim is -y gravity. is there any other difference?

@erikwijmans
Copy link
Contributor

My understanding is that -1 is misc/unlabeled and these are generally not "objects". Note that we did not collect the Matterport3D dataset, so that may be wrong. You can read more about it here: https://niessner.github.io/Matterport/

Yes, that is the only difference between the two coordinate frames.

@Singh-sid930
Copy link
Author

Thanks! I will try to make a pull request for extracting the scene semantic map(groundtruth) if I have the bandwidth. I have it working at my end.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants