Skip to content
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
1 change: 0 additions & 1 deletion notebook/demo_multi_object.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
"import os\n",
"import uuid\n",
"import imageio\n",
"import numpy as np\n",
"from IPython.display import Image as ImageDisplay\n",
"\n",
"from inference import Inference, ready_gaussian_for_video_rendering, load_image, load_masks, display_image, make_scene, render_video, interactive_visualizer"
Expand Down
4 changes: 0 additions & 4 deletions notebook/inference.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
os.environ["CUDA_HOME"] = os.environ["CONDA_PREFIX"]
os.environ["LIDRA_SKIP_INIT"] = "true"

import sys
from typing import Union, Optional, List, Callable
import numpy as np
from PIL import Image
Expand All @@ -17,13 +16,10 @@
import shutil
import subprocess
import seaborn as sns
from PIL import Image
import numpy as np
import gradio as gr
import matplotlib.pyplot as plt
from copy import deepcopy
from kaolin.visualize import IpyTurntableVisualizer
from kaolin.render.camera import Camera, CameraExtrinsics, PinholeIntrinsics
import builtins
from pytorch3d.transforms import quaternion_multiply, quaternion_invert

Expand Down
1 change: 0 additions & 1 deletion notebook/mesh_alignment.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
import torch
import trimesh
from PIL import Image
import torch.nn.functional as F
from pytorch3d.structures import Meshes
from pytorch3d.renderer import PerspectiveCameras, RasterizationSettings, MeshRasterizer, TexturesVertex
from moge.model.v1 import MoGeModel
Expand Down
3 changes: 0 additions & 3 deletions requirements.dev.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1 @@
pytest
findpydeps
pipdeptree
lovely_tensors
1 change: 0 additions & 1 deletion requirements.inference.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
kaolin==0.17.0
gsplat @ git+https://github.com/nerfstudio-project/gsplat.git@2323de5905d5e90e035f792fe65bad0fedd413e7
seaborn==0.13.2
gradio==5.49.0
69 changes: 0 additions & 69 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,88 +1,19 @@
astor==0.8.1
async-timeout==4.0.3
auto_gptq==0.7.1
autoflake==2.3.1
av==12.0.0
bitsandbytes==0.43.0
black==24.3.0
bpy==4.3.0
colorama==0.4.6
conda-pack==0.7.1
crcmod==1.7
cuda-python==12.1.0
dataclasses==0.6
decord==0.6.0
deprecation==2.1.0
easydict==1.13
einops-exts==0.0.4
exceptiongroup==1.2.0
fastavro==1.9.4
fasteners==0.19
flake8==7.0.0
Flask==3.0.3
fqdn==1.5.1
ftfy==6.2.0
fvcore==0.1.5.post20221221
gdown==5.2.0
h5py==3.12.1
hdfs==2.7.3
httplib2==0.22.0
hydra-core==1.3.2
hydra-submitit-launcher==1.2.0
igraph==0.11.8
imath==0.0.2
isoduration==20.11.0
jsonlines==4.0.0
jsonpickle==3.0.4
jsonpointer==2.4
jupyter==1.1.1
librosa==0.10.1
lightning==2.3.3
loguru==0.7.2
mosaicml-streaming==0.7.5
nvidia-cuda-nvcc-cu12==12.1.105
nvidia-pyindex==1.0.9
objsize==0.7.0
open3d==0.18.0
opencv-python==4.9.0.80
OpenEXR==3.3.3
optimum==1.18.1
optree==0.14.1
orjson==3.10.0
panda3d-gltf==1.2.1
pdoc3==0.10.0
peft==0.10.0
pip-system-certs==4.0
point-cloud-utils==0.29.5
polyscope==2.3.0
pycocotools==2.0.7
pydot==1.4.2
pymeshfix==0.17.0
pymongo==4.6.3
pyrender==0.1.45
PySocks==1.7.1
pytest==8.1.1
python-pycg==0.9.2
randomname==0.2.1
roma==1.5.1
rootutils==1.0.7
Rtree==1.3.0
sagemaker==2.242.0
scikit-image==0.23.1
sentence-transformers==2.6.1
simplejson==3.19.2
smplx==0.1.28
spconv-cu121==2.3.8
tensorboard==2.16.2
timm==0.9.16
tomli==2.0.1
torchaudio==2.5.1+cu121
uri-template==1.3.0
usort==1.0.8.post1
wandb==0.20.0
webcolors==1.13
webdataset==0.2.86
Werkzeug==3.0.6
xatlas==0.0.9
xformers==0.0.28.post3
MoGe @ git+https://github.com/microsoft/MoGe.git@a8c37341bc0325ca99b9d57981cc3bb2bd3e255b
3 changes: 1 addition & 2 deletions sam3d_objects/data/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
from collections.abc import Iterable
import inspect
import ast
import astor
from torch.utils import _pytree

