basicsr.metrics.metric_util¶
- basicsr.metrics.metric_util.reorder_image(img, input_order='HWC')[source]¶
Reorder images to ‘HWC’ order.
If the input_order is (h, w), return (h, w, 1); If the input_order is (c, h, w), return (h, w, c); If the input_order is (h, w, c), return as it is.
- Parameters:
img (ndarray) – Input image.
input_order (str) – Whether the input order is ‘HWC’ or ‘CHW’. If the input image shape is (h, w), input_order will not have effects. Default: ‘HWC’.
- Returns:
reordered image.
- Return type:
ndarray