Skip to content

Commit

Permalink
Merge branch 'lucidrains:main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
MarcusLoppe authored Jul 9, 2024
2 parents a8880ad + d3e0486 commit 8985669
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
10 changes: 9 additions & 1 deletion meshgpt_pytorch/meshgpt_pytorch.py
Original file line number Diff line number Diff line change
Expand Up @@ -157,10 +157,18 @@ def derive_angle(x, y, eps = 1e-5):
def get_derived_face_features(
face_coords: Float['b nf nvf 3'] # 3 or 4 vertices with 3 coordinates
):
shifted_face_coords = torch.cat((face_coords[:, :, -1:], face_coords[:, :, :-1]), dim = 2)
is_quad = face_coords.shape[-2] == 4

# shift face coordinates depending on triangles or quads

shifted_face_coords = torch.roll(face_coords, 1, dims = (2,))

angles = derive_angle(face_coords, shifted_face_coords)

if is_quad:
# @sbriseid says quads need to be shifted by 2
shifted_face_coords = torch.roll(shifted_face_coords, 1, dims = (2,))

edge1, edge2, *_ = (face_coords - shifted_face_coords).unbind(dim = 2)

cross_product = torch.cross(edge1, edge2, dim = -1)
Expand Down
2 changes: 1 addition & 1 deletion meshgpt_pytorch/version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = '1.5.7'
__version__ = '1.5.12'
3 changes: 2 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,11 @@
'environs',
'gateloop-transformer>=0.2.2',
'jaxtyping',
'local-attention>=1.9.0',
'local-attention>=1.9.11',
'numpy',
'pytorch-custom-utils>=0.0.9',
'rotary-embedding-torch>=0.6.4',
'sentencepiece',
'taylor-series-linear-attention>=0.1.6',
'torch>=2.1',
'torch_geometric',
Expand Down

0 comments on commit 8985669

Please sign in to comment.