# None = root, Iterable[Any] = path, Any = path of one
Expand Down Expand Up @@ -215,7 +214,7 @@ def _get_caller_arg_name(argnum=0, parent_frame=1):
break # only get the first parent call

# get first argument string (do not handle '=')
label = astor.to_source(args[argnum]).strip()
label = ast.unparse(args[argnum]).strip()
except:
# TODO(Pierre) log exception
label = "{label}"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
# limitations under the License.
import torch
from .tables import *
from kaolin.utils.testing import check_tensor

__all__ = [
'FlexiCubes'
Expand Down Expand Up @@ -56,29 +55,18 @@ def __init__(self, device="cuda"):

def __call__(self, voxelgrid_vertices, scalar_field, cube_idx, resolution, qef_reg_scale=1e-3,
weight_scale=0.99, beta=None, alpha=None, gamma_f=None, voxelgrid_colors=None, training=False):
assert torch.is_tensor(voxelgrid_vertices) and \
check_tensor(voxelgrid_vertices, (None, 3), throw=False), \
"'voxelgrid_vertices' should be a tensor of shape (num_vertices, 3)"
num_vertices = voxelgrid_vertices.shape[0]
assert torch.is_tensor(scalar_field) and \
check_tensor(scalar_field, (num_vertices,), throw=False), \
"'scalar_field' should be a tensor of shape (num_vertices,)"
assert torch.is_tensor(cube_idx) and \
check_tensor(cube_idx, (None, 8), throw=False), \
"'cube_idx' should be a tensor of shape (num_cubes, 8)"
assert voxelgrid_vertices.ndim == 2 and voxelgrid_vertices.shape[1] == 3, "voxelgrid_vertices must be (N, 3)"
assert scalar_field.shape == (voxelgrid_vertices.shape[0],), "scalar_field must be (N,)"

assert cube_idx.ndim == 2 and cube_idx.shape[1] == 8, "cube_idx must be (M, 8)"
num_cubes = cube_idx.shape[0]
assert beta is None or (
torch.is_tensor(beta) and
check_tensor(beta, (num_cubes, 12), throw=False)
), "'beta' should be a tensor of shape (num_cubes, 12)"
assert alpha is None or (
torch.is_tensor(alpha) and
check_tensor(alpha, (num_cubes, 8), throw=False)
), "'alpha' should be a tensor of shape (num_cubes, 8)"
assert gamma_f is None or (
torch.is_tensor(gamma_f) and
check_tensor(gamma_f, (num_cubes,), throw=False)
), "'gamma_f' should be a tensor of shape (num_cubes,)"

if beta is not None:
assert beta.shape == (num_cubes, 12), "beta must be (M, 12)"
if alpha is not None:
assert alpha.shape == (num_cubes, 8), "alpha must be (M, 8)"
if gamma_f is not None:
assert gamma_f.shape == (num_cubes,), "gamma_f must be (M,)"

surf_cubes, occ_fx8 = self._identify_surf_cubes(scalar_field, cube_idx)
if surf_cubes.sum() == 0:
Expand Down