import torch


def pointToPixel(points:torch.Tensor, intrinsics:torch.Tensor):
    """
    Project 3D points to camera pixels.
    
    :param point: Tensor, 3D points (N x 3)
    :param intrinsics: Tensor, (3 x 3) intrinsic matrix
    :return: pixels coords (N x 2), [u, v]
    """

    with torch.no_grad():
        pointDepth = points[:, 2].repeat(3, 1).T
        pixels = torch.round((points @ intrinsics.T ) / pointDepth)
    return pixels