Mmdetection: A little question, why "+1" here?

Created on 25 Dec 2020  路  2Comments  路  Source: open-mmlab/mmdetection

Most helpful comment

1.notice in line149 is assigned_gt_inds[pos_inds] - 1
2.notice in class AssignResult:
```python
class AssignResult(util_mixins.NiceRepr):
"""Stores assignments between predicted and truth boxes.

Attributes:
    num_gts (int): the number of truth boxes considered when computing this
        assignment

    gt_inds (LongTensor): for each predicted box indicates the 1-based
        index of the assigned truth box. 0 means unassigned and -1 means
        ignore.

    max_overlaps (FloatTensor): the iou between the predicted box and its
        assigned truth box.

    labels (None | LongTensor): If specified, for each predicted box
        indicates the category label of the assigned truth box.

gt_inds: 0 means unassigned and -1 means ignore. This setting make this code make you confused, help this can help you!

All 2 comments

1.notice in line149 is assigned_gt_inds[pos_inds] - 1
2.notice in class AssignResult:
```python
class AssignResult(util_mixins.NiceRepr):
"""Stores assignments between predicted and truth boxes.

Attributes:
    num_gts (int): the number of truth boxes considered when computing this
        assignment

    gt_inds (LongTensor): for each predicted box indicates the 1-based
        index of the assigned truth box. 0 means unassigned and -1 means
        ignore.

    max_overlaps (FloatTensor): the iou between the predicted box and its
        assigned truth box.

    labels (None | LongTensor): If specified, for each predicted box
        indicates the category label of the assigned truth box.

gt_inds: 0 means unassigned and -1 means ignore. This setting make this code make you confused, help this can help you!

1.notice in line149 is assigned_gt_inds[pos_inds] - 1
2.notice in class AssignResult:

class AssignResult(util_mixins.NiceRepr):
    """Stores assignments between predicted and truth boxes.

    Attributes:
        num_gts (int): the number of truth boxes considered when computing this
            assignment

        gt_inds (LongTensor): for each predicted box indicates the 1-based
            index of the assigned truth box. 0 means unassigned and -1 means
            ignore.

        max_overlaps (FloatTensor): the iou between the predicted box and its
            assigned truth box.

        labels (None | LongTensor): If specified, for each predicted box
            indicates the category label of the assigned truth box.


gt_inds: 0 means unassigned and -1 means ignore. This setting make this code make you confused, help this can help you!

very useful !!!, thank you very much. I should known that...

Was this page helpful?
0 / 5 - 0 ratings

Related issues

FrankXinqi picture FrankXinqi  路  3Comments

happog picture happog  路  3Comments

michaelisc picture michaelisc  路  3Comments

fmassa picture fmassa  路  3Comments

henbucuoshanghai picture henbucuoshanghai  路  3Comments