Skip to content

Typo in transform_points #12

@Schmiddo

Description

@Schmiddo

Hi, thank you for open-sourcing this amazing library!

The torch version of utils3d.transform_points seems to be broken, due to a typo that slices instead of adding a unit dimension (as in the numpy version, which works correctly).

Steps to reproduce:

import numpy as np
import torch
import utils3d

T = np.random.randn(3, 4)
P = np.random.randn(90, 3)

print(utils3d.transform_points(P, T).shape)

# raises error
print(utils3d.transform_points(torch.from_numpy(P), torch.from_numpy(T)).shape)

# larger inputs to trigger the einsum-based path
T = np.random.randn(8, 4, 1, 1, 3, 4)
P = np.random.randn(8, 4, 60, 90, 3)

print(utils3d.transform_points(P, T).shape)

# raises error
print(utils3d.transform_points(torch.from_numpy(P), torch.from_numpy(T)).shape)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions