Commit 3de3c13a authored by Xie Fangyuan's avatar Xie Fangyuan Committed by Facebook GitHub Bot
Browse files

R2n2 (#1124)

Summary:
1. Fix https://github.com/facebookresearch/pytorch3d/issues/1115 Change the type annatations of three arguments in the initializer of `R2N2` class.
2. Fix https://github.com/facebookresearch/pytorch3d/issues/1118 Override two functions in `BlenderCamera` class reruired by subclassing `CamerasBase` class.

Pull Request resolved: https://github.com/facebookresearch/pytorch3d/pull/1124

Reviewed By: nikhilaravi

Differential Revision: D34890900

Pulled By: bottler

fbshipit-source-id: 65c385369a5964ecbb17ab28f279d5284614b487
parent 9b5a3ffa
......@@ -55,9 +55,9 @@ class R2N2(ShapeNetBase): # pragma: no cover
def __init__(
self,
split: str,
shapenet_dir,
r2n2_dir,
splits_file,
shapenet_dir: str,
r2n2_dir: str,
splits_file: str,
return_all_views: bool = True,
return_voxels: bool = False,
views_rel_path: str = "ShapeNetRendering",
......@@ -70,9 +70,9 @@ class R2N2(ShapeNetBase): # pragma: no cover
Args:
split (str): One of (train, val, test).
shapenet_dir (path): Path to ShapeNet core v1.
r2n2_dir (path): Path to the R2N2 dataset.
splits_file (path): File containing the train/val/test splits.
shapenet_dir (str): Path to ShapeNet core v1.
r2n2_dir (str): Path to the R2N2 dataset.
splits_file (str): File containing the train/val/test splits.
return_all_views (bool): Indicator of whether or not to load all the views in
the split. If set to False, one of the views in the split will be randomly
selected and loaded.
......
......@@ -459,6 +459,12 @@ class BlenderCamera(CamerasBase): # pragma: no cover
transform._matrix = self.K.transpose(1, 2).contiguous()
return transform
def is_perspective(self):
return False
def in_ndc(self):
return True
def render_cubified_voxels(
voxels: torch.Tensor, shader_type=HardPhongShader, device: Device = "cpu", **kwargs
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment