Luigi Piccinelli commited on
Commit
183b4b6
·
1 Parent(s): 39aba6e

remove fp16

Browse files
Files changed (2) hide show
  1. app.py +3 -3
  2. unik3d/models/unik3d.py +0 -4
app.py CHANGED
@@ -405,7 +405,7 @@ if __name__ == "__main__":
405
  <li><strong>Visualize:</strong> The 3D reconstruction will appear in the viewer on the right. You can rotate, pan, and zoom to explore the model, and download the GLB file.</li>
406
  <li><strong>Downstream:</strong> The 3D output can be used as reconstruction or for monocular camera calibration.</li>
407
  </ol>
408
- <p><strong style="color: #ff7e26;">Please note:</strong> <span style="color: #ff7e26; font-weight: bold;">Our model runs on CPU on HuggingFace Space. Actual inference is less than 100ms second per image on consumer-level GPUs, on Spaces will take between 20s and 90s, depending on the "Speed-Resoltion Tradeoff" chosen. Web-based 3D pointcloud visualization may be slow due to Gradio's rendering. For faster visualization, use a local machine to run our demo from our <a href="https://github.com/lpiccinelli-eth/UniK3D">GitHub repository</a>. </span></p>
409
  </div>
410
  """
411
  )
@@ -528,7 +528,7 @@ if __name__ == "__main__":
528
  10.0,
529
  ],
530
  [
531
- "assets/demo/bears.png",
532
  "Large",
533
  "Predicted",
534
  0.0,
@@ -654,7 +654,7 @@ if __name__ == "__main__":
654
  10.0,
655
  ],
656
  [
657
- "assets/demo/scannet.png",
658
  "Large",
659
  "Fisheye624",
660
  791.90869140625,
 
405
  <li><strong>Visualize:</strong> The 3D reconstruction will appear in the viewer on the right. You can rotate, pan, and zoom to explore the model, and download the GLB file.</li>
406
  <li><strong>Downstream:</strong> The 3D output can be used as reconstruction or for monocular camera calibration.</li>
407
  </ol>
408
+ <p><strong style="color: #ff7e26;">Please note:</strong> <span style="color: #ff7e26; font-weight: bold;">Our model runs on CPU on HuggingFace Space. Actual inference is less than 100ms second per image on consumer-level GPUs, on Spaces will take between 20s and 90s, depending on the "Speed-Resolution Tradeoff" chosen and the first inference is slower (downloading model). Web-based 3D pointcloud visualization may be slow due to Gradio's rendering. For faster visualization, use a local machine to run our demo from our <a href="https://github.com/lpiccinelli-eth/UniK3D">GitHub repository</a>. </span></p>
409
  </div>
410
  """
411
  )
 
528
  10.0,
529
  ],
530
  [
531
+ "assets/demo/bears.jpg",
532
  "Large",
533
  "Predicted",
534
  0.0,
 
654
  10.0,
655
  ],
656
  [
657
+ "assets/demo/scannet.jpg",
658
  "Large",
659
  "Fisheye624",
660
  791.90869140625,
unik3d/models/unik3d.py CHANGED
@@ -21,9 +21,6 @@ from unik3d.utils.constants import IMAGENET_DATASET_MEAN, IMAGENET_DATASET_STD
21
  from unik3d.utils.distributed import is_main_process
22
  from unik3d.utils.misc import get_params, last_stack, match_gt
23
 
24
- DEVICE = "cuda" if torch.cuda.is_available() else "cpu"
25
- ENABLED = torch.cuda.is_available()
26
-
27
 
28
  def orthonormal_init(num_tokens, dims):
29
  pe = torch.randn(num_tokens, dims)
@@ -276,7 +273,6 @@ class UniK3D(
276
  return losses
277
 
278
  @torch.no_grad()
279
- @torch.autocast(device_type=DEVICE, enabled=ENABLED, dtype=torch.float16)
280
  def infer(
281
  self,
282
  rgb: torch.Tensor,
 
21
  from unik3d.utils.distributed import is_main_process
22
  from unik3d.utils.misc import get_params, last_stack, match_gt
23
 
 
 
 
24
 
25
  def orthonormal_init(num_tokens, dims):
26
  pe = torch.randn(num_tokens, dims)
 
273
  return losses
274
 
275
  @torch.no_grad()
 
276
  def infer(
277
  self,
278
  rgb: torch.Tensor,