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

Epipolar #114

Open
wants to merge 14 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
7 changes: 4 additions & 3 deletions demo.py
Original file line number Diff line number Diff line change
@@ -1,17 +1,18 @@
#!/usr/bin/env python
import os

import b3d
import b3d.bayes3d as bayes3d
import fire
import genjax
import jax
import jax.numpy as jnp
import numpy as np
import rerun as rr
from b3d import Pose
from tqdm import tqdm

import b3d
import b3d.bayes3d as bayes3d
from b3d import Pose


def test_demo():
rr.init("demo")
Expand Down
3 changes: 2 additions & 1 deletion demos/detector_segmenter.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import io
import os

import b3d
import jax
import jax.numpy as jnp
import numpy
Expand All @@ -19,6 +18,8 @@
)
from transformers.models.detr.feature_extraction_detr import rgb_to_id

import b3d

processor = OwlViTProcessor.from_pretrained("google/owlvit-base-patch32")
model = OwlViTForObjectDetection.from_pretrained("google/owlvit-base-patch32")

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,12 @@
import functools
import os

import b3d
import jax
import jax.numpy as jnp
import numpy as np
import rerun as rr

import b3d
from b3d import Pose

rr.init("gradients")
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
import os
from functools import partial

import b3d
import b3d.chisight.dense.differentiable_renderer as rendering
import jax
import jax.numpy as jnp
import optax
import rerun as rr
from b3d import Mesh, Pose
from tqdm import tqdm

import b3d
import b3d.chisight.dense.differentiable_renderer as rendering
from b3d import Mesh, Pose

rr.init("gradients")
rr.connect("127.0.0.1:8812")

Expand Down
7 changes: 4 additions & 3 deletions demos/differentiable_renderer/gradients_for_mug.py
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
import os
from functools import partial

import b3d
import b3d.chisight.dense.differentiable_renderer as rendering
import jax
import jax.numpy as jnp
import optax
import rerun as rr
import trimesh
from b3d import Pose
from tqdm import tqdm

import b3d
import b3d.chisight.dense.differentiable_renderer as rendering
from b3d import Pose

rr.init("gradients")
rr.connect("127.0.0.1:8812")

Expand Down
5 changes: 3 additions & 2 deletions demos/differentiable_renderer/patch_tracking/demo_utils.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
import os

import b3d
import b3d.utils as utils
import jax
import jax.numpy as jnp
import trimesh

import b3d
import b3d.utils as utils
from b3d import Pose

### Utils ###
Expand Down
6 changes: 3 additions & 3 deletions demos/differentiable_renderer/patch_tracking/model.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import b3d
import b3d.chisight.dense.differentiable_renderer as rendering
import genjax
import jax
import jax.numpy as jnp
import rerun as rr
from b3d.modeling_utils import uniform_pose

import b3d
import b3d.chisight.dense.differentiable_renderer as rendering
import demos.differentiable_renderer.patch_tracking.demo_utils as utils
from b3d.modeling_utils import uniform_pose


def normalize(v):
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import b3d
import b3d.chisight.dense.patch_tracking as tracking
import numpy as np
import rerun as rr
from b3d.chisight.dense.model import rr_log_uniformpose_meshes_to_image_model_trace
from tqdm import tqdm

import b3d
import b3d.chisight.dense.patch_tracking as tracking
import demos.differentiable_renderer.patch_tracking.demo_utils as du
from b3d.chisight.dense.model import rr_log_uniformpose_meshes_to_image_model_trace

rr.init("multiple_patch_tracking_2")
rr.connect("127.0.0.1:8812")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,21 @@

import os

import b3d
import b3d.chisight.dense.differentiable_renderer as r
import b3d.chisight.dense.likelihoods as l
import genjax
import jax
import jax.numpy as jnp
import numpy as np
import optax
import rerun as rr
import trimesh
from b3d import Pose
from tqdm import tqdm

import b3d
import b3d.chisight.dense.differentiable_renderer as r
import b3d.chisight.dense.likelihoods as l
import demos.differentiable_renderer.patch_tracking.demo_utils as du
import demos.differentiable_renderer.patch_tracking.model as m
from b3d import Pose

rr.init("multiple_patch_tracking")
rr.connect("127.0.0.1:8812")
Expand Down
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
### Preliminaries ###

import b3d.chisight.dense.differentiable_renderer as r
import b3d.chisight.dense.likelihoods as l
import genjax
import jax
import jax.numpy as jnp
import optax
import rerun as rr
from b3d import Pose
from tqdm import tqdm

import b3d.chisight.dense.differentiable_renderer as r
import b3d.chisight.dense.likelihoods as l
import demos.differentiable_renderer.patch_tracking.demo_utils as du
import demos.differentiable_renderer.patch_tracking.model as m
from b3d import Pose

rr.init("single_patch_tracking")
rr.connect("127.0.0.1:8812")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,18 @@

import time

