Args: offset (tuple | list | int): the offset for four coords.
(self, offset)
| 106 | self.bboxes[:, 3] *= scale[3] |
| 107 | |
| 108 | def add(self, offset): |
| 109 | """ |
| 110 | Args: |
| 111 | offset (tuple | list | int): the offset for four coords. |
| 112 | """ |
| 113 | if isinstance(offset, Number): |
| 114 | offset = to_4tuple(offset) |
| 115 | assert isinstance(offset, (tuple, list)) |
| 116 | assert len(offset) == 4 |
| 117 | self.bboxes[:, 0] += offset[0] |
| 118 | self.bboxes[:, 1] += offset[1] |
| 119 | self.bboxes[:, 2] += offset[2] |
| 120 | self.bboxes[:, 3] += offset[3] |
| 121 | |
| 122 | def __len__(self): |
| 123 | """Return the number of boxes.""" |
no outgoing calls
no test coverage detected