xrg
commited on
Commit
·
10fca03
1
Parent(s):
82f35f5
fix bug
Browse files- app.py +2 -1
- core/tensorBase.py +16 -1
app.py
CHANGED
@@ -34,7 +34,8 @@ GRADIO_OBJ_SHADING_PATH = 'gradio_output_shading.obj'
|
|
34 |
|
35 |
#opt = tyro.cli(AllConfigs)
|
36 |
|
37 |
-
ckpt_path = hf_hub_download(repo_id="rgxie/LDM", filename="LDM6v01.ckpt")
|
|
|
38 |
|
39 |
opt = Options(
|
40 |
input_size=512,
|
|
|
34 |
|
35 |
#opt = tyro.cli(AllConfigs)
|
36 |
|
37 |
+
#ckpt_path = hf_hub_download(repo_id="rgxie/LDM", filename="LDM6v01.ckpt")
|
38 |
+
ckpt_path = '/ssd3/xrg/tensor23d/pretrained/last_6view_0610_14.ckpt'
|
39 |
|
40 |
opt = Options(
|
41 |
input_size=512,
|
core/tensorBase.py
CHANGED
@@ -205,8 +205,23 @@ class TensorBase(torch.nn.Module):
|
|
205 |
self.near_far = near_far
|
206 |
self.step_ratio = 0.9 #step_ratio原作0.5
|
207 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
208 |
|
209 |
-
self.update_stepSize(gridSize)
|
210 |
|
211 |
self.matMode = [[0,1], [0,2], [1,2]]
|
212 |
self.vecMode = [2, 1, 0]
|
|
|
205 |
self.near_far = near_far
|
206 |
self.step_ratio = 0.9 #step_ratio原作0.5
|
207 |
|
208 |
+
print("aabb", self.aabb.view(-1))
|
209 |
+
print("grid size", gridSize)
|
210 |
+
self.aabbSize = self.aabb[1] - self.aabb[0]
|
211 |
+
print(self.aabbSize.device)
|
212 |
+
self.invaabbSize = 2.0/self.aabbSize
|
213 |
+
print(self.invaabbSize.device)
|
214 |
+
# self.invaabbSize = self.invaabbSize.to(self.aabb.device)
|
215 |
+
# print(self.invaabbSize.device)
|
216 |
+
self.gridSize= gridSize.float()
|
217 |
+
self.units=self.aabbSize / (self.gridSize-1)
|
218 |
+
self.stepSize=torch.mean(self.units)*self.step_ratio # TBD step_ratio? why so small 0.5
|
219 |
+
self.aabbDiag = torch.sqrt(torch.sum(torch.square(self.aabbSize)))
|
220 |
+
self.nSamples=int((self.aabbDiag / self.stepSize).item()) + 1
|
221 |
+
print("sampling step size: ", self.stepSize)
|
222 |
+
print("sampling number: ", self.nSamples)
|
223 |
|
224 |
+
# self.update_stepSize(gridSize)
|
225 |
|
226 |
self.matMode = [[0,1], [0,2], [1,2]]
|
227 |
self.vecMode = [2, 1, 0]
|