mirror of
https://github.com/facebookresearch/pytorch3d.git
synced 2026-03-12 15:35:58 +08:00
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:
committed by
Facebook GitHub Bot
parent
365945b1fd
commit
7788a38050
@@ -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):
|
||||
|
||||
Reference in New Issue
Block a user