Spaces:
Sleeping
Sleeping
marta-marta
commited on
Commit
·
5628022
1
Parent(s):
5fd57a0
Updating
Browse files
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 |
-
|
461 |
-
|
462 |
-
|
463 |
-
|
464 |
-
|
465 |
-
|
466 |
-
|
467 |
-
|
468 |
-
|
469 |
-
|
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
|