Spaces:
beetson
/
Runtime error

beetson commited on
Commit
8e1c24e
·
verified ·
1 Parent(s): 660b82c
Files changed (1) hide show
  1. app.py +9 -23
app.py CHANGED
@@ -639,19 +639,8 @@ def demo_lhm(pose_estimator, face_detector, lhm, cfg):
639
  },
640
  )
641
 
642
- # export ply model
643
- try:
644
- print("Attempting PLY export...")
645
- export_smplx = {k: v.to("cuda") for k, v in smplx_params.items()}
646
- export_smplx['transform_mat_neutral_pose'] = transform_mat_neutral_pose
647
- output_gs = lhm.animation_infer_gs(gs_model_list, query_points, export_smplx)
648
- output_gs.save_ply(dump_model_path)
649
- print(f"PLY saved to {dump_model_path}")
650
- except Exception as e:
651
- print(f"PLY export failed: {e}")
652
- import traceback
653
- traceback.print_exc()
654
- dump_model_path = None
655
 
656
  # rendering !!!!
657
  start_time = time.time()
@@ -739,10 +728,7 @@ def demo_lhm(pose_estimator, face_detector, lhm, cfg):
739
 
740
 
741
 
742
- if dump_model_path and os.path.exists(dump_model_path):
743
- return dump_image_path, dump_video_path, dump_model_path
744
- else:
745
- return dump_image_path, dump_video_path, None
746
  # return rgb, dump_image_path, dump_video_path
747
 
748
  # def core_fn_export(image, video_params, working_dir):
@@ -873,11 +859,11 @@ def demo_lhm(pose_estimator, face_detector, lhm, cfg):
873
 
874
  # show video && ply model
875
  with gr.Row():
876
- with gr.Column(variant='panel', scale=1):
877
- with gr.Tabs(elem_id="openlrm_render_model"):
878
- with gr.TabItem('Rendered 3D Model'):
879
- with gr.Row():
880
- output_model = gr.Model3D(label="Rendered 3D Model")
881
 
882
  with gr.Column(variant='panel', scale=1):
883
  with gr.Tabs(elem_id="openlrm_render_video"):
@@ -897,7 +883,7 @@ def demo_lhm(pose_estimator, face_detector, lhm, cfg):
897
  ).success(
898
  fn=core_fn,
899
  inputs=[input_image, video_input, working_dir], # video_params refer to smpl dir
900
- outputs=[processed_image, output_video, output_model],
901
  )
902
 
903
  demo.queue(max_size=1)
 
639
  },
640
  )
641
 
642
+ # PLY export disabled for now - debugging
643
+ dump_model_path = None
 
 
 
 
 
 
 
 
 
 
 
644
 
645
  # rendering !!!!
646
  start_time = time.time()
 
728
 
729
 
730
 
731
+ return dump_image_path, dump_video_path
 
 
 
732
  # return rgb, dump_image_path, dump_video_path
733
 
734
  # def core_fn_export(image, video_params, working_dir):
 
859
 
860
  # show video && ply model
861
  with gr.Row():
862
+ # with gr.Column(variant='panel', scale=1):
863
+ # with gr.Tabs(elem_id="openlrm_render_model"):
864
+ # with gr.TabItem('Rendered 3D Model'):
865
+ # with gr.Row():
866
+ # output_model = gr.Model3D(label="Rendered 3D Model")
867
 
868
  with gr.Column(variant='panel', scale=1):
869
  with gr.Tabs(elem_id="openlrm_render_video"):
 
883
  ).success(
884
  fn=core_fn,
885
  inputs=[input_image, video_input, working_dir], # video_params refer to smpl dir
886
+ outputs=[processed_image, output_video],
887
  )
888
 
889
  demo.queue(max_size=1)