Update app.py
Browse files
app.py
CHANGED
|
@@ -46,7 +46,7 @@ def draw_points(start, length, canvas_shape, theta, phi, radius, color):
|
|
| 46 |
|
| 47 |
def project_point_cloud(input_file):
|
| 48 |
try:
|
| 49 |
-
point_cloud = laspy.read(input_file)
|
| 50 |
except FileNotFoundError:
|
| 51 |
return "Input file not found."
|
| 52 |
|
|
@@ -72,7 +72,7 @@ def project_point_cloud(input_file):
|
|
| 72 |
shm_canvas = create_shared_memory_array(background, SHARED_MEMORY_NAME, np.uint16)
|
| 73 |
|
| 74 |
processes = []
|
| 75 |
-
num_threads = min(NUM_WORKERS, 4)
|
| 76 |
for i in range(num_threads):
|
| 77 |
start = floor(i * total_points / num_threads)
|
| 78 |
end = floor((i + 1) * total_points / num_threads)
|
|
@@ -99,8 +99,8 @@ def main(input_file):
|
|
| 99 |
|
| 100 |
iface = gr.Interface(
|
| 101 |
fn=main,
|
| 102 |
-
inputs=gr.
|
| 103 |
-
outputs=gr.
|
| 104 |
title="Point Cloud Projection",
|
| 105 |
description="Upload a LAS file to project the point cloud into an image."
|
| 106 |
)
|
|
|
|
| 46 |
|
| 47 |
def project_point_cloud(input_file):
|
| 48 |
try:
|
| 49 |
+
point_cloud = laspy.read(input_file.name)
|
| 50 |
except FileNotFoundError:
|
| 51 |
return "Input file not found."
|
| 52 |
|
|
|
|
| 72 |
shm_canvas = create_shared_memory_array(background, SHARED_MEMORY_NAME, np.uint16)
|
| 73 |
|
| 74 |
processes = []
|
| 75 |
+
num_threads = min(NUM_WORKERS, 4)
|
| 76 |
for i in range(num_threads):
|
| 77 |
start = floor(i * total_points / num_threads)
|
| 78 |
end = floor((i + 1) * total_points / num_threads)
|
|
|
|
| 99 |
|
| 100 |
iface = gr.Interface(
|
| 101 |
fn=main,
|
| 102 |
+
inputs=gr.File(label="Upload LAS File"),
|
| 103 |
+
outputs=gr.Image(type="file", label="Output Image"),
|
| 104 |
title="Point Cloud Projection",
|
| 105 |
description="Upload a LAS file to project the point cloud into an image."
|
| 106 |
)
|