Daniellesry commited on
Commit
660d02c
·
1 Parent(s): aa54deb
Files changed (1) hide show
  1. app.py +8 -13
app.py CHANGED
@@ -56,13 +56,7 @@ import trimesh
56
  from gradio_litmodel3d import LitModel3D
57
  from os.path import join
58
  from tools.depth2pcd import depth2pcd
59
-
60
- try:
61
- from moge.model.v2 import MoGeModel
62
-
63
- except:
64
- os.system('pip install git+https://github.com/microsoft/MoGe.git -i https://pypi.org/simple/ --trusted-host pypi.org --trusted-host pypi.python.org --trusted-host files.pythonhosted.org')
65
- from moge.model.v2 import MoGeModel
66
 
67
 
68
  from tools.eval_utils import transfer_pred_disp2depth, colorize_depth_map
@@ -293,6 +287,10 @@ def process_video(
293
 
294
 
295
 
 
 
 
 
296
  frames = [resize_frame(frame, height, width) for frame in origin_frames]
297
  frame_length = len(frames)
298
  if (frame_length - 1) % 4 != 0:
@@ -622,14 +620,14 @@ with gr.Blocks(css=css, title="DKT", head=head_html) as demo:
622
  def on_submit(video_file, model_size, num_inference_steps, overlap):
623
  print('on_submit is calling')
624
  logger.info('on_submit is calling')
625
-
626
  if video_file is None:
627
  return None, None, None, None, None, None, "Please upload a video file"
628
 
629
  try:
630
 
631
  output_path, glb_files = process_video(
632
- video_file, model_size, height, width, num_inference_steps, window_size, overlap
633
  )
634
 
635
 
@@ -695,10 +693,7 @@ if __name__ == '__main__':
695
  # demo.queue().launch(share = True)
696
  demo.queue(
697
  api_open=False,
698
- ).launch(
699
- server_name="0.0.0.0",
700
- server_port=7860,
701
- )
702
 
703
 
704
  # server_name="0.0.0.0", server_port=7860
 
56
  from gradio_litmodel3d import LitModel3D
57
  from os.path import join
58
  from tools.depth2pcd import depth2pcd
59
+ from moge.model.v2 import MoGeModel
 
 
 
 
 
 
60
 
61
 
62
  from tools.eval_utils import transfer_pred_disp2depth, colorize_depth_map
 
287
 
288
 
289
 
290
+ global height
291
+ global width
292
+ global window_size
293
+
294
  frames = [resize_frame(frame, height, width) for frame in origin_frames]
295
  frame_length = len(frames)
296
  if (frame_length - 1) % 4 != 0:
 
620
  def on_submit(video_file, model_size, num_inference_steps, overlap):
621
  print('on_submit is calling')
622
  logger.info('on_submit is calling')
623
+
624
  if video_file is None:
625
  return None, None, None, None, None, None, "Please upload a video file"
626
 
627
  try:
628
 
629
  output_path, glb_files = process_video(
630
+ video_file, model_size, num_inference_steps, overlap
631
  )
632
 
633
 
 
693
  # demo.queue().launch(share = True)
694
  demo.queue(
695
  api_open=False,
696
+ ).launch()
 
 
 
697
 
698
 
699
  # server_name="0.0.0.0", server_port=7860