Spaces:
Running
on
Zero
Running
on
Zero
Update code for .ply file downloading
Browse files
app.py
CHANGED
@@ -466,6 +466,7 @@ def gradio_demo(
|
|
466 |
# we save a .ply file too
|
467 |
plyfile = glbfile.replace('.glb', '.ply')
|
468 |
write_ply(pcd[0], pcd[1]/255, path=plyfile)
|
|
|
469 |
|
470 |
# Cleanup
|
471 |
del predictions
|
@@ -531,7 +532,7 @@ def update_visualization(
|
|
531 |
)
|
532 |
|
533 |
if not os.path.exists(glbfile):
|
534 |
-
glbscene,
|
535 |
predictions,
|
536 |
conf_thres=conf_thres,
|
537 |
filter_by_frames=frame_filter,
|
@@ -539,7 +540,10 @@ def update_visualization(
|
|
539 |
)
|
540 |
glbscene.export(file_obj=glbfile)
|
541 |
|
542 |
-
|
|
|
|
|
|
|
543 |
|
544 |
return glbfile, "Updating Visualization"
|
545 |
|
|
|
466 |
# we save a .ply file too
|
467 |
plyfile = glbfile.replace('.glb', '.ply')
|
468 |
write_ply(pcd[0], pcd[1]/255, path=plyfile)
|
469 |
+
print(f'Saved .ply file to {plyfile}')
|
470 |
|
471 |
# Cleanup
|
472 |
del predictions
|
|
|
532 |
)
|
533 |
|
534 |
if not os.path.exists(glbfile):
|
535 |
+
glbscene, pcd = predictions_to_glb(
|
536 |
predictions,
|
537 |
conf_thres=conf_thres,
|
538 |
filter_by_frames=frame_filter,
|
|
|
540 |
)
|
541 |
glbscene.export(file_obj=glbfile)
|
542 |
|
543 |
+
# we save a .ply file too
|
544 |
+
plyfile = glbfile.replace('.glb', '.ply')
|
545 |
+
write_ply(pcd[0], pcd[1]/255, path=plyfile)
|
546 |
+
print(f'Saved .ply file to {plyfile}')
|
547 |
|
548 |
return glbfile, "Updating Visualization"
|
549 |
|