Spaces:
Paused
Paused
try subprocess again to resolve 'daemonic processes are not allowed to have children' error
Browse files
app.py
CHANGED
|
@@ -4,7 +4,6 @@ from __future__ import annotations
|
|
| 4 |
|
| 5 |
import os
|
| 6 |
import datetime
|
| 7 |
-
import subprocess
|
| 8 |
|
| 9 |
import gradio as gr
|
| 10 |
import spaces
|
|
@@ -25,8 +24,8 @@ def run_on_gpu(input_point_cloud: gr.utils.NamedString,
|
|
| 25 |
import os
|
| 26 |
import sys
|
| 27 |
sys.path.append(os.path.abspath('ppsurf'))
|
| 28 |
-
# os.chdir(os.path.dirname('./ppsurf'))
|
| 29 |
from ppsurf.pps import cli_main
|
|
|
|
| 30 |
|
| 31 |
in_file = '{}'.format(input_point_cloud.name)
|
| 32 |
|
|
@@ -53,8 +52,8 @@ def run_on_gpu(input_point_cloud: gr.utils.NamedString,
|
|
| 53 |
]
|
| 54 |
|
| 55 |
sys.argv = args
|
| 56 |
-
|
| 57 |
-
#
|
| 58 |
print('Finished inference at {}'.format(datetime.datetime.now()))
|
| 59 |
|
| 60 |
result_3d_model = out_file
|
|
@@ -80,6 +79,9 @@ def main():
|
|
| 80 |
Inference takes about 2 minutes.
|
| 81 |
'''
|
| 82 |
|
|
|
|
|
|
|
|
|
|
| 83 |
# def convert_to_ply(input_point_cloud_upload: gr.utils.NamedString):
|
| 84 |
#
|
| 85 |
# # add absolute path to import dirs
|
|
|
|
| 4 |
|
| 5 |
import os
|
| 6 |
import datetime
|
|
|
|
| 7 |
|
| 8 |
import gradio as gr
|
| 9 |
import spaces
|
|
|
|
| 24 |
import os
|
| 25 |
import sys
|
| 26 |
sys.path.append(os.path.abspath('ppsurf'))
|
|
|
|
| 27 |
from ppsurf.pps import cli_main
|
| 28 |
+
import subprocess
|
| 29 |
|
| 30 |
in_file = '{}'.format(input_point_cloud.name)
|
| 31 |
|
|
|
|
| 52 |
]
|
| 53 |
|
| 54 |
sys.argv = args
|
| 55 |
+
subprocess.run(['python'] + args)
|
| 56 |
+
# cli_main()
|
| 57 |
print('Finished inference at {}'.format(datetime.datetime.now()))
|
| 58 |
|
| 59 |
result_3d_model = out_file
|
|
|
|
| 79 |
Inference takes about 2 minutes.
|
| 80 |
'''
|
| 81 |
|
| 82 |
+
# can't render many input types directly in Gradio Model3D
|
| 83 |
+
# so we need to convert to supported format
|
| 84 |
+
# Gradio can't draw point clouds anyway, so we skip this for now
|
| 85 |
# def convert_to_ply(input_point_cloud_upload: gr.utils.NamedString):
|
| 86 |
#
|
| 87 |
# # add absolute path to import dirs
|