perler commited on
Commit
50919d2
1 Parent(s): d2301e4

try own folder

Browse files
Files changed (1) hide show
  1. app.py +9 -5
app.py CHANGED
@@ -2,6 +2,7 @@
2
 
3
  from __future__ import annotations
4
 
 
5
  import os
6
  import datetime
7
 
@@ -21,18 +22,20 @@ def run_on_gpu(input_point_cloud: gr.utils.NamedString,
21
  print('Types:', type(input_point_cloud), type(gen_resolution_global), type(padding_factor),
22
  type(gen_subsample_manifold_iter), type(gen_refine_iter))
23
 
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
 
32
  # append 'rec' to the input file name
33
- splitext_result = os.path.splitext(in_file)
34
- out_file = splitext_result[0] + '_rec' + splitext_result[1]
35
- out_dir = os.path.dirname(out_file)
 
 
 
36
  os.makedirs(out_dir, exist_ok=True)
37
  model_path = 'models/ppsurf_50nn/version_0/checkpoints/last.ckpt'
38
 
@@ -200,4 +203,5 @@ def main():
200
 
201
 
202
  if __name__ == '__main__':
 
203
  main()
 
2
 
3
  from __future__ import annotations
4
 
5
+ import sys
6
  import os
7
  import datetime
8
 
 
22
  print('Types:', type(input_point_cloud), type(gen_resolution_global), type(padding_factor),
23
  type(gen_subsample_manifold_iter), type(gen_refine_iter))
24
 
 
 
25
  sys.path.append(os.path.abspath('ppsurf'))
26
  # from ppsurf.pps import cli_main
27
  import subprocess
28
+ import random
29
 
30
  in_file = '{}'.format(input_point_cloud.name)
31
 
32
  # append 'rec' to the input file name
33
+ # splitext_result = os.path.splitext(in_file)
34
+ rand_hash = random.getrandbits(128)
35
+ out_dir = '/tmp/outputs/{}'.format(rand_hash)
36
+ # out_file = os.path.join(out_dir, in_file, in_file + '.ply')
37
+ out_file_basename = os.path.basename(in_file) + '.ply'
38
+ out_file = os.path.join(out_dir, os.path.basename(in_file), out_file_basename)
39
  os.makedirs(out_dir, exist_ok=True)
40
  model_path = 'models/ppsurf_50nn/version_0/checkpoints/last.ckpt'
41
 
 
203
 
204
 
205
  if __name__ == '__main__':
206
+ print(os.environ)
207
  main()