| # Copyright (c) OpenMMLab. All rights reserved. | |
| from abc import ABCMeta, abstractmethod | |
| class BaseBBoxCoder(metaclass=ABCMeta): | |
| """Base bounding box coder. | |
| Args: | |
| use_box_type (bool): Whether to warp decoded boxes with the | |
| box type data structure. Defaults to False. | |
| """ | |
| # The size of the last of dimension of the encoded tensor. | |
| encode_size = 4 | |
| def __init__(self, use_box_type: bool = False, **kwargs): | |
| self.use_box_type = use_box_type | |
| def encode(self, bboxes, gt_bboxes): | |
| """Encode deltas between bboxes and ground truth boxes.""" | |
| def decode(self, bboxes, bboxes_pred): | |
| """Decode the predicted bboxes according to prediction and base | |
| boxes.""" | |