Spaces:
Running
on
Zero
Running
on
Zero
hengli
commited on
Commit
·
c2778d7
1
Parent(s):
6da3f2e
adding samples
Browse files- app.py +10 -10
- sailrecon/models/sail_recon.py +0 -1
app.py
CHANGED
|
@@ -91,7 +91,7 @@ def run_model(target_dir, model, anchor_size=100) -> dict:
|
|
| 91 |
for img_split in images.split(15, dim=0):
|
| 92 |
pbar.update(15)
|
| 93 |
predictions_s += to_cpu(
|
| 94 |
-
model.reloc(img_split, ret_img=True, memory_save=
|
| 95 |
)
|
| 96 |
|
| 97 |
predictions = {}
|
|
@@ -110,12 +110,12 @@ def run_model(target_dir, model, anchor_size=100) -> dict:
|
|
| 110 |
predictions["images"] = torch.cat(
|
| 111 |
[s["images"] for s in predictions_s], dim=0
|
| 112 |
) # (S, H, W, 3)
|
| 113 |
-
predictions["world_points"] = torch.cat(
|
| 114 |
-
|
| 115 |
-
) # (S, H, W, 3)
|
| 116 |
-
predictions["world_points_conf"] = torch.cat(
|
| 117 |
-
|
| 118 |
-
) # (S, H, W, 3)
|
| 119 |
predictions["pose_enc"] = extri_intri_to_pose_encoding(
|
| 120 |
predictions["extrinsic"].unsqueeze(0),
|
| 121 |
predictions["intrinsic"].unsqueeze(0),
|
|
@@ -378,8 +378,8 @@ def update_visualization(
|
|
| 378 |
"pose_enc",
|
| 379 |
"depth",
|
| 380 |
"depth_conf",
|
| 381 |
-
"world_points",
|
| 382 |
-
"world_points_conf",
|
| 383 |
"images",
|
| 384 |
"extrinsic",
|
| 385 |
"intrinsic",
|
|
@@ -567,7 +567,7 @@ with gr.Blocks(
|
|
| 567 |
|
| 568 |
with gr.Row():
|
| 569 |
prediction_mode = gr.Radio(
|
| 570 |
-
["Depthmap and Camera Branch"
|
| 571 |
label="Select a Prediction Mode",
|
| 572 |
value="Depthmap and Camera Branch",
|
| 573 |
scale=1,
|
|
|
|
| 91 |
for img_split in images.split(15, dim=0):
|
| 92 |
pbar.update(15)
|
| 93 |
predictions_s += to_cpu(
|
| 94 |
+
model.reloc(img_split, ret_img=True, memory_save=True)
|
| 95 |
)
|
| 96 |
|
| 97 |
predictions = {}
|
|
|
|
| 110 |
predictions["images"] = torch.cat(
|
| 111 |
[s["images"] for s in predictions_s], dim=0
|
| 112 |
) # (S, H, W, 3)
|
| 113 |
+
# predictions["world_points"] = torch.cat(
|
| 114 |
+
# [s["point_map"] for s in predictions_s], dim=0
|
| 115 |
+
# ) # (S, H, W, 3)
|
| 116 |
+
# predictions["world_points_conf"] = torch.cat(
|
| 117 |
+
# [s["xyz_cnf"] for s in predictions_s], dim=0
|
| 118 |
+
# ) # (S, H, W, 3)
|
| 119 |
predictions["pose_enc"] = extri_intri_to_pose_encoding(
|
| 120 |
predictions["extrinsic"].unsqueeze(0),
|
| 121 |
predictions["intrinsic"].unsqueeze(0),
|
|
|
|
| 378 |
"pose_enc",
|
| 379 |
"depth",
|
| 380 |
"depth_conf",
|
| 381 |
+
# "world_points",
|
| 382 |
+
# "world_points_conf",
|
| 383 |
"images",
|
| 384 |
"extrinsic",
|
| 385 |
"intrinsic",
|
|
|
|
| 567 |
|
| 568 |
with gr.Row():
|
| 569 |
prediction_mode = gr.Radio(
|
| 570 |
+
["Depthmap and Camera Branch"],
|
| 571 |
label="Select a Prediction Mode",
|
| 572 |
value="Depthmap and Camera Branch",
|
| 573 |
scale=1,
|
sailrecon/models/sail_recon.py
CHANGED
|
@@ -162,7 +162,6 @@ class SailRecon(nn.Module, PyTorchModelHubMixin):
|
|
| 162 |
predictions["point_map_by_unprojection"] = point_map_by_unprojection[
|
| 163 |
None
|
| 164 |
]
|
| 165 |
-
|
| 166 |
predictions["point_map"] = xyz_map
|
| 167 |
predictions["rgbs"] = rgbs
|
| 168 |
predictions["xyz_cnf"] = xyz_cnf
|
|
|
|
| 162 |
predictions["point_map_by_unprojection"] = point_map_by_unprojection[
|
| 163 |
None
|
| 164 |
]
|
|
|
|
| 165 |
predictions["point_map"] = xyz_map
|
| 166 |
predictions["rgbs"] = rgbs
|
| 167 |
predictions["xyz_cnf"] = xyz_cnf
|