MCPcopy Create free account
hub / github.com/BICLab/SpikeYOLO / add_padding

Method add_padding

ultralytics/utils/instance.py:274–282  ·  view source on GitHub ↗

Handle rect and mosaic situation.

(self, padw, padh)

Source from the content-addressed store, hash-verified

272 self.normalized = True
273
274 def add_padding(self, padw, padh):
275 """Handle rect and mosaic situation."""
276 assert not self.normalized, 'you should add padding with absolute coordinates.'
277 self._bboxes.add(offset=(padw, padh, padw, padh))
278 self.segments[..., 0] += padw
279 self.segments[..., 1] += padh
280 if self.keypoints is not None:
281 self.keypoints[..., 0] += padw
282 self.keypoints[..., 1] += padh
283
284 def __getitem__(self, index) -> 'Instances':
285 """

Callers 2

_update_labelsMethod · 0.45
_update_labelsMethod · 0.45

Calls 1

addMethod · 0.45

Tested by

no test coverage detected