Shortcuts

mmocr.utils.rescale_bboxes

mmocr.utils.rescale_bboxes(bboxes, scale_factor, mode='mul')[源代码]

Rescale bboxes according to scale_factor.

The behavior is different depending on the mode. When mode is ‘mul’, the coordinates will be multiplied by scale_factor, which is usually used in preprocessing transforms such as Resize(). The coordinates will be divided by scale_factor if mode is ‘div’. It can be used in postprocessors to recover the bboxes in the original image size.

参数
  • bboxes (np.ndarray]) – Bounding bboxes in shape (N, 4)

  • scale_factor (tuple(int, int)) – (w_scale, h_scale).

  • model (str) – Rescale mode. Can be ‘mul’ or ‘div’. Defaults to ‘mul’.

  • mode (str) –

返回

Rescaled bboxes.

返回类型

list[np.ndarray]

Read the Docs v: latest
Versions
latest
stable
0.x
dev-1.x
Downloads
pdf
html
epub
On Read the Docs
Project Home
Builds

Free document hosting provided by Read the Docs.