further remove depth output from frontend logic
Browse files
app.py
CHANGED
|
@@ -26,8 +26,6 @@ import io
|
|
| 26 |
sys.path.append("vggt/")
|
| 27 |
|
| 28 |
from visual_util import predictions_to_glb
|
| 29 |
-
from vggt.utils.pose_enc import pose_encoding_to_extri_intri
|
| 30 |
-
from vggt.utils.geometry import unproject_depth_map_to_point_map
|
| 31 |
|
| 32 |
# Remote VGGT service host
|
| 33 |
VGGT_HOST = os.getenv("VGGT_HOST", "134.199.133.34")
|
|
@@ -162,17 +160,8 @@ def run_model(target_dir, model=None) -> dict:
|
|
| 162 |
else:
|
| 163 |
predictions[key] = np.array(value)
|
| 164 |
|
| 165 |
-
#
|
| 166 |
-
print("
|
| 167 |
-
|
| 168 |
-
# Generate world points from depth map if not already present
|
| 169 |
-
if "world_points_from_depth" not in predictions and "depth" in predictions:
|
| 170 |
-
print("Computing world points from depth map...")
|
| 171 |
-
depth_map = predictions["depth"]
|
| 172 |
-
world_points = unproject_depth_map_to_point_map(
|
| 173 |
-
depth_map, predictions["extrinsic"], predictions["intrinsic"]
|
| 174 |
-
)
|
| 175 |
-
predictions["world_points_from_depth"] = world_points
|
| 176 |
|
| 177 |
return predictions
|
| 178 |
|
|
|
|
| 26 |
sys.path.append("vggt/")
|
| 27 |
|
| 28 |
from visual_util import predictions_to_glb
|
|
|
|
|
|
|
| 29 |
|
| 30 |
# Remote VGGT service host
|
| 31 |
VGGT_HOST = os.getenv("VGGT_HOST", "134.199.133.34")
|
|
|
|
| 160 |
else:
|
| 161 |
predictions[key] = np.array(value)
|
| 162 |
|
| 163 |
+
# Backend has already computed world_points_from_depth
|
| 164 |
+
print("Received predictions from backend")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 165 |
|
| 166 |
return predictions
|
| 167 |
|