Functions
utils::image Namespace Reference

Functions

def get_image
def get_segmentation_image
def resize
def tensor_vstack
def transform
def transform_inverse
def transform_seg_gt

Function Documentation

def utils.image.get_image (   roidb,
  config 
)
preprocess image and return processed roidb
:param roidb: a list of roidb
:return: list of img as in mxnet format
roidb add new item['im_info']
0 --- x (width, second dim of im)
|
y (height, first dim of im)

Definition at line 10 of file image.py.

def utils.image.get_segmentation_image (   segdb,
  config 
)
propocess image and return segdb
:param segdb: a list of segdb
:return: list of img as mxnet format

Definition at line 43 of file image.py.

def utils.image.resize (   im,
  target_size,
  max_size,
  stride = 0,
  interpolation = cv2.INTER_LINEAR 
)
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)
:param stride: if given, pad the image to designated stride
:param interpolation: if given, using given interpolation method to resize image
:return:

Definition at line 80 of file image.py.

def utils.image.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 153 of file image.py.

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

Definition at line 110 of file image.py.

def utils.image.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: [B, G, R pixel means]
:return: im [height, width, channel(RGB)]

Definition at line 134 of file image.py.

transform segmentation gt image into mxnet tensor
:param gt: [height, width, channel = 1]
:return: [batch, channel = 1, height, width]

Definition at line 123 of file image.py.



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