Spaces:
Runtime error
Runtime error
lyndonzheng
commited on
Commit
β’
4bba5c3
1
Parent(s):
0f8b4e3
delet pre-installed unidepth
Browse files
flash3d/networks/unidepth_extension.py
CHANGED
@@ -4,7 +4,6 @@ import torch.nn.functional as F
|
|
4 |
from einops import rearrange
|
5 |
|
6 |
from .unidepth import UniDepthDepth
|
7 |
-
from unidepth.models import UniDepthV1
|
8 |
from .resnet_encoder import ResnetEncoder
|
9 |
from .gaussian_decoder import GaussianDecoder
|
10 |
from .depth_decoder import DepthDecoder
|
@@ -20,7 +19,6 @@ class UniDepthExtended(nn.Module):
|
|
20 |
self.cfg = cfg
|
21 |
|
22 |
self.unidepth = UniDepthDepth(cfg)
|
23 |
-
# self.unidepth = UniDepthV1.from_pretrained("lpiccinelli/unidepth-v1-vitl14")
|
24 |
|
25 |
self.parameters_to_train = []
|
26 |
if self.cfg.model.splat_branch == "resnet":
|
@@ -129,17 +127,7 @@ class UniDepthExtended(nn.Module):
|
|
129 |
depth_outs["depth"] = inputs[('unidepth', 0, 0)]
|
130 |
else:
|
131 |
with torch.no_grad():
|
132 |
-
# if self.training and self.cfg.dataset.pad_border_aug > 0:
|
133 |
-
# pad = self.cfg.dataset.pad_border_aug
|
134 |
-
# input = inputs["color_aug", 0, 0][:,:,pad:-pad, pad:-pad]
|
135 |
-
# intrincs = inputs[("K_tgt", 0)]
|
136 |
-
# else:
|
137 |
-
# input = inputs["color_aug", 0, 0]
|
138 |
-
# intrincs = inputs[("K_src", 0)]
|
139 |
_, depth_outs = self.unidepth(inputs)
|
140 |
-
# depth_outs = self.unidepth.infer(input, intrincs)
|
141 |
-
# if self.training and self.cfg.dataset.pad_border_aug > 0:
|
142 |
-
# depth_outs["depth"] = F.pad(depth_outs["depth"], (pad,pad,pad,pad), mode="replicate")
|
143 |
|
144 |
outputs_gauss = {}
|
145 |
|
|
|
4 |
from einops import rearrange
|
5 |
|
6 |
from .unidepth import UniDepthDepth
|
|
|
7 |
from .resnet_encoder import ResnetEncoder
|
8 |
from .gaussian_decoder import GaussianDecoder
|
9 |
from .depth_decoder import DepthDecoder
|
|
|
19 |
self.cfg = cfg
|
20 |
|
21 |
self.unidepth = UniDepthDepth(cfg)
|
|
|
22 |
|
23 |
self.parameters_to_train = []
|
24 |
if self.cfg.model.splat_branch == "resnet":
|
|
|
127 |
depth_outs["depth"] = inputs[('unidepth', 0, 0)]
|
128 |
else:
|
129 |
with torch.no_grad():
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
130 |
_, depth_outs = self.unidepth(inputs)
|
|
|
|
|
|
|
131 |
|
132 |
outputs_gauss = {}
|
133 |
|