bartduis commited on
Commit
a190438
·
verified ·
1 Parent(s): 303b315

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +10 -7
app.py CHANGED
@@ -26,19 +26,15 @@ from eval_wrapper.eval import EvalWrapper, eval_scene
26
  device = 'cuda' if torch.cuda.is_available() else 'cpu'
27
 
28
  outdir = "/tmp/rayst3r"
29
-
30
  moge_model = MoGeModel.from_pretrained("Ruicheng/moge-vitl").to(device)
31
  dino_model = torch.hub.load('facebookresearch/dinov2', "dinov2_vitl14_reg")
32
  dino_model.eval()
33
  dino_model.to(device)
34
 
35
- print("Loading RaySt3R model")
36
- rayst3r_checkpoint = hf_hub_download("bartduis/rayst3r", "rayst3r.pth")
37
- rayst3r_model = EvalWrapper(rayst3r_checkpoint,device='cpu')
38
- rayst3r_model = rayst3r_model.to(device)
39
- print("Loaded all models")
40
 
41
- print("Loading MoGe model")
 
42
  # Load the model from huggingface hub (or load from local).
43
 
44
 
@@ -111,7 +107,14 @@ def prep_for_rayst3r(img,depth_dict,mask):
111
  def rayst3r_to_glb(img,depth_dict,mask,max_total_points=10e6,rotated=False):
112
  prep_for_rayst3r(img,depth_dict,mask)
113
  print('Doneneee')
 
 
 
 
 
 
114
  print(rayst3r_model)
 
115
  rayst3r_points = eval_scene(rayst3r_model,os.path.join(outdir, "input"),do_filter_all_masks=True,dino_model=dino_model, device = device).cpu()
116
 
117
  # subsample points
 
26
  device = 'cuda' if torch.cuda.is_available() else 'cpu'
27
 
28
  outdir = "/tmp/rayst3r"
29
+ print("Loading MoGe model")
30
  moge_model = MoGeModel.from_pretrained("Ruicheng/moge-vitl").to(device)
31
  dino_model = torch.hub.load('facebookresearch/dinov2', "dinov2_vitl14_reg")
32
  dino_model.eval()
33
  dino_model.to(device)
34
 
 
 
 
 
 
35
 
36
+
37
+
38
  # Load the model from huggingface hub (or load from local).
39
 
40
 
 
107
  def rayst3r_to_glb(img,depth_dict,mask,max_total_points=10e6,rotated=False):
108
  prep_for_rayst3r(img,depth_dict,mask)
109
  print('Doneneee')
110
+
111
+ print("Loading RaySt3R model")
112
+ rayst3r_checkpoint = hf_hub_download("bartduis/rayst3r", "rayst3r.pth")
113
+ rayst3r_model = EvalWrapper(rayst3r_checkpoint,device='cpu')
114
+ rayst3r_model = rayst3r_model.to(device)
115
+ print("Loaded rayst3r_model")
116
  print(rayst3r_model)
117
+
118
  rayst3r_points = eval_scene(rayst3r_model,os.path.join(outdir, "input"),do_filter_all_masks=True,dino_model=dino_model, device = device).cpu()
119
 
120
  # subsample points