import torchvision
import torch
input_ = torch.rand(3, 128, 24, 96) #[b,c,h,w]
bbox = [[0,0.1,0.15,0.4,0.6],
[0,0.1,0.15,0.4,0.6],
[1,0.01,0.15,0.4,0.6],
[1,0.1,0.25,0.7,0.6],
[2,0.01,0.14,0.5,0.6],
[2,0.1,0.45,0.4,0.6],
[2,0.01,0.45,0.12,0.6],
[0,0.01,0.25,0.15,0.6]]
bbox_1 = torch.tensor(bbox)#[8,5]
#[8,128,7,7]
roi = torchvision.ops.roi_align(input=input_, boxes=bbox_1,
output_size=(7, 7))
标签:roi,torchvision,示例,0.1,0.01,0.4,0.6
From: https://www.cnblogs.com/yanghailin/p/16928559.html