Spaces:
Paused
Paused
try obj output again, this time with conversion
Browse files
app.py
CHANGED
|
@@ -32,7 +32,7 @@ def run_on_gpu(input_point_cloud: gr.utils.NamedString,
|
|
| 32 |
out_dir = '/tmp/outputs/{}'.format(rand_hash)
|
| 33 |
out_file_basename = os.path.basename(in_file) + '.ply'
|
| 34 |
out_file = os.path.join(out_dir, os.path.basename(in_file), out_file_basename)
|
| 35 |
-
out_file_gradio = os.path.splitext(in_file)[0] + '_ppsurf.
|
| 36 |
print('in_file:', in_file)
|
| 37 |
print('out_dir:', out_dir)
|
| 38 |
print('out_file:', out_file)
|
|
@@ -65,9 +65,16 @@ def run_on_gpu(input_point_cloud: gr.utils.NamedString,
|
|
| 65 |
|
| 66 |
print('Finished inference at {}'.format(datetime.datetime.now()))
|
| 67 |
|
| 68 |
-
import shutil
|
| 69 |
-
shutil.copyfile(src=out_file, dst=out_file_gradio)
|
| 70 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 71 |
return out_file_gradio
|
| 72 |
|
| 73 |
|
|
|
|
| 32 |
out_dir = '/tmp/outputs/{}'.format(rand_hash)
|
| 33 |
out_file_basename = os.path.basename(in_file) + '.ply'
|
| 34 |
out_file = os.path.join(out_dir, os.path.basename(in_file), out_file_basename)
|
| 35 |
+
out_file_gradio = os.path.splitext(in_file)[0] + '_ppsurf.obj'
|
| 36 |
print('in_file:', in_file)
|
| 37 |
print('out_dir:', out_dir)
|
| 38 |
print('out_file:', out_file)
|
|
|
|
| 65 |
|
| 66 |
print('Finished inference at {}'.format(datetime.datetime.now()))
|
| 67 |
|
| 68 |
+
# import shutil
|
| 69 |
+
# shutil.copyfile(src=out_file, dst=out_file_gradio)
|
| 70 |
+
|
| 71 |
+
def _convert_mesh(in_file: str, out_file: str):
|
| 72 |
+
import trimesh
|
| 73 |
+
mesh = trimesh.load(in_file)
|
| 74 |
+
mesh.export(out_file)
|
| 75 |
+
|
| 76 |
+
_convert_mesh(in_file=out_file, out_file=out_file_gradio)
|
| 77 |
+
|
| 78 |
return out_file_gradio
|
| 79 |
|
| 80 |
|