Spaces:
Paused
Paused
switch rec to predict command
Browse files
app.py
CHANGED
|
@@ -25,7 +25,7 @@ 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)
|
|
@@ -33,11 +33,19 @@ def run_on_gpu(input_point_cloud: gr.utils.NamedString,
|
|
| 33 |
# append 'rec' to the input file name
|
| 34 |
splitext_result = os.path.splitext(in_file)
|
| 35 |
out_file = splitext_result[0] + '_rec' + splitext_result[1]
|
|
|
|
|
|
|
| 36 |
|
| 37 |
args = [
|
| 38 |
-
'pps.py', '
|
| 39 |
-
|
| 40 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 41 |
'--gen_resolution_global', str(gen_resolution_global),
|
| 42 |
'--padding_factor', str(padding_factor),
|
| 43 |
'--gen_subsample_manifold_iter', str(gen_subsample_manifold_iter),
|
|
|
|
| 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)
|
|
|
|
| 33 |
# append 'rec' to the input file name
|
| 34 |
splitext_result = os.path.splitext(in_file)
|
| 35 |
out_file = splitext_result[0] + '_rec' + splitext_result[1]
|
| 36 |
+
out_dir = os.path.dirname(out_file)
|
| 37 |
+
model_path = 'models/ppsurf_50nn/version_0/checkpoints/last.ckpt'
|
| 38 |
|
| 39 |
args = [
|
| 40 |
+
'pps.py', 'predict',
|
| 41 |
+
'-c', 'ppsurf/configs/poco.yaml',
|
| 42 |
+
'-c', 'ppsurf/configs/ppsurf.yaml',
|
| 43 |
+
'-c', 'ppsurf/configs/ppsurf_50nn.yaml',
|
| 44 |
+
'--ckpt_path', model_path,
|
| 45 |
+
'--data.init_args.in_file', in_file,
|
| 46 |
+
'--model.init_args.results_dir', out_dir,
|
| 47 |
+
'--trainer.logger', 'False',
|
| 48 |
+
'--trainer.devices', '1'
|
| 49 |
'--gen_resolution_global', str(gen_resolution_global),
|
| 50 |
'--padding_factor', str(padding_factor),
|
| 51 |
'--gen_subsample_manifold_iter', str(gen_subsample_manifold_iter),
|