From 835e662fb582e3b506ab500b39eebb1191098745 Mon Sep 17 00:00:00 2001 From: Georgia Gkioxari Date: Wed, 1 Sep 2021 05:32:28 -0700 Subject: [PATCH] master -> main Summary: Replace master with main in hard coded paths or mentions in documentation Reviewed By: bottler Differential Revision: D30696097 fbshipit-source-id: d5ff67bb026d90d1543d10ab027f916e8361ca69 --- pytorch3d/datasets/r2n2/r2n2.py | 4 ++-- pytorch3d/datasets/r2n2/utils.py | 18 +++++++++--------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/pytorch3d/datasets/r2n2/r2n2.py b/pytorch3d/datasets/r2n2/r2n2.py index 4bbc9337..6e261eb0 100644 --- a/pytorch3d/datasets/r2n2/r2n2.py +++ b/pytorch3d/datasets/r2n2/r2n2.py @@ -31,7 +31,7 @@ SYNSET_DICT_DIR = Path(__file__).resolve().parent MAX_CAMERA_DISTANCE = 1.75 # Constant from R2N2. VOXEL_SIZE = 128 # Intrinsic matrix extracted from Blender. Taken from meshrcnn codebase: -# https://github.com/facebookresearch/meshrcnn/blob/master/shapenet/utils/coords.py +# https://github.com/facebookresearch/meshrcnn/blob/main/shapenet/utils/coords.py BLENDER_INTRINSIC = torch.tensor( [ [2.1875, 0.0, 0.0, 0.0], @@ -295,7 +295,7 @@ class R2N2(ShapeNetBase): # pragma: no cover # Intrinsic matrix extracted from the Blender with slight modification to work with # PyTorch3D world space. Taken from meshrcnn codebase: - # https://github.com/facebookresearch/meshrcnn/blob/master/shapenet/utils/coords.py + # https://github.com/facebookresearch/meshrcnn/blob/main/shapenet/utils/coords.py K = torch.tensor( [ [2.1875, 0.0, 0.0, 0.0], diff --git a/pytorch3d/datasets/r2n2/utils.py b/pytorch3d/datasets/r2n2/utils.py index 1ef00fdf..b1162c98 100644 --- a/pytorch3d/datasets/r2n2/utils.py +++ b/pytorch3d/datasets/r2n2/utils.py @@ -25,11 +25,11 @@ from pytorch3d.transforms import Transform3d # Empirical min and max over the dataset from meshrcnn. -# https://github.com/facebookresearch/meshrcnn/blob/master/shapenet/utils/coords.py#L9 +# https://github.com/facebookresearch/meshrcnn/blob/main/shapenet/utils/coords.py#L9 SHAPENET_MIN_ZMIN = 0.67 SHAPENET_MAX_ZMAX = 0.92 # Threshold for cubify from meshrcnn: -# https://github.com/facebookresearch/meshrcnn/blob/master/configs/shapenet/voxmesh_R50.yaml#L11 +# https://github.com/facebookresearch/meshrcnn/blob/main/configs/shapenet/voxmesh_R50.yaml#L11 CUBIFY_THRESH = 0.2 # Default values of rotation, translation and intrinsic matrices for BlenderCamera. @@ -101,7 +101,7 @@ def collate_batched_R2N2(batch: List[Dict]): # pragma: no cover def compute_extrinsic_matrix(azimuth, elevation, distance): # pragma: no cover """ Copied from meshrcnn codebase: - https://github.com/facebookresearch/meshrcnn/blob/master/shapenet/utils/coords.py#L96 + https://github.com/facebookresearch/meshrcnn/blob/main/shapenet/utils/coords.py#L96 Compute 4x4 extrinsic matrix that converts from homogeneous world coordinates to homogeneous camera coordinates. We assume that the camera is looking at the @@ -151,7 +151,7 @@ def read_binvox_coords( ): # pragma: no cover """ Copied from meshrcnn codebase: - https://github.com/facebookresearch/meshrcnn/blob/master/shapenet/utils/binvox_torch.py#L5 + https://github.com/facebookresearch/meshrcnn/blob/main/shapenet/utils/binvox_torch.py#L5 Read a binvox file and return the indices of all nonzero voxels. @@ -194,7 +194,7 @@ def read_binvox_coords( def _compute_idxs(vals, counts): # pragma: no cover """ Copied from meshrcnn codebase: - https://github.com/facebookresearch/meshrcnn/blob/master/shapenet/utils/binvox_torch.py#L58 + https://github.com/facebookresearch/meshrcnn/blob/main/shapenet/utils/binvox_torch.py#L58 Fast vectorized version of index computation. @@ -247,7 +247,7 @@ def _compute_idxs(vals, counts): # pragma: no cover def _read_binvox_header(f): # pragma: no cover """ Copied from meshrcnn codebase: - https://github.com/facebookresearch/meshrcnn/blob/master/shapenet/utils/binvox_torch.py#L99 + https://github.com/facebookresearch/meshrcnn/blob/main/shapenet/utils/binvox_torch.py#L99 Read binvox header and extract information regarding voxel sizes and translations to original voxel coordinates. @@ -311,7 +311,7 @@ def _read_binvox_header(f): # pragma: no cover def align_bbox(src, tgt): # pragma: no cover """ Copied from meshrcnn codebase: - https://github.com/facebookresearch/meshrcnn/blob/master/tools/preprocess_shapenet.py#L263 + https://github.com/facebookresearch/meshrcnn/blob/main/tools/preprocess_shapenet.py#L263 Return a copy of src points in the coordinate system of tgt by applying a scale and shift along each coordinate axis to make the min / max values align. @@ -341,7 +341,7 @@ def align_bbox(src, tgt): # pragma: no cover def voxelize(voxel_coords, P, V): # pragma: no cover """ Copied from meshrcnn codebase: - https://github.com/facebookresearch/meshrcnn/blob/master/tools/preprocess_shapenet.py#L284 + https://github.com/facebookresearch/meshrcnn/blob/main/tools/preprocess_shapenet.py#L284 but changing flip y to flip x. Creating voxels of shape (D, D, D) from voxel_coords and projection matrix. @@ -388,7 +388,7 @@ def voxelize(voxel_coords, P, V): # pragma: no cover def project_verts(verts, P, eps=1e-1): # pragma: no cover """ Copied from meshrcnn codebase: - https://github.com/facebookresearch/meshrcnn/blob/master/shapenet/utils/coords.py#L159 + https://github.com/facebookresearch/meshrcnn/blob/main/shapenet/utils/coords.py#L159 Project vertices using a 4x4 transformation matrix.