Skip to content

Commit

Permalink
Update the docstring for try_get_projection_transform
Browse files Browse the repository at this point in the history
Summary: Update the docstring for try_get_projection_transform on the API design.

Reviewed By: kjchalup

Differential Revision: D39227333

fbshipit-source-id: c9d0e625735d4972116d1f71865fb9b763e684de
  • Loading branch information
davidsonic authored and facebook-github-bot committed Sep 2, 2022
1 parent 84fa966 commit 8a96770
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions pytorch3d/renderer/cameras.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

import math
import warnings
from typing import List, Optional, Sequence, Tuple, Union
from typing import Any, Dict, List, Optional, Sequence, Tuple, Union

import numpy as np
import torch
Expand Down Expand Up @@ -1851,12 +1851,15 @@ def get_screen_to_ndc_transform(
return transform


def try_get_projection_transform(cameras: CamerasBase, kwargs) -> Optional[Transform3d]:
def try_get_projection_transform(
cameras: CamerasBase, cameras_kwargs: Dict[str, Any]
) -> Optional[Transform3d]:
"""
Try block to get projection transform.
Try block to get projection transform from cameras and cameras_kwargs.
Args:
cameras instance, can be linear cameras or nonliear cameras
cameras: cameras instance, can be linear cameras or nonliear cameras
cameras_kwargs: camera parameters to be passed to cameras
Returns:
If the camera implemented projection_transform, return the
Expand All @@ -1865,7 +1868,7 @@ def try_get_projection_transform(cameras: CamerasBase, kwargs) -> Optional[Trans

transform = None
try:
transform = cameras.get_projection_transform(**kwargs)
transform = cameras.get_projection_transform(**cameras_kwargs)
except NotImplementedError:
pass
return transform

0 comments on commit 8a96770

Please sign in to comment.