Skip to content

probcomp/b3d

Repository files navigation

b3d

animated

b3d

This repository contains code for Bayesian 3D inverse graphics.

The b3d/bayes3d/ subdirectory contains code for the bayes3d project, and the b3d/chisight/ subdirectory contains code for post-bayes3D ChiSight systems (currently, SAMA4D).

GCloud Machine

Run the following command to launch your instance:

export ZONE="us-west1-a"

# Make sure to replace the value with a unique name!
export INSTANCE_NAME="your-instance-name-here"

gcloud compute instances create $INSTANCE_NAME \
  --zone=$ZONE \
  --image-family="common-cu123-ubuntu-2204-py310" \
  --image-project=deeplearning-platform-release \
  --maintenance-policy=TERMINATE \
  --boot-disk-size=400GB \
  --machine-type g2-standard-32 \
  --accelerator="type=nvidia-l4,count=1" \
  --metadata="install-nvidia-driver=True"

to ssh into your new machine, run:

gcloud compute config-ssh
ssh $INSTANCE_NAME.$ZONE.$PROJECT_ID

Environment Variables

Add the following to your bash_rc:

export XLA_PYTHON_CLIENT_PREALLOCATE="false"
export XLA_PYTHON_CLIENT_ALLOCATOR="platform"

Installing b3d

b3d's GenJAX dependency is hosted in Google Artifact Registry. To configure your machine to access the package:

Next, on the machine, close the b3d repo:

git clone https://github.com/probcomp/b3d.git
cd b3d

Create and activate b3d conda environment:

conda create -n b3d python=3.12

When that completes, run the install script:

bash -i install.sh

Then activate the conda environment:

conda activate b3d

Visualizer

Tunnel port 8812 for Rerun visualization by adding the RemoteForwardline to your ssh config:

Host xx.xx.xxx.xxx
    HostName xx.xx.xxx.xxx
    IdentityFile ~/.ssh/id_rsa
    User thomasbayes
    RemoteForward 8812 127.0.0.1:8812

Install rerun on local machine pip install rerun-sdk and open viewer:

rerun --port 8812