lionelgarnier commited on
Commit
c220bb2
·
1 Parent(s): 1492900

remove extraction

Browse files
Files changed (1) hide show
  1. app.py +16 -1
app.py CHANGED
@@ -54,6 +54,17 @@ _image_gen_pipeline = None
54
  _trellis_pipeline = None
55
 
56
 
 
 
 
 
 
 
 
 
 
 
 
57
  @spaces.GPU()
58
  def get_image_gen_pipeline():
59
  global _image_gen_pipeline
@@ -439,7 +450,7 @@ def create_interface():
439
  gen3d_button = gr.Button("Create 3D visual with Trellis")
440
 
441
  video_output = gr.Video(label="Generated 3D Asset", autoplay=True, loop=True, height=300)
442
- model_output = LitModel3D(label="Extracted GLB/Gaussian", exposure=10.0, height=300)
443
 
444
  with gr.Row():
445
  download_glb = gr.DownloadButton(label="Download GLB", interactive=False)
@@ -569,6 +580,10 @@ def create_interface():
569
  # outputs=[download_gs, message_box]
570
  # )
571
 
 
 
 
 
572
  return demo
573
 
574
  if __name__ == "__main__":
 
54
  _trellis_pipeline = None
55
 
56
 
57
+ def start_session(req: gr.Request):
58
+ user_dir = os.path.join(TMP_DIR, str(req.session_hash))
59
+ os.makedirs(user_dir, exist_ok=True)
60
+
61
+
62
+ def end_session(req: gr.Request):
63
+ user_dir = os.path.join(TMP_DIR, str(req.session_hash))
64
+ shutil.rmtree(user_dir)
65
+
66
+
67
+
68
  @spaces.GPU()
69
  def get_image_gen_pipeline():
70
  global _image_gen_pipeline
 
450
  gen3d_button = gr.Button("Create 3D visual with Trellis")
451
 
452
  video_output = gr.Video(label="Generated 3D Asset", autoplay=True, loop=True, height=300)
453
+ # model_output = LitModel3D(label="Extracted GLB/Gaussian", exposure=10.0, height=300)
454
 
455
  with gr.Row():
456
  download_glb = gr.DownloadButton(label="Download GLB", interactive=False)
 
580
  # outputs=[download_gs, message_box]
581
  # )
582
 
583
+ # Handlers
584
+ demo.load(start_session)
585
+ demo.unload(end_session)
586
+
587
  return demo
588
 
589
  if __name__ == "__main__":