pytorch3d icon indicating copy to clipboard operation
pytorch3d copied to clipboard

sphere_tracing doesn't support batched?

Open WeedsInML opened this issue 3 years ago • 1 comments

❓ Questions on how to use PyTorch3D

I want to use SignedDistanceFunctionRenderer to render sdf things. When it runs in sphere_tracing(), curr_start_points' dim is [B*N, 3]. But for my SDF fun, points' dim should be [B, N, 3]. Am I doing something wrong? The following is how I used it: sdf_warpper = ImplicitFunctionWrapper(self.dec) sdf_warpper.bound_args = extra_args ray_tracer = RayTracing() sdfrender = SignedDistanceFunctionRenderer() sdfrender.ray_tracer = ray_tracer raysampler_training = MonteCarloRaysampler( min_x = -1.0, max_x = 1.0, min_y = -1.0, max_y = 1.0, n_rays_per_image=750, n_pts_per_ray=128, min_depth=0.1, max_depth=volume_extent_world, ) ray_bundle = raysampler_training(cameras) render_output = sdfrender(ray_bundle=ray_bundle, implicit_functions=[sdf_warpper], evaluation_mode=EvaluationMode.TRAINING, object_mask=batch['obj_mask'])

WeedsInML avatar Sep 16 '22 16:09 WeedsInML

Hi @WeedsInML! Have you managed to render a SDF? I have been trying a lot but with no success, I can't find any documentation on it and I'm really confused. Could you maybe share some more of your code? Thank you

I figured it out!

cajoek avatar Sep 19 '22 16:09 cajoek

I think it doesn't support batching and this is unlikely to be changed by us soon.

bottler avatar Dec 22 '22 13:12 bottler

@cajoek Hi, do you maybe have a working example of the script for rendering SDF?

anticdimi avatar Jun 01 '23 14:06 anticdimi