Spaces:
Running
on
Zero
Running
on
Zero
fix output of inference
Browse files
app.py
CHANGED
|
@@ -120,8 +120,8 @@ def run_model(target_dir, model) -> dict:
|
|
| 120 |
# Convert pose encoding to extrinsic and intrinsic matrices
|
| 121 |
print("Converting pose encoding to extrinsic and intrinsic matrices...")
|
| 122 |
extrinsic, intrinsic = pose_encoding_to_extri_intri(predictions["pose_enc"].unsqueeze(0) if predictions["pose_enc"].ndim == 2 else predictions["pose_enc"], images.shape[-2:])
|
| 123 |
-
predictions["extrinsic"] = extrinsic
|
| 124 |
-
predictions["intrinsic"] = intrinsic
|
| 125 |
print("Extrinsic shape:", predictions["extrinsic"].shape)
|
| 126 |
print("Intrinsic shape:", predictions["intrinsic"].shape)
|
| 127 |
|
|
|
|
| 120 |
# Convert pose encoding to extrinsic and intrinsic matrices
|
| 121 |
print("Converting pose encoding to extrinsic and intrinsic matrices...")
|
| 122 |
extrinsic, intrinsic = pose_encoding_to_extri_intri(predictions["pose_enc"].unsqueeze(0) if predictions["pose_enc"].ndim == 2 else predictions["pose_enc"], images.shape[-2:])
|
| 123 |
+
predictions["extrinsic"] = extrinsic.squeeze(0) # (S, 3, 4)
|
| 124 |
+
predictions["intrinsic"] = intrinsic.squeeze(0) if intrinsic is not None else None # (S, 3, 3) or None
|
| 125 |
print("Extrinsic shape:", predictions["extrinsic"].shape)
|
| 126 |
print("Intrinsic shape:", predictions["intrinsic"].shape)
|
| 127 |
|