marta-marta commited on
Commit
5628022
·
1 Parent(s): 5fd57a0
Files changed (1) hide show
  1. app.py +13 -11
app.py CHANGED
@@ -8,6 +8,7 @@ from elasticity import elasticity
8
  import io
9
  from voxel_to_SDF_to_STL import voxel_to_sdf, sdf_to_stl, single_body_check
10
  from PIL import Image
 
11
 
12
  # Needed in requirements.txt for importing to use in the transformers model
13
  import tensorflow
@@ -457,17 +458,18 @@ if st.checkbox("Generate Linear Interpolation"):
457
  str((linear_sdf_max - abs(linear_sdf_min)) / 2))
458
 
459
  if st.checkbox("Generate STL Model"):
460
- # Generate the STL File
461
- linear_stl = convert_sdf_to_stl(linear_sdf, threshold_divisor=threshold_divisor_input)
462
-
463
- # Download the STL File
464
- with open(linear_stl, 'rb') as file:
465
- st.download_button(
466
- label='Download STL',
467
- data=file,
468
- file_name='linear_interpolation.stl',
469
- key='stl-download'
470
- )
 
471
 
472
  ########################################################################################################################
473
  # Provide User Options
 
8
  import io
9
  from voxel_to_SDF_to_STL import voxel_to_sdf, sdf_to_stl, single_body_check
10
  from PIL import Image
11
+ import time
12
 
13
  # Needed in requirements.txt for importing to use in the transformers model
14
  import tensorflow
 
458
  str((linear_sdf_max - abs(linear_sdf_min)) / 2))
459
 
460
  if st.checkbox("Generate STL Model"):
461
+ # Generate the STL File
462
+ time.sleep(5) # Add a delay to control the update rate
463
+ linear_stl = convert_sdf_to_stl(linear_sdf, threshold_divisor=threshold_divisor_input)
464
+
465
+ # Download the STL File
466
+ with open(linear_stl, 'rb') as file:
467
+ st.download_button(
468
+ label='Download STL',
469
+ data=file,
470
+ file_name='linear_interpolation.stl',
471
+ key='stl-download'
472
+ )
473
 
474
  ########################################################################################################################
475
  # Provide User Options