RoIAlign.pytorch icon indicating copy to clipboard operation
RoIAlign.pytorch copied to clipboard

Problem on box_ind

Open hguosc opened this issue 7 years ago • 3 comments
trafficstars

Hi All,

I noticed that this RoI Align takes three inputs: crops = roi_align(image, boxes, box_index) I am now wondering how the box_index should be prepared? Thanks.

hguosc avatar Aug 22 '18 19:08 hguosc

@hguosc Because batch data contains many images,and the code should know the boxes is belong to which one.So the box_index means the index of the image which the boxes belong to in the whole batch. I just figured it out by reading the cpp code.

wushuang01 avatar Sep 09 '18 08:09 wushuang01

the bounding box index is to assign box to image, if image NCW*H so if the bounding box index is [0,0,0,1], means the first three bounding box is the first image's and the forth one is the second image's.

venggg avatar Feb 01 '19 07:02 venggg

Hi, did you sovle this problem? I could not understand the repeats. For example, I have 16 frames(images) every batch, and every frame I set 10 bounding box, every box is presented by (x1, y1, x2, y2), so how I got the box_ind? Could that be: torch.tensor( [0, 0, 0, 0, ..., 0, 1, 1, 1, 1, ..., 1, ..., 15, 15, 15, ..., 15 ] ) the size is 1*160

MinamiKotoka avatar Aug 19 '20 13:08 MinamiKotoka