Skip to content

Commit

Permalink
Merge pull request #637 from StanfordVL/remap-seg-instance
Browse files Browse the repository at this point in the history
Instance Segmentation Remapping for Particle Systems
  • Loading branch information
ChengshuLi authored Mar 11, 2024
2 parents 3cd6f1b + 0fa2e8e commit 3830c52
Show file tree
Hide file tree
Showing 24 changed files with 343 additions and 157 deletions.
4 changes: 0 additions & 4 deletions omnigibson/objects/controllable_object.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ def __init__(
name,
prim_path=None,
category="object",
class_id=None,
uuid=None,
scale=None,
visible=True,
Expand All @@ -47,8 +46,6 @@ def __init__(
prim_path (None or str): global path in the stage to this object. If not specified, will automatically be
created at /World/<name>
category (str): Category for the object. Defaults to "object".
class_id (None or int): What class ID the object should be assigned in semantic segmentation rendering mode.
If None, the ID will be inferred from this object's category.
uuid (None or int): Unique unsigned-integer identifier to assign to this object (max 8-numbers).
If None is specified, then it will be auto-generated
scale (None or float or 3-array): if specified, sets either the uniform (float) or x,y,z (3-array) scale
Expand Down Expand Up @@ -96,7 +93,6 @@ def __init__(
prim_path=prim_path,
name=name,
category=category,
class_id=class_id,
uuid=uuid,
scale=scale,
visible=visible,
Expand Down
6 changes: 0 additions & 6 deletions omnigibson/objects/dataset_object.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ def __init__(
prim_path=None,
category="object",
model=None,
class_id=None,
uuid=None,
scale=None,
visible=True,
Expand Down Expand Up @@ -65,9 +64,6 @@ def __init__(
{og_dataset_path}/objects/{category}/{model}/usd/{model}.usd
Otherwise, will randomly sample a model given @category
class_id (None or int): What class ID the object should be assigned in semantic segmentation rendering mode.
If None, the ID will be inferred from this object's category.
uuid (None or int): Unique unsigned-integer identifier to assign to this object (max 8-numbers).
If None is specified, then it will be auto-generated
scale (None or float or 3-array): if specified, sets either the uniform (float) or x,y,z (3-array) scale
Expand Down Expand Up @@ -123,7 +119,6 @@ def __init__(
encrypted=True,
name=name,
category=category,
class_id=class_id,
uuid=uuid,
scale=scale,
visible=visible,
Expand Down Expand Up @@ -447,7 +442,6 @@ def _create_prim_with_same_kwargs(self, prim_path, name, load_config):
prim_path=prim_path,
name=name,
category=self.category,
class_id=self.class_id,
scale=self.scale,
visible=self.visible,
fixed_base=self.fixed_base,
Expand Down
4 changes: 0 additions & 4 deletions omnigibson/objects/light_object.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ def __init__(
light_type,
prim_path=None,
category="light",
class_id=None,
uuid=None,
scale=None,
fixed_base=False,
Expand All @@ -51,8 +50,6 @@ def __init__(
prim_path (None or str): global path in the stage to this object. If not specified, will automatically be
created at /World/<name>
category (str): Category for the object. Defaults to "object".
class_id (None or int): What class ID the object should be assigned in semantic segmentation rendering mode.
If None, the ID will be inferred from this object's category.
uuid (None or int): Unique unsigned-integer identifier to assign to this object (max 8-numbers).
If None is specified, then it will be auto-generated
scale (None or float or 3-array): if specified, sets either the uniform (float) or x,y,z (3-array) scale
Expand Down Expand Up @@ -88,7 +85,6 @@ def __init__(
prim_path=prim_path,
name=name,
category=category,
class_id=class_id,
uuid=uuid,
scale=scale,
visible=True,
Expand Down
8 changes: 0 additions & 8 deletions omnigibson/objects/object_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ def __init__(
name,
prim_path=None,
category="object",
class_id=None,
uuid=None,
scale=None,
visible=True,
Expand All @@ -55,8 +54,6 @@ def __init__(
prim_path (None or str): global path in the stage to this object. If not specified, will automatically be
created at /World/<name>
category (str): Category for the object. Defaults to "object".
class_id (None or int): What class ID the object should be assigned in semantic segmentation rendering mode.
If None, the ID will be inferred from this object's category.
uuid (None or int): Unique unsigned-integer identifier to assign to this object (max 8-numbers).
If None is specified, then it will be auto-generated
scale (None or float or 3-array): if specified, sets either the uniform (float) or x,y,z (3-array) scale
Expand Down Expand Up @@ -86,11 +83,6 @@ def __init__(
self.category = category
self.fixed_base = fixed_base

# Infer class ID if not specified
if class_id is None:
class_id = semantic_class_name_to_id()[category]
self.class_id = class_id

# Values to be created at runtime
self._highlight_cached_values = None
self._highlighted = None
Expand Down
5 changes: 0 additions & 5 deletions omnigibson/objects/primitive_object.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ def __init__(
primitive_type,
prim_path=None,
category="object",
class_id=None,
uuid=None,
scale=None,
visible=True,
Expand All @@ -57,8 +56,6 @@ def __init__(
prim_path (None or str): global path in the stage to this object. If not specified, will automatically be
created at /World/<name>
category (str): Category for the object. Defaults to "object".
class_id (None or int): What class ID the object should be assigned in semantic segmentation rendering mode.
If None, the ID will be inferred from this object's category.
uuid (None or int): Unique unsigned-integer identifier to assign to this object (max 8-numbers).
If None is specified, then it will be auto-generated
scale (None or float or 3-array): if specified, sets either the uniform (float) or x,y,z (3-array) scale
Expand Down Expand Up @@ -108,7 +105,6 @@ def __init__(
prim_path=prim_path,
name=name,
category=category,
class_id=class_id,
uuid=uuid,
scale=scale,
visible=visible,
Expand Down Expand Up @@ -320,7 +316,6 @@ def _create_prim_with_same_kwargs(self, prim_path, name, load_config):
primitive_type=self._primitive_type,
name=name,
category=self.category,
class_id=self.class_id,
scale=self.scale,
visible=self.visible,
fixed_base=self.fixed_base,
Expand Down
4 changes: 0 additions & 4 deletions omnigibson/objects/stateful_object.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ def __init__(
name,
prim_path=None,
category="object",
class_id=None,
uuid=None,
scale=None,
visible=True,
Expand All @@ -72,8 +71,6 @@ def __init__(
prim_path (None or str): global path in the stage to this object. If not specified, will automatically be
created at /World/<name>
category (str): Category for the object. Defaults to "object".
class_id (None or int): What class ID the object should be assigned in semantic segmentation rendering mode.
If None, the ID will be inferred from this object's category.
uuid (None or int): Unique unsigned-integer identifier to assign to this object (max 8-numbers).
If None is specified, then it will be auto-generated
scale (None or float or 3-array): if specified, sets either the uniform (float) or x,y,z (3-array) scale
Expand Down Expand Up @@ -117,7 +114,6 @@ def __init__(
prim_path=prim_path,
name=name,
category=category,
class_id=class_id,
uuid=uuid,
scale=scale,
visible=visible,
Expand Down
5 changes: 0 additions & 5 deletions omnigibson/objects/usd_object.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ def __init__(
encrypted=False,
prim_path=None,
category="object",
class_id=None,
uuid=None,
scale=None,
visible=True,
Expand All @@ -43,8 +42,6 @@ def __init__(
prim_path (None or str): global path in the stage to this object. If not specified, will automatically be
created at /World/<name>
category (str): Category for the object. Defaults to "object".
class_id (None or int): What class ID the object should be assigned in semantic segmentation rendering mode.
If None, the ID will be inferred from this object's category.
uuid (None or int): Unique unsigned-integer identifier to assign to this object (max 8-numbers).
If None is specified, then it will be auto-generated
scale (None or float or 3-array): if specified, sets either the uniform (float) or x,y,z (3-array) scale
Expand Down Expand Up @@ -75,7 +72,6 @@ def __init__(
prim_path=prim_path,
name=name,
category=category,
class_id=class_id,
uuid=uuid,
scale=scale,
visible=visible,
Expand Down Expand Up @@ -118,7 +114,6 @@ def _create_prim_with_same_kwargs(self, prim_path, name, load_config):
usd_path=self._usd_path,
name=name,
category=self.category,
class_id=self.class_id,
scale=self.scale,
visible=self.visible,
fixed_base=self.fixed_base,
Expand Down
2 changes: 0 additions & 2 deletions omnigibson/robots/behavior_robot.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ def __init__(
# Shared kwargs in hierarchy
name,
prim_path=None,
class_id=None,
uuid=None,
scale=None,
visible=True,
Expand Down Expand Up @@ -97,7 +96,6 @@ def __init__(
super(BehaviorRobot, self).__init__(
prim_path=prim_path,
name=name,
class_id=class_id,
uuid=uuid,
scale=scale,
visible=visible,
Expand Down
4 changes: 0 additions & 4 deletions omnigibson/robots/fetch.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ def __init__(
# Shared kwargs in hierarchy
name,
prim_path=None,
class_id=None,
uuid=None,
scale=None,
visible=True,
Expand Down Expand Up @@ -78,8 +77,6 @@ def __init__(
name (str): Name for the object. Names need to be unique per scene
prim_path (None or str): global path in the stage to this object. If not specified, will automatically be
created at /World/<name>
class_id (None or int): What class ID the object should be assigned in semantic segmentation rendering mode.
If None, the ID will be inferred from this object's category.
uuid (None or int): Unique unsigned-integer identifier to assign to this object (max 8-numbers).
If None is specified, then it will be auto-generated
scale (None or float or 3-array): if specified, sets either the uniform (float) or x,y,z (3-array) scale
Expand Down Expand Up @@ -144,7 +141,6 @@ def __init__(
super().__init__(
prim_path=prim_path,
name=name,
class_id=class_id,
uuid=uuid,
scale=scale,
visible=visible,
Expand Down
4 changes: 0 additions & 4 deletions omnigibson/robots/franka.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ def __init__(
# Shared kwargs in hierarchy
name,
prim_path=None,
class_id=None,
uuid=None,
scale=None,
visible=True,
Expand Down Expand Up @@ -50,8 +49,6 @@ def __init__(
name (str): Name for the object. Names need to be unique per scene
prim_path (None or str): global path in the stage to this object. If not specified, will automatically be
created at /World/<name>
class_id (None or int): What class ID the object should be assigned in semantic segmentation rendering mode.
If None, the ID will be inferred from this object's category.
uuid (None or int): Unique unsigned-integer identifier to assign to this object (max 8-numbers).
If None is specified, then it will be auto-generated
scale (None or float or 3-array): if specified, sets either the uniform (float) or x,y,z (3-array) scale
Expand Down Expand Up @@ -98,7 +95,6 @@ def __init__(
super().__init__(
prim_path=prim_path,
name=name,
class_id=class_id,
uuid=uuid,
scale=scale,
visible=visible,
Expand Down
4 changes: 0 additions & 4 deletions omnigibson/robots/franka_allegro.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ def __init__(
# Shared kwargs in hierarchy
name,
prim_path=None,
class_id=None,
uuid=None,
scale=None,
visible=True,
Expand Down Expand Up @@ -50,8 +49,6 @@ def __init__(
name (str): Name for the object. Names need to be unique per scene
prim_path (None or str): global path in the stage to this object. If not specified, will automatically be
created at /World/<name>
class_id (None or int): What class ID the object should be assigned in semantic segmentation rendering mode.
If None, the ID will be inferred from this object's category.
uuid (None or int): Unique unsigned-integer identifier to assign to this object (max 8-numbers).
If None is specified, then it will be auto-generated
scale (None or float or 3-array): if specified, sets either the uniform (float) or x,y,z (3-array) scale
Expand Down Expand Up @@ -99,7 +96,6 @@ def __init__(
super().__init__(
prim_path=prim_path,
name=name,
class_id=class_id,
uuid=uuid,
scale=scale,
visible=visible,
Expand Down
4 changes: 0 additions & 4 deletions omnigibson/robots/franka_leap.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ def __init__(
name,
hand="right",
prim_path=None,
class_id=None,
uuid=None,
scale=None,
visible=True,
Expand Down Expand Up @@ -53,8 +52,6 @@ def __init__(
hand (str): One of {"left", "right"} - which hand to use, default is right
prim_path (None or str): global path in the stage to this object. If not specified, will automatically be
created at /World/<name>
class_id (None or int): What class ID the object should be assigned in semantic segmentation rendering mode.
If None, the ID will be inferred from this object's category.
uuid (None or int): Unique unsigned-integer identifier to assign to this object (max 8-numbers).
If None is specified, then it will be auto-generated
scale (None or float or 3-array): if specified, sets either the uniform (float) or x,y,z (3-array) scale
Expand Down Expand Up @@ -103,7 +100,6 @@ def __init__(
super().__init__(
prim_path=prim_path,
name=name,
class_id=class_id,
uuid=uuid,
scale=scale,
visible=visible,
Expand Down
4 changes: 0 additions & 4 deletions omnigibson/robots/manipulation_robot.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@ def __init__(
# Shared kwargs in hierarchy
name,
prim_path=None,
class_id=None,
uuid=None,
scale=None,
visible=True,
Expand Down Expand Up @@ -99,8 +98,6 @@ def __init__(
name (str): Name for the object. Names need to be unique per scene
prim_path (None or str): global path in the stage to this object. If not specified, will automatically be
created at /World/<name>
class_id (None or int): What class ID the object should be assigned in semantic segmentation rendering mode.
If None, the ID will be inferred from this object's category.
uuid (None or int): Unique unsigned-integer identifier to assign to this object (max 8-numbers).
If None is specified, then it will be auto-generated
scale (None or float or 3-array): if specified, sets either the uniform (float) or x,y,z (3-array) scale
Expand Down Expand Up @@ -171,7 +168,6 @@ def __init__(
super().__init__(
prim_path=prim_path,
name=name,
class_id=class_id,
uuid=uuid,
scale=scale,
visible=visible,
Expand Down
4 changes: 0 additions & 4 deletions omnigibson/robots/robot_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ def __init__(
# Shared kwargs in hierarchy
name,
prim_path=None,
class_id=None,
uuid=None,
scale=None,
visible=True,
Expand Down Expand Up @@ -69,8 +68,6 @@ def __init__(
name (str): Name for the object. Names need to be unique per scene
prim_path (None or str): global path in the stage to this object. If not specified, will automatically be
created at /World/<name>
class_id (None or int): What class ID the object should be assigned in semantic segmentation rendering mode.
If None, the ID will be inferred from this object's category.
uuid (None or int): Unique unsigned-integer identifier to assign to this object (max 8-numbers).
If None is specified, then it will be auto-generated
scale (None or float or 3-array): if specified, sets either the uniform (float) or x,y,z (3-array) scale
Expand Down Expand Up @@ -135,7 +132,6 @@ def __init__(
usd_path=self.usd_path,
name=name,
category=m.ROBOT_CATEGORY,
class_id=class_id,
uuid=uuid,
scale=scale,
visible=visible,
Expand Down
4 changes: 0 additions & 4 deletions omnigibson/robots/tiago.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ def __init__(
# Shared kwargs in hierarchy
name,
prim_path=None,
class_id=None,
uuid=None,
scale=None,
visible=True,
Expand Down Expand Up @@ -92,8 +91,6 @@ def __init__(
prim_path (None or str): global path in the stage to this object. If not specified, will automatically be
created at /World/<name>
category (str): Category for the object. Defaults to "object".
class_id (None or int): What class ID the object should be assigned in semantic segmentation rendering mode.
If None, the ID will be inferred from this object's category.
uuid (None or int): Unique unsigned-integer identifier to assign to this object (max 8-numbers).
If None is specified, then it will be auto-generated
scale (None or float or 3-array): if specified, sets either the uniform (float) or x,y,z (3-array) scale
Expand Down Expand Up @@ -165,7 +162,6 @@ def __init__(
super().__init__(
prim_path=prim_path,
name=name,
class_id=class_id,
uuid=uuid,
scale=scale,
visible=visible,
Expand Down
Loading

0 comments on commit 3830c52

Please sign in to comment.