Skip to content

Commit

Permalink
Add typing
Browse files Browse the repository at this point in the history
  • Loading branch information
AlanSavio25 committed Mar 25, 2024
1 parent adfb7cf commit 5cd4dd1
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions maploc/data/utils.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Copyright (c) Meta Platforms, Inc. and affiliates.

from typing import Tuple

import numpy as np
import torch
from scipy.spatial.transform import Rotation
Expand All @@ -16,7 +18,6 @@ def crop_map(raster, xy, size, seed=None):
xy -= np.array([left, top])
return raster, xy


def random_rot90(
raster: torch.Tensor,
tile_T_cam: Transform2D,
Expand Down Expand Up @@ -84,7 +85,9 @@ def compose_rotmat(roll, pitch, yaw):
return R_w2c.inv().as_matrix()


def decompose_cam_into_gcam(world_T_cam):
def decompose_cam_into_gcam(
world_T_cam: Transform3D,
) -> Tuple[Transform3D, torch.Tensor]:
"""Returns gravity-aligned cam's pose in world and camera frame"""

# gcam: gravity-aligned camera with z=optical axis
Expand Down

0 comments on commit 5cd4dd1

Please sign in to comment.