stepjam / RLBench

A large-scale benchmark and learning environment.
https://sites.google.com/corp/view/rlbench
Other
1.16k stars 235 forks source link

Segmentation Mask Labels #72

Closed bycn closed 4 years ago

bycn commented 4 years ago

Is there a way to recover the actual name of the class from the segmentation mask? In the case that an object is occluded completely in the scene, there's no way to identify the labels anymore.

stepjam commented 4 years ago

You can get the CoppeliaSim object handles. With that, you can access the object if you wish, and then consequently access the 'name' of that object. For example:

# Here we tell rlbench to return the mask on the form of object handles 
# (rather than a tytpical segmentation mask)
observation_config.left_shoulder_cam.masks_as_one_channel = False
# ... now give the config to rlbench ...
# ... get observation ...
object_handle = left_shoulder_mask.mymask[0, 0]  # Get top right handle

from pyrep.objects.object import Object
object_name = Object.get_object_name(object_handle)