Shortcuts

ResizeEdge

class mmcls.datasets.transforms.ResizeEdge(scale, edge='short', backend='cv2', interpolation='bilinear')[source]

Resize images along the specified edge.

Required Keys:

  • img

Modified Keys:

  • img

  • img_shape

Added Keys:

  • scale

  • scale_factor

Parameters
  • scale (int) – The edge scale to resizing.

  • edge (str) – The edge to resize. Defaults to ‘short’.

  • backend (str) – Image resize backend, choices are ‘cv2’ and ‘pillow’. These two backends generates slightly different results. Defaults to ‘cv2’.

  • interpolation (str) – Interpolation method, accepted values are “nearest”, “bilinear”, “bicubic”, “area”, “lanczos” for ‘cv2’ backend, “nearest”, “bilinear” for ‘pillow’ backend. Defaults to ‘bilinear’.

transform(results)[source]

Transform function to resize images.

Parameters

results (dict) – Result dict from loading pipeline.

Returns

Resized results, ‘img’, ‘scale’, ‘scale_factor’, ‘img_shape’ keys are updated in result dict.

Return type

dict

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

Free document hosting provided by Read the Docs.