class_docstr: Convert image to :obj:`torch.Tensor` by given keys.
  
  The dimension order of input image is (H, W, C). The pipeline will convert
  it to (C, H, W). If only 2 dimension (H, W) is given, the output would be
  (1, H, W).
  
  Args:
      keys (Sequence[str]): Key of images to be converted to Tensor.
class_docstr_tok: ["Convert","image","to",":","obj",":","`","torch.Tensor","`","by","given","keys",".","The","dimension","order","of","input","image","is","(","H",",","W",",","C",")",".","The","pipeline","will","convert","it","to","(","C",",","H",",","W",")",".","If","only","2","dimension","(","H",",","W",")","is","given",",","the","output","would","be","(","1",",","H",",","W",")",".","Args",":","keys","(","Sequence","[","str","]",")",":","Key","of","images","to","be","converted","to","Tensor","."]
docstr: Call function to convert image in results to :obj:`torch.Tensor` and
  transpose the channel order.
  
  Args:
      results (dict): Result dict contains the image data to convert.
  
  Returns:
      dict: The result dict contains the image converted
          to :obj:`torch.Tensor` and transposed to (C, H, W) order.
docstr_tok: ["Call","function","to","convert","image","in","results","to",":","obj",":","`","torch.Tensor","`","and","transpose","the","channel","order",".","Args",":","results","(","dict",")",":","Result","dict","contains","the","image","data","to","convert",".","Returns",":","dict",":","The","result","dict","contains","the","image","converted","to",":","obj",":","`","torch.Tensor","`","and","transposed","to","(","C",",","H",",","W",")","order","."]
code: def __call__(self, results):
      """Call function to convert image in results to :obj:`torch.Tensor` and
      transpose the channel order.
  
      Args:
          results (dict): Result dict contains the image data to convert.
  
      Returns:
          dict: The result dict contains the image converted
              to :obj:`torch.Tensor` and transposed to (C, H, W) order.
      """
      for key in self.keys:
          img = results[key]
          if len(img.shape) < 3:
              img = np.expand_dims(img, -1)
          results[key] = to_tensor(img.transpose(2, 0, 1))
      return results
  
imports: from collections.abc import Sequence
  import mmcv
  import numpy
  import torch
  from mmcv.parallel import DataContainer
  from ..builder import PIPELINES
label_desc: Use image node_id 2 for calling the ImageToTensor obj's underlying member method code with example usage: obj.__call__(results) and returns: results