src.feature_align.feature_align¶
- src.feature_align.feature_align(raw_feature: torch.Tensor, P: torch.Tensor, ns_t: torch.Tensor, ori_size: tuple, device=None) torch.Tensor [source]¶
Perform feature align on the image feature map.
Feature align performs bi-linear interpolation on the image feature map. This operation is inspired by “ROIAlign” in Mask R-CNN.
- Parameters
raw_feature – \((b\times c \times w \times h)\) raw feature map. \(b\): batch size, \(c\): number of feature channels, \(w\): feature map width, \(h\): feature map height
P – \((b\times n \times 2)\) point set containing point coordinates. The coordinates are at the scale of the original image size. \(n\): number of points
ns_t – \((b)\) number of exact points. We support batched instances with different number of nodes, and
ns_t
is required to specify the exact number of nodes of each instance in the batch.ori_size – size of the original image. Since the point coordinates are in the scale of the original image size, this parameter is required.
device – output device. If not specified, it will be the same as the input
- Returns
\((b\times c \times n)\) extracted feature vectors