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

[Feature] Added RGB DP baseline and DrawTriangle/SVG task #876

Merged
merged 21 commits into from
Feb 25, 2025
Merged
Prev Previous commit
Next Next commit
Update flatten.py
StoneT2000 committed Feb 25, 2025
commit 06c8546a980b114a63cc71301c9f0dc2a362b7e0
7 changes: 4 additions & 3 deletions mani_skill/utils/wrappers/flatten.py
Original file line number Diff line number Diff line change
@@ -19,11 +19,12 @@ class FlattenRGBDObservationWrapper(gym.ObservationWrapper):
rgb (bool): Whether to include rgb images in the observation
depth (bool): Whether to include depth images in the observation
state (bool): Whether to include state data in the observation
sep_depth (bool): Whether to separate depth and rgb images in the observation. Default is True.
Note that the returned observations will have a "rgbd" or "rgb" or "depth" key depending on the rgb/depth bool flags.
"""

def __init__(self, env, rgb=True, depth=True, state=True, sep_depth=False) -> None:
def __init__(self, env, rgb=True, depth=True, state=True, sep_depth=True) -> None:
self.base_env: BaseEnv = env.unwrapped
super().__init__(env)
self.include_rgb = rgb
@@ -55,8 +56,8 @@ def observation(self, observation: Dict):
ret["rgb"] = images
elif self.include_rgb and self.include_depth:
if self.sep_depth:
ret["rgb"] = images[...,:-1]
ret["depth"] = images[...,-1:]
ret["rgb"] = images[..., :-1]
ret["depth"] = images[..., -1:]
else:
ret["rgbd"] = images
elif self.include_depth and not self.include_rgb: