kxhit commited on
Commit
dbeb165
·
1 Parent(s): ba76f8a

cuda reinit?

Browse files
Files changed (1) hide show
  1. app.py +4 -5
app.py CHANGED
@@ -114,13 +114,12 @@ pipeline = pipeline.to(device)
114
  pipeline.enable_vae_slicing()
115
  # pipeline.enable_xformers_memory_efficient_attention()
116
 
117
- generator = torch.Generator(device=device).manual_seed(0)
118
-
119
 
120
  @spaces.GPU(duration=120)
121
  def run_eschernet(eschernet_input_dict, sample_steps, sample_seed, nvs_num, nvs_mode):
122
  # set the random seed
123
- generator.manual_seed(sample_seed)
 
124
  T_out = nvs_num
125
  T_in = len(eschernet_input_dict['imgs'])
126
  ####### output pose
@@ -392,7 +391,7 @@ def get_reconstructed_scene(filelist, schedule, niter, min_conf_thr,
392
  # for eschernet
393
  # get optimized values from scene
394
  rgbimg = to_numpy(scene.imgs)
395
- focals = to_numpy(scene.get_focals().cpu())
396
  cams2world = to_numpy(scene.get_im_poses().cpu())
397
 
398
  # 3D pointcloud from depthmap, poses and intrinsics
@@ -478,7 +477,7 @@ def get_reconstructed_scene(filelist, schedule, niter, min_conf_thr,
478
  eschernet_input = {"poses": cams2world,
479
  "radii": radii,
480
  "imgs": rgbaimg}
481
-
482
  outfile = get_3D_model_from_scene(outdir, silent, scene, min_conf_thr, as_pointcloud, mask_sky,
483
  clean_depth, transparent_cams, cam_size, same_focals=same_focals)
484
 
 
114
  pipeline.enable_vae_slicing()
115
  # pipeline.enable_xformers_memory_efficient_attention()
116
 
 
 
117
 
118
  @spaces.GPU(duration=120)
119
  def run_eschernet(eschernet_input_dict, sample_steps, sample_seed, nvs_num, nvs_mode):
120
  # set the random seed
121
+ generator = torch.Generator(device=device).manual_seed(sample_seed)
122
+ # generator = None
123
  T_out = nvs_num
124
  T_in = len(eschernet_input_dict['imgs'])
125
  ####### output pose
 
391
  # for eschernet
392
  # get optimized values from scene
393
  rgbimg = to_numpy(scene.imgs)
394
+ # focals = to_numpy(scene.get_focals().cpu())
395
  cams2world = to_numpy(scene.get_im_poses().cpu())
396
 
397
  # 3D pointcloud from depthmap, poses and intrinsics
 
477
  eschernet_input = {"poses": cams2world,
478
  "radii": radii,
479
  "imgs": rgbaimg}
480
+ print("got eschernet input")
481
  outfile = get_3D_model_from_scene(outdir, silent, scene, min_conf_thr, as_pointcloud, mask_sky,
482
  clean_depth, transparent_cams, cam_size, same_focals=same_focals)
483