Camera inheritance + unprojections

Summary: Made a CameraBase class. Added `unproject_points` method for each camera class.

Reviewed By: nikhilaravi

Differential Revision: D20373602

fbshipit-source-id: 7e3da5ae420091b5fcab400a9884ef29ad7a7343
This commit is contained in:
David Novotny
2020-04-17 04:35:56 -07:00
committed by Facebook GitHub Bot
parent 365945b1fd
commit 7788a38050
4 changed files with 415 additions and 348 deletions

View File

@@ -1,6 +1,8 @@
# Copyright (c) Facebook, Inc. and its affiliates. All rights reserved.
import copy
import inspect
import warnings
from typing import Any, Union
@@ -168,10 +170,13 @@ class TensorProperties(object):
"""
for k in dir(self):
v = getattr(self, k)
if k == "device":
setattr(self, k, v)
if inspect.ismethod(v) or k.startswith("__"):
continue
if torch.is_tensor(v):
setattr(other, k, v.clone())
v_clone = v.clone()
else:
v_clone = copy.deepcopy(v)
setattr(other, k, v_clone)
return other
def gather_props(self, batch_idx):