hpwang commited on
Commit
ff37255
1 Parent(s): 17a538f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -1
app.py CHANGED
@@ -22,6 +22,7 @@ def get_temp_path():
22
 
23
  @spaces.GPU(duration=120)
24
  def scene_generate(rgb,num_coarse_views,num_mcs_views,mcs_rect_w,mcs_steps):
 
25
  # coarse
26
  vistadream.scene = Gaussian_Scene(cfg)
27
  # for trajectory genearation
@@ -39,6 +40,9 @@ def scene_generate(rgb,num_coarse_views,num_mcs_views,mcs_rect_w,mcs_steps):
39
  # coarse scene
40
  vistadream._coarse_scene(rgb)
41
  torch.cuda.empty_cache()
 
 
 
42
  # refinement
43
  vistadream._MCS_Refinement()
44
  output_path = get_temp_path()
@@ -52,7 +56,8 @@ def render_video(output_path):
52
  return output_path+'video_rgb.mp4',output_path+'video_dpt.mp4'
53
 
54
  def process(rgb,num_coarse_views,num_mcs_views,mcs_rect_w,mcs_steps):
55
- path = scene_generate(rgb,num_coarse_views,num_mcs_views,mcs_rect_w,mcs_steps)
 
56
  rgb.save(output_path+'input.png')
57
  return render_video(path)
58
 
 
22
 
23
  @spaces.GPU(duration=120)
24
  def scene_generate(rgb,num_coarse_views,num_mcs_views,mcs_rect_w,mcs_steps):
25
+ torch.cuda.init()
26
  # coarse
27
  vistadream.scene = Gaussian_Scene(cfg)
28
  # for trajectory genearation
 
40
  # coarse scene
41
  vistadream._coarse_scene(rgb)
42
  torch.cuda.empty_cache()
43
+
44
+ @spaces.GPU(duration=120)
45
+ def scene_refinement()
46
  # refinement
47
  vistadream._MCS_Refinement()
48
  output_path = get_temp_path()
 
56
  return output_path+'video_rgb.mp4',output_path+'video_dpt.mp4'
57
 
58
  def process(rgb,num_coarse_views,num_mcs_views,mcs_rect_w,mcs_steps):
59
+ scene_generate(rgb,num_coarse_views,num_mcs_views,mcs_rect_w,mcs_steps)
60
+ path = scene_refinement()
61
  rgb.save(output_path+'input.png')
62
  return render_video(path)
63