FelixCaae / AlignDETR

[BMVC 2024] Official implementation of Align-DETR
Apache License 2.0
47 stars 4 forks source link

Code #4

Closed sdreamforchen closed 2 months ago

sdreamforchen commented 10 months ago

Hello, I'm confused by those code, are those because of one-hot label? target_boxes = torch.cat([t["boxes"][v[1]] for t,v in zip(targets, indices)], dim=0) target_classes_o = torch.cat([t["labels"][v[1]] for t,v in zip(targets, indices)])#1d class index sorted by tgt_ind

    #compute normalizer for postive
    pos_idx = self._get_src_permutation_idx(indices)
    pos_idx_c = pos_idx + (target_classes_o.cpu(), )
    src_boxes = pred_boxes[pos_idx]

why pos_idx_c = pos_idx + (target_classes_o.cpu(), ) have a "+"

FelixCaae commented 2 months ago

sorry for late reply, this is for a concatenation between tuples. Thus , the result pos_idx_c is a tuple of index in (batch, sample , category) dimension.