mirror of
https://github.com/facebookresearch/pytorch3d.git
synced 2025-08-02 20:02:49 +08:00
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
This commit is contained in:
parent
1b8d86a104
commit
835e662fb5
@ -31,7 +31,7 @@ SYNSET_DICT_DIR = Path(__file__).resolve().parent
|
|||||||
MAX_CAMERA_DISTANCE = 1.75 # Constant from R2N2.
|
MAX_CAMERA_DISTANCE = 1.75 # Constant from R2N2.
|
||||||
VOXEL_SIZE = 128
|
VOXEL_SIZE = 128
|
||||||
# Intrinsic matrix extracted from Blender. Taken from meshrcnn codebase:
|
# 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(
|
BLENDER_INTRINSIC = torch.tensor(
|
||||||
[
|
[
|
||||||
[2.1875, 0.0, 0.0, 0.0],
|
[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
|
# Intrinsic matrix extracted from the Blender with slight modification to work with
|
||||||
# PyTorch3D world space. Taken from meshrcnn codebase:
|
# 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(
|
K = torch.tensor(
|
||||||
[
|
[
|
||||||
[2.1875, 0.0, 0.0, 0.0],
|
[2.1875, 0.0, 0.0, 0.0],
|
||||||
|
@ -25,11 +25,11 @@ from pytorch3d.transforms import Transform3d
|
|||||||
|
|
||||||
|
|
||||||
# Empirical min and max over the dataset from meshrcnn.
|
# 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_MIN_ZMIN = 0.67
|
||||||
SHAPENET_MAX_ZMAX = 0.92
|
SHAPENET_MAX_ZMAX = 0.92
|
||||||
# Threshold for cubify from meshrcnn:
|
# 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
|
CUBIFY_THRESH = 0.2
|
||||||
|
|
||||||
# Default values of rotation, translation and intrinsic matrices for BlenderCamera.
|
# 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
|
def compute_extrinsic_matrix(azimuth, elevation, distance): # pragma: no cover
|
||||||
"""
|
"""
|
||||||
Copied from meshrcnn codebase:
|
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
|
Compute 4x4 extrinsic matrix that converts from homogeneous world coordinates
|
||||||
to homogeneous camera coordinates. We assume that the camera is looking at the
|
to homogeneous camera coordinates. We assume that the camera is looking at the
|
||||||
@ -151,7 +151,7 @@ def read_binvox_coords(
|
|||||||
): # pragma: no cover
|
): # pragma: no cover
|
||||||
"""
|
"""
|
||||||
Copied from meshrcnn codebase:
|
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.
|
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
|
def _compute_idxs(vals, counts): # pragma: no cover
|
||||||
"""
|
"""
|
||||||
Copied from meshrcnn codebase:
|
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.
|
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
|
def _read_binvox_header(f): # pragma: no cover
|
||||||
"""
|
"""
|
||||||
Copied from meshrcnn codebase:
|
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
|
Read binvox header and extract information regarding voxel sizes and translations
|
||||||
to original voxel coordinates.
|
to original voxel coordinates.
|
||||||
@ -311,7 +311,7 @@ def _read_binvox_header(f): # pragma: no cover
|
|||||||
def align_bbox(src, tgt): # pragma: no cover
|
def align_bbox(src, tgt): # pragma: no cover
|
||||||
"""
|
"""
|
||||||
Copied from meshrcnn codebase:
|
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
|
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.
|
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
|
def voxelize(voxel_coords, P, V): # pragma: no cover
|
||||||
"""
|
"""
|
||||||
Copied from meshrcnn codebase:
|
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.
|
but changing flip y to flip x.
|
||||||
|
|
||||||
Creating voxels of shape (D, D, D) from voxel_coords and projection matrix.
|
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
|
def project_verts(verts, P, eps=1e-1): # pragma: no cover
|
||||||
"""
|
"""
|
||||||
Copied from meshrcnn codebase:
|
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.
|
Project vertices using a 4x4 transformation matrix.
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user