longcw / RoIAlign.pytorch

RoIAlign & crop_and_resize for PyTorch
555 stars 103 forks source link

Problem on box_ind #14

Open hguosc opened 6 years ago

hguosc commented 6 years ago

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.

wushuang01 commented 6 years ago

@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.

venggg commented 5 years ago

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.

MinamiKotoka commented 4 years ago

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