Skip to content

Commit

Permalink
fix kubric rendering
Browse files Browse the repository at this point in the history
  • Loading branch information
Nishad Gothoskar committed Oct 20, 2023
1 parent 699718f commit f87ca24
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@
logging.basicConfig(level="INFO")

#convert intrinsics to focal_length, sensor_width
focal_length = fx / width
sensor_width = 1
focal_length = float(fx)
sensor_width = float(width)

for scene_number in range(len(poses)):
# --- create scene and attach a renderer to it
Expand Down
8 changes: 6 additions & 2 deletions test/test_kubric.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,11 @@

intrinsics = b.Intrinsics(
rgbd.intrinsics.height, rgbd.intrinsics.width,
rgbd.intrinsics.fx, rgbd.intrinsics.fx,
200.0, 200.0,
rgbd.intrinsics.width/2, rgbd.intrinsics.height/2,
rgbd.intrinsics.near, rgbd.intrinsics.far
)
print(intrinsics)

poses = []
for i in range(len(gt_ids)):
Expand All @@ -50,4 +51,7 @@
kubri_rgb = b.get_rgb_image(rgbds[0].rgb)
kubric_depth = b.get_depth_image(rgbds[0].depth)
rerendered_depth = b.get_depth_image(img[:,:,2])
b.multi_panel([kubri_rgb, kubric_depth, rerendered_depth],labels=["kubric_rgb", "kubric_depth", "rerendered_depth"]).save("test_kubric.png")
overlay = b.overlay_image(kubric_depth, rerendered_depth, alpha=0.5)
b.multi_panel([kubri_rgb, kubric_depth, rerendered_depth, overlay],labels=["kubric_rgb", "kubric_depth", "rerendered_depth", "overlay"]).save("test_kubric.png")

from IPython import embed; embed()

0 comments on commit f87ca24

Please sign in to comment.