Skip to content

Commit 3746aff

Browse files
committed
fix requirements.txt dependency
1 parent 56a9631 commit 3746aff

9 files changed

+36
-24
lines changed

.gitmodules

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
11
[submodule "third_party/diff-surfel-rasterization"]
22
path = third_party/diff-surfel-rasterization
3-
url = git@github.com:hbb1/diff-surfel-rasterization.git
3+
url = git@github.com:hbb1/diff-surfel-rasterization.git
4+
[submodule "third_party/simple-knn"]
5+
path = third_party/simple-knn
6+
url = https://gitlab.inria.fr/bkerbl/simple-knn.git

README.md

+13-2
Original file line numberDiff line numberDiff line change
@@ -138,12 +138,23 @@ bash shell_scripts/final_release/inference/gradio_sample_obajverse_i23d_dit.sh
138138

139139
# Inference
140140

141-
## setup the environment (the same env as [LN3Diff, ECCV 2024](https://github.com/NIRVANALAN/LN3Diff?tab=readme-ov-file))
141+
## setup the PyTorch environment (the same env as [LN3Diff, ECCV 2024](https://github.com/NIRVANALAN/LN3Diff?tab=readme-ov-file))
142142

143143
```bash
144+
# download
145+
git clone https://github.com/hbb1/2d-gaussian-splatting.git --recursive
146+
147+
# setup the pytorch+xformers+pytorch3d environment
144148
conda create -n ga python=3.10
145149
conda activate ga
146-
pip intall -r requrements.txt # will install the surfel Gaussians environments and pytorch3d automatically.
150+
pip install -r requirements.txt
151+
pip install "git+https://github.com/facebookresearch/pytorch3d.git@stable"
152+
```
153+
154+
Then, install the 2DGS dependencies:
155+
```bash
156+
pip install third_party/diff-surfel-rasterization
157+
pip install third_party/simple-knn
147158
```
148159

149160
## Gradio demo (Image-to-3D)

datasets/g_buffer_objaverse.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -4733,10 +4733,10 @@ def __init__(
47334733
if True: # instant-mesh picked images
47344734
# if False:
47354735
all_instances = os.listdir(self.file_path)
4736-
# all_fname = [
4737-
# t for t in all_instances
4738-
# if t.split('.')[1] in ['png', 'jpg']
4739-
# ]
4736+
all_fname = [
4737+
t for t in all_instances
4738+
if t.split('.')[1] in ['png', 'jpg']
4739+
]
47404740

47414741
# all_fname = [name for name in all_fname if '-input' in name ]
47424742

nsr/cvD/nvsD_canoD.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
from torch.optim import AdamW
2424

2525
from ..train_util import TrainLoopBasic, TrainLoop3DRec
26-
import vision_aided_loss
26+
# import vision_aided_loss
2727
from dnnlib.util import calculate_adaptive_weight
2828

2929
def flip_yaw(pose_matrix):

nsr/script_util.py

+5-3
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
from ldm.modules.diffusionmodules.mv_unet import MVUNet, LGM_MVEncoder
2020
from torch.profiler import profile, record_function, ProfilerActivity
2121

22-
from nsr.gs import GaussianRenderer
22+
# from nsr.gs import GaussianRenderer
2323
from nsr.gs_surfel import GaussianRenderer2DGS
2424
# from nsr.srt.encoder import ImprovedSRTEncoderVAE, ImprovedSRTEncoderVAE_L5_vitl, ImprovedSRTEncoderVAE_mlp_ratio4, ImprovedSRTEncoderVAE_L6, ImprovedSRTEncoderVAE_mlp_ratio4_f8, ImprovedSRTEncoderVAE_mlp_ratio4_heavyPatchify, ImprovedSRTEncoderVAE_mlp_ratio4_f8_L6, ImprovedSRTEncoderVAE_mlp_ratio4_L6, HybridEncoder, ImprovedSRTEncoderVAE_mlp_ratio4_decomposed, HybridEncoderPCDStructuredLatent
2525
from nsr.srt.encoder import *
@@ -1481,8 +1481,10 @@ def create_3DAE_model(
14811481
triplane_decoder = GaussianRenderer2DGS(
14821482
image_size, out_chans, rendering_kwargs=rendering_kwargs)
14831483
else:
1484-
triplane_decoder = GaussianRenderer(
1485-
image_size, out_chans, rendering_kwargs=rendering_kwargs)
1484+
raise NotImplementedError()
1485+
1486+
# triplane_decoder = GaussianRenderer(
1487+
# image_size, out_chans, rendering_kwargs=rendering_kwargs)
14861488

14871489
if load_pretrain_encoder:
14881490

nsr/train_util.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
from pdb import set_trace as st
1010

1111
import traceback
12-
from nsr.gs import GaussianRenderer
12+
# from nsr.gs import GaussianRenderer
1313
from nsr.gs_surfel import GaussianRenderer2DGS
1414
import blobfile as bf
1515
import imageio
@@ -880,9 +880,9 @@ def _init_optim_groups(self, kwargs):
880880

881881
# gs rendering no MLP
882882
if not (
883-
isinstance(
884-
self.mp_trainer_rec.model.decoder.triplane_decoder,
885-
GaussianRenderer) or
883+
# isinstance(
884+
# self.mp_trainer_rec.model.decoder.triplane_decoder,
885+
# GaussianRenderer) or
886886
isinstance(
887887
self.mp_trainer_rec.model.decoder.triplane_decoder,
888888
GaussianRenderer2DGS)):

nsr/train_util_cvD.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
import numpy as np
1010
import torch as th
1111
import torch.distributed as dist
12-
import torchvision
1312
from PIL import Image
1413
from torch.nn.parallel.distributed import DistributedDataParallel as DDP
1514
from tqdm import tqdm
@@ -23,7 +22,7 @@
2322
from torch.optim import AdamW
2423

2524
from .train_util import TrainLoopBasic, TrainLoop3DRec
26-
import vision_aided_loss
25+
# import vision_aided_loss
2726
from dnnlib.util import calculate_adaptive_weight
2827

2928

requirements.txt

+3-6
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
torch
1+
torch==2.1.0
2+
torchvision==0.16.0
23
xformers==0.0.26.post1
3-
torchvision
44
absl-py
55
tensorboard
66
lpips
@@ -44,7 +44,4 @@ onnxscript
4444
tritonclient
4545
gradio==4.43.0
4646
rembg
47-
onnxruntime
48-
git+https://github.com/facebookresearch/pytorch3d.git@stable
49-
git+https://github.com/hbb1/diff-surfel-rasterization.git
50-
git+https://gitlab.inria.fr/bkerbl/simple-knn.git
47+
onnxruntime

vit/vit_triplane.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@
5858

5959
from utils.general_utils import matrix_to_quaternion, quaternion_raw_multiply, build_rotation
6060

61-
from nsr.gs import GaussianRenderer
61+
# from nsr.gs import GaussianRenderer
6262

6363
from utils.dust3r.heads import create_dpt_head
6464

0 commit comments

Comments
 (0)