kxhit commited on
Commit
b9dbb4d
·
1 Parent(s): 21b0250

move model in func

Browse files
Files changed (1) hide show
  1. app.py +5 -2
app.py CHANGED
@@ -332,6 +332,8 @@ def get_reconstructed_scene(outdir, model, device, silent, image_size, filelist,
332
  from a list of images, run dust3r inference, global aligner.
333
  then run get_3D_model_from_scene
334
  """
 
 
335
  # remove the directory if it already exists
336
  if os.path.exists(outdir):
337
  shutil.rmtree(outdir)
@@ -526,8 +528,9 @@ def preview_input(inputfiles):
526
  # dustr init
527
  silent = False
528
  image_size = 224
529
- weights_path = 'checkpoints/DUSt3R_ViTLarge_BaseDecoder_224_linear.pth'
530
- model = AsymmetricCroCo3DStereo.from_pretrained(weights_path, landscape_only=False).to(device)
 
531
  # dust3r will write the 3D model inside tmpdirname
532
  # with tempfile.TemporaryDirectory(suffix='dust3r_gradio_demo') as tmpdirname:
533
  tmpdirname = os.path.join('logs/user_object')
 
332
  from a list of images, run dust3r inference, global aligner.
333
  then run get_3D_model_from_scene
334
  """
335
+ weights_path = 'checkpoints/DUSt3R_ViTLarge_BaseDecoder_224_linear.pth'
336
+ model = AsymmetricCroCo3DStereo.from_pretrained(weights_path).to(device)
337
  # remove the directory if it already exists
338
  if os.path.exists(outdir):
339
  shutil.rmtree(outdir)
 
528
  # dustr init
529
  silent = False
530
  image_size = 224
531
+ # weights_path = 'checkpoints/DUSt3R_ViTLarge_BaseDecoder_224_linear.pth'
532
+ # model = AsymmetricCroCo3DStereo.from_pretrained(weights_path).to(device)
533
+ model=None
534
  # dust3r will write the 3D model inside tmpdirname
535
  # with tempfile.TemporaryDirectory(suffix='dust3r_gradio_demo') as tmpdirname:
536
  tmpdirname = os.path.join('logs/user_object')