프로젝트
GitHub에서 보기
lucidrains/point-transformer-pytorch
소개
PyTorch로 구현한 Point Transformer 레이어
AI 및 머신러닝측정된 스타 증가
- in 24h
- 0
- in 7 days
- 0
- in 15 days
- 0
- in 1 month
- 기록 수집 중
서로 겹치는 기간의 순증가량이며 일별 합계가 아닙니다. 측정값이 없으면 비워 둡니다. 스타는 관심도를 나타내며 품질을 보장하지 않습니다.
README.md
Original
Point Transformer - Pytorch
Implementation of the Point Transformer self-attention layer, in Pytorch. The simple circuit above seemed to have allowed their group to outperform all previous methods in point cloud classification and segmentation.
Install
$ pip install point-transformer-pytorch
Usage
import torch
from point_transformer_pytorch import PointTransformerLayer
attn = PointTransformerLayer(
dim = 128,
pos_mlp_hidden_dim = 64,
attn_mlp_hidden_mult = 4
)
feats = torch.randn(1, 16, 128)
pos = torch.randn(1, 16, 3)
mask = torch.ones(1, 16).bool()
attn(feats, pos, mask = mask) # (1, 16, 128)
This type of vector attention is much more expensive than the traditional one. In the paper, they used k-nearest neighbors on the points to exclude attention on faraway points. You can do the same with a single extra setting.
import torch
from point_transformer_pytorch import PointTransformerLayer
attn = PointTransformerLayer(
dim = 128,
pos_mlp_hidden_dim = 64,
attn_mlp_hidden_mult = 4,
num_neighbors = 16 # only the 16 nearest neighbors would be attended to for each point
)
feats = torch.randn(1, 2048, 128)
pos = torch.randn(1, 2048, 3)
mask = torch.ones(1, 2048).bool()
attn(feats, pos, mask = mask) # (1, 16, 128)
Citations
@misc{zhao2020point,
title={Point Transformer},
author={Hengshuang Zhao and Li Jiang and Jiaya Jia and Philip Torr and Vladlen Koltun},
year={2020},
eprint={2012.09164},
archivePrefix={arXiv},
primaryClass={cs.CV}
}
관련 프로젝트 살펴보기
불러오는 중…