MohamedRashad commited on
Commit
20b2f53
·
1 Parent(s): a430594

Add OpenGL platform environment variable and improve UI layout in create_app function

Browse files
Files changed (1) hide show
  1. app.py +12 -7
app.py CHANGED
@@ -1,3 +1,6 @@
 
 
 
1
  import shutil
2
  import subprocess
3
  import time
@@ -364,6 +367,7 @@ def create_app():
364
  5. **Download results** - Different files will be generated based on your selected mode
365
 
366
  **Supported File Formats:** .obj, .fbx, .glb
 
367
  **Note:** The process may take a few minutes depending on the model complexity and server load.
368
  """)
369
 
@@ -371,13 +375,14 @@ def create_app():
371
  with gr.Column(scale=1):
372
  input_3d_model = gr.Model3D(label="Upload 3D Model")
373
 
374
- with gr.Row(equal_height=True):
375
- seed = gr.Number(
376
- value=int(torch.randint(0, 100000, (1,)).item()),
377
- label="Random Seed (for reproducible results)",
378
- scale=4,
379
- )
380
- random_btn = gr.Button("🔄 Random Seed", variant="secondary", scale=1)
 
381
 
382
  pipeline_btn = gr.Button("🎯 Start Processing", variant="primary", size="lg")
383
 
 
1
+ import os
2
+ os.environ["PYOPENGL_PLATFORM"] = "osmesa"
3
+
4
  import shutil
5
  import subprocess
6
  import time
 
367
  5. **Download results** - Different files will be generated based on your selected mode
368
 
369
  **Supported File Formats:** .obj, .fbx, .glb
370
+
371
  **Note:** The process may take a few minutes depending on the model complexity and server load.
372
  """)
373
 
 
375
  with gr.Column(scale=1):
376
  input_3d_model = gr.Model3D(label="Upload 3D Model")
377
 
378
+ with gr.Group():
379
+ with gr.Row(equal_height=True):
380
+ seed = gr.Number(
381
+ value=int(torch.randint(0, 100000, (1,)).item()),
382
+ label="Random Seed (for reproducible results)",
383
+ scale=4,
384
+ )
385
+ random_btn = gr.Button("🔄 Random Seed", variant="secondary", scale=1)
386
 
387
  pipeline_btn = gr.Button("🎯 Start Processing", variant="primary", size="lg")
388