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

Alternate renderer with changing shapes #52

Open
wants to merge 28 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
b447008
c2f notebook
Feb 4, 2024
ec3368c
c2f
Feb 5, 2024
208a68d
WTF
nishadgothoskar Feb 16, 2024
5e02aa4
Merge pull request #51 from probcomp/debug_with_eric
esli999 Feb 16, 2024
73aa401
Successfully rendering many images. but ignorning the actual poses
nishadgothoskar Feb 13, 2024
b26ec4b
working
nishadgothoskar Feb 13, 2024
cbd341e
Projection matrix is through
nishadgothoskar Feb 13, 2024
c4e36a2
interpolation
nishadgothoskar Feb 14, 2024
1dae43a
bug where rendering 5 images and rendering 1 produces different results
nishadgothoskar Feb 14, 2024
7903766
stupid bug fixed
nishadgothoskar Feb 14, 2024
0e749db
update test
nishadgothoskar Feb 14, 2024
3c20e2e
larger than 2048 poses done
nishadgothoskar Feb 15, 2024
6bf3608
interpolate working in test
nishadgothoskar Feb 15, 2024
40872a1
multiobject rendering working
nishadgothoskar Feb 15, 2024
65951de
multiobejct seems to be working
nishadgothoskar Feb 16, 2024
c80b897
Intergers output
nishadgothoskar Feb 16, 2024
1e0aab4
fix rendering
nishadgothoskar Feb 17, 2024
34eba7c
fwd fixed
nishadgothoskar Feb 17, 2024
be74feb
save but bwd not working
nishadgothoskar Feb 17, 2024
fb7e53a
gradient seem to be working
nishadgothoskar Feb 17, 2024
65b5d6f
savE
nishadgothoskar Feb 19, 2024
5b049e2
pytorch stop gradients shows that we need rasterize gradients
nishadgothoskar Feb 19, 2024
f5fa82b
Bring back old renderer
nishadgothoskar Feb 20, 2024
6af03fb
renderer
nishadgothoskar Feb 20, 2024
fb2fa5b
save
nishadgothoskar Feb 20, 2024
fa1effb
save
nishadgothoskar Feb 20, 2024
269e40f
cleanup
nishadgothoskar Feb 20, 2024
7e6eb70
revert
nishadgothoskar Feb 20, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 7 additions & 6 deletions bayes3d/genjax/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
from genjax.incremental import Diff, NoChange, UnknownChange

import bayes3d as b
import bayes3d.scene_graph

from .genjax_distributions import (
contact_params_uniform,
Expand Down Expand Up @@ -127,14 +128,14 @@ def get_far_plane(trace):


def add_object(trace, key, obj_id, parent, face_parent, face_child):
N = b.get_indices(trace).shape[0] + 1
N = get_indices(trace).shape[0] + 1
choices = trace.get_choices()
choices[f"parent_{N-1}"] = parent
choices[f"id_{N-1}"] = obj_id
choices[f"face_parent_{N-1}"] = face_parent
choices[f"face_child_{N-1}"] = face_child
choices[f"contact_params_{N-1}"] = jnp.zeros(3)
return model.importance(key, choices, (jnp.arange(N), *trace.get_args()[1:]))[1]
return model.importance(key, choices, (jnp.arange(N), *trace.get_args()[1:]))[0]


add_object_jit = jax.jit(add_object)
Expand All @@ -151,7 +152,7 @@ def print_trace(trace):


def viz_trace_meshcat(trace, colors=None):
b.clear()
b.clear_visualizer()
b.show_cloud(
"1", b.apply_transform_jit(trace["image"].reshape(-1, 3), trace["camera_pose"])
)
Expand Down Expand Up @@ -223,14 +224,14 @@ def enumerator(trace, key, *args):
key,
chm_builder(addresses, args, chm_args),
argdiff_f(trace),
)[2]
)[0]

def enumerator_with_weight(trace, key, *args):
return trace.update(
key,
chm_builder(addresses, args, chm_args),
argdiff_f(trace),
)[1:3]
)[0:2]

def enumerator_score(trace, key, *args):
return enumerator(trace, key, *args).get_score()
Expand Down Expand Up @@ -301,4 +302,4 @@ def update_address(trace, key, address, value):
key,
genjax.choice_map({address: value}),
tuple(map(lambda v: Diff(v, UnknownChange), trace.args)),
)[2]
)[0]
Loading
Loading