Skip to content

Commit

Permalink
master -> main
Browse files Browse the repository at this point in the history
Summary: Replace master with main in hard coded paths or mentions in documentation

Reviewed By: bottler

Differential Revision: D30696097

fbshipit-source-id: d5ff67bb026d90d1543d10ab027f916e8361ca69
  • Loading branch information
gkioxari authored and facebook-github-bot committed Sep 1, 2021
1 parent 1b8d86a commit 835e662
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
4 changes: 2 additions & 2 deletions pytorch3d/datasets/r2n2/r2n2.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
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],
Expand Down Expand Up @@ -295,7 +295,7 @@ def __getitem__(self, model_idx, view_idxs: Optional[List[int]] = None) -> Dict:

# 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],
Expand Down
18 changes: 9 additions & 9 deletions pytorch3d/datasets/r2n2/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,11 @@


# 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.
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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.
Expand Down

0 comments on commit 835e662

Please sign in to comment.