Skip to content

weired rendering of Apartment_2 #115

Description

@HeliaCheng

Hi, when I render the apartment_2, I got wrong depth map and rgb.

Image Image

I was using the script:
def render_scene(scene_name, scene_file):
output_dir = os.path.join(output_root, scene_name)
os.makedirs(output_dir, exist_ok=True)

sim = make_simulator(scene_file)
agent = sim.get_agent(0)

poses = generate_camera_poses(sim, n_views=N_VIEWS)

print(f"  rendering {scene_name}: {len(poses)} views")

for idx, pose in enumerate(poses):
    transform = mn.Matrix4(np.array(pose).T)  
    agent.scene_node.transformation = transform
    obs = sim.get_sensor_observations()
    if SAVE_RGB:
        rgb_img = obs["color_sensor"]
        rgb_path = os.path.join(output_dir, f"rgb_{idx:03d}.png")
        Image.fromarray(rgb_img[:, :, :3]).save(rgb_path)

    if SAVE_DEPTH:
        depth_img = obs["depth_sensor"]
        depth_vis = (depth_img / np.clip(np.max(depth_img), 1e-6, None) * 255).astype(np.uint8)
        depth_path = os.path.join(output_dir, f"depth_{idx:03d}.png")
        Image.fromarray(depth_vis).save(depth_path)

sim.close()

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions