Spaces:
Sleeping
Sleeping
init
Browse files
app.py
CHANGED
@@ -54,25 +54,25 @@ with gr.Blocks(css=CSS) as demo:
|
|
54 |
output_image = gr.Image(label="Output Range Map", elem_id='img-display-output')
|
55 |
output_pcd = gr.Model3D(label="Output Point Cloud", elem_id='pcd-display-output', interactive=False)
|
56 |
|
57 |
-
raw_file = gr.File(label="Point Cloud (.txt file). Can be viewed through Meshlab")
|
58 |
submit = gr.Button("Generate")
|
59 |
|
60 |
def on_submit(image):
|
61 |
cond = load_camera(image)
|
62 |
img, pcd = generate_lidar(model, cond)
|
63 |
|
64 |
-
tmp = tempfile.NamedTemporaryFile(suffix='.txt', delete=False)
|
65 |
-
pcd.save(tmp.name)
|
66 |
|
67 |
rgb_img = colorize_depth(img, log_scale=True)
|
68 |
|
69 |
-
return [rgb_img, pcd
|
70 |
|
71 |
-
submit.click(on_submit, inputs=[input_image], outputs=[output_image, output_pcd
|
72 |
|
73 |
example_files = sorted(os.listdir('cam_examples'))
|
74 |
example_files = [os.path.join('cam_examples', filename) for filename in example_files]
|
75 |
-
examples = gr.Examples(examples=example_files, inputs=[input_image], outputs=[output_image, output_pcd
|
76 |
fn=on_submit, cache_examples=False)
|
77 |
|
78 |
gr.Markdown(FOOTER)
|
|
|
54 |
output_image = gr.Image(label="Output Range Map", elem_id='img-display-output')
|
55 |
output_pcd = gr.Model3D(label="Output Point Cloud", elem_id='pcd-display-output', interactive=False)
|
56 |
|
57 |
+
# raw_file = gr.File(label="Point Cloud (.txt file). Can be viewed through Meshlab")
|
58 |
submit = gr.Button("Generate")
|
59 |
|
60 |
def on_submit(image):
|
61 |
cond = load_camera(image)
|
62 |
img, pcd = generate_lidar(model, cond)
|
63 |
|
64 |
+
# tmp = tempfile.NamedTemporaryFile(suffix='.txt', delete=False)
|
65 |
+
# pcd.save(tmp.name)
|
66 |
|
67 |
rgb_img = colorize_depth(img, log_scale=True)
|
68 |
|
69 |
+
return [rgb_img, pcd]
|
70 |
|
71 |
+
submit.click(on_submit, inputs=[input_image], outputs=[output_image, output_pcd])
|
72 |
|
73 |
example_files = sorted(os.listdir('cam_examples'))
|
74 |
example_files = [os.path.join('cam_examples', filename) for filename in example_files]
|
75 |
+
examples = gr.Examples(examples=example_files, inputs=[input_image], outputs=[output_image, output_pcd],
|
76 |
fn=on_submit, cache_examples=False)
|
77 |
|
78 |
gr.Markdown(FOOTER)
|