import b3d
import b3d.chisight.dense.differentiable_renderer as r
import b3d.chisight.dense.likelihoods as l
import genjax
import jax
import jax.numpy as jnp
import rerun as rr
from b3d import Pose
from tqdm import tqdm

import b3d
import b3d.chisight.dense.differentiable_renderer as r
import b3d.chisight.dense.likelihoods as l
import demos.differentiable_renderer.patch_tracking.demo_utils as du
import demos.differentiable_renderer.patch_tracking.model as m
from b3d import Pose

rr.init("single_patch_tracking-mh")
rr.connect("127.0.0.1:8812")
Expand Down
7 changes: 4 additions & 3 deletions demos/differentiable_renderer/test_barycentric_interp.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import b3d
import b3d.chisight.dense.differentiable_renderer as rendering
import b3d.chisight.dense.likelihoods as likelihoods
import jax
import jax.numpy as jnp
import rerun as rr

import b3d
import b3d.chisight.dense.differentiable_renderer as rendering
import b3d.chisight.dense.likelihoods as likelihoods
from b3d import Pose

# Set up OpenGL renderer
Expand Down
6 changes: 3 additions & 3 deletions demos/differentiable_renderer/test_basic_gd.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import time

import b3d
import b3d.chisight.dense.differentiable_renderer as rendering
import b3d.chisight.dense.likelihoods as likelihoods
import genjax
import jax
import jax.numpy as jnp
import rerun as rr

import b3d
import b3d.chisight.dense.differentiable_renderer as rendering
import b3d.chisight.dense.likelihoods as likelihoods
import demos.differentiable_renderer.utils as utils

# Set up OpenGL renderer
Expand Down
3 changes: 2 additions & 1 deletion demos/differentiable_renderer/utils.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import b3d
import jax
import jax.numpy as jnp

import b3d
from b3d import Pose


Expand Down
5 changes: 3 additions & 2 deletions demos/fork_knife_smc_identity_pose.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
import os

import b3d
import genjax
import jax
import jax.numpy as jnp
import numpy as np
import rerun as rr
import trimesh
from b3d import Pose
from tqdm import tqdm

import b3d
from b3d import Pose

### Choose experiment

INPUT = "fork-visible" # TODO make one dataset with both objects?
Expand Down
5 changes: 3 additions & 2 deletions demos/graphics_edits_demo/demo_visualize.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,16 @@
import os
import pickle

import b3d
import jax
import jax.numpy as jnp
import numpy as np
import rerun as rr
import trimesh
from b3d import Pose
from tqdm import tqdm

import b3d
from b3d import Pose

rr.init("demo_visualize3")
rr.connect("127.0.0.1:8812")

Expand Down
3 changes: 2 additions & 1 deletion demos/graphics_edits_demo/vkm_demo.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
import os

import b3d
import jax
import jax.numpy as jnp
import numpy as np
import rerun as rr
import trimesh

import b3d
from b3d import Pose

rr.init("vkm_demo2")
Expand Down
2 changes: 1 addition & 1 deletion demos/mesh_fitting/demo.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import os

import b3d
import genjax
import jax
import jax.numpy as jnp
import optax
import rerun as rr
from tqdm import tqdm

import b3d
import demos.mesh_fitting.model as m
import demos.mesh_fitting.tessellation as t

Expand Down
2 changes: 1 addition & 1 deletion demos/mesh_fitting/demo_depth_init.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import os

import b3d
import genjax
import jax
import rerun as rr

import b3d
import demos.mesh_fitting.model as m
import demos.mesh_fitting.utils as u

Expand Down
5 changes: 3 additions & 2 deletions demos/mesh_fitting/model.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import b3d
import b3d.chisight.dense.differentiable_renderer as rendering
import genjax
import jax
import jax.numpy as jnp
import rerun as rr

import b3d
import b3d.chisight.dense.differentiable_renderer as rendering
from b3d.modeling_utils import uniform_pose


Expand Down
2 changes: 1 addition & 1 deletion demos/mesh_fitting/utils.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import b3d
import jax
import jax.numpy as jnp

import b3d
import demos.mesh_fitting.tessellation as t


Expand Down
3 changes: 2 additions & 1 deletion demos/posterior_datasets/identity_posterior_data_gen.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
import os

import b3d
import jax
import jax.numpy as jnp
import numpy as np
import rerun as rr
import trimesh

import b3d

width = 200
height = 200
fx = 300.0
Expand Down
3 changes: 2 additions & 1 deletion demos/posterior_datasets/pose_posterior_data_gen.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
import os

import b3d
import jax
import jax.numpy as jnp
import rerun as rr
import trimesh

import b3d
from b3d import Pose

rr.init("demo")
Expand Down
3 changes: 2 additions & 1 deletion demos/sparse_model/cotracker.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
import argparse
import time

import b3d
import numpy as np
import torch

import b3d

parser = argparse.ArgumentParser("r3d_to_video_input")
parser.add_argument("input", help=".r3d File", type=str)
args = parser.parse_args()
Expand Down
Loading