Functions
utils::image_processing Namespace Reference

Functions

def resize
def tensor_vstack
def transform
def transform_inverse

Function Documentation

def utils.image_processing.resize (   im,
  target_size,
  max_size 
)
only resize input image to target size and return scale
:param im: BGR image input by opencv
:param target_size: one dimensional size (the short side)
:param max_size: one dimensional max size (the long side)
:return:

Definition at line 5 of file image_processing.py.

def utils.image_processing.tensor_vstack (   tensor_list,
  pad = 0 
)
vertically stack tensors
:param tensor_list: list of tensor to be stacked vertically
:param pad: label to pad with
:return: tensor with max shape

Definition at line 65 of file image_processing.py.

def utils.image_processing.transform (   im,
  pixel_means,
  need_mean = False 
)
transform into mxnet tensor
subtract pixel size and transform to correct format
:param im: [height, width, channel] in BGR
:param pixel_means: [[[R, G, B pixel means]]]
:return: [batch, channel, height, width]

Definition at line 24 of file image_processing.py.

def utils.image_processing.transform_inverse (   im_tensor,
  pixel_means 
)
transform from mxnet im_tensor to ordinary RGB image
im_tensor is limited to one image
:param im_tensor: [batch, channel, height, width]
:param pixel_means: [[[R, G, B pixel means]]]
:return: im [height, width, channel(RGB)]

Definition at line 45 of file image_processing.py.



rail_object_detector
Author(s):
autogenerated on Sat Jun 8 2019 20:26:31