class_docstr: SegNet Basic for semantic segmentation.
  
  This is a SegNet [#]_ model for semantic segmenation. This is based on
  SegNetBasic model that is found here_.
  
  When you specify the path of a pretrained chainer model serialized as
  a :obj:`.npz` file in the constructor, this chain model automatically
  initializes all the parameters with it.
  When a string in prespecified set is provided, a pretrained model is
  loaded from weights distributed on the Internet.
  The list of pretrained models supported are as follows:
  
  * :obj:`camvid`: Loads weights trained with the train split of         CamVid dataset.
  
  .. [#] Vijay Badrinarayanan, Alex Kendall and Roberto Cipolla "SegNet: A     Deep Convolutional Encoder-Decoder Architecture for Image Segmentation."     PAMI, 2017
  
  .. _here: http://github.com/alexgkendall/SegNet-Tutorial
  
  Args:
      n_class (int): The number of classes. If :obj:`None`, it can
          be infered if :obj:`pretrained_model` is given.
      pretrained_model (string): The destination of the pretrained
          chainer model serialized as a :obj:`.npz` file.
          If this is one of the strings described
          above, it automatically loads weights stored under a directory
          :obj:`$CHAINER_DATASET_ROOT/pfnet/chainercv/models/`,
          where :obj:`$CHAINER_DATASET_ROOT` is set as
          :obj:`$HOME/.chainer/dataset` unless you specify another value
          by modifying the environment variable.
      initialW (callable): Initializer for convolution layers.
class_docstr_tok: ["SegNet","Basic","for","semantic","segmentation",".","This","is","a","SegNet","[","#","]","_","model","for","semantic","segmenation",".","This","is","based","on","SegNetBasic","model","that","is","found","here_",".","When","you","specify","the","path","of","a","pretrained","chainer","model","serialized","as","a",":","obj",":","`",".npz","`","file","in","the","constructor",",","this","chain","model","automatically","initializes","all","the","parameters","with","it",".","When","a","string","in","prespecified","set","is","provided",",","a","pretrained","model","is","loaded","from","weights","distributed","on","the","Internet",".","The","list","of","pretrained","models","supported","are","as","follows",":","*",":","obj",":","`","camvid","`",":","Loads","weights","trained","with","the","train","split","of","CamVid","dataset",".","..","[","#","]","Vijay","Badrinarayanan",",","Alex","Kendall","and","Roberto","Cipolla","``","SegNet",":","A","Deep","Convolutional","Encoder-Decoder","Architecture","for","Image","Segmentation",".","''","PAMI",",","2017","..","_here",":","http",":","\/\/github.com\/alexgkendall\/SegNet-Tutorial","Args",":","n_class","(","int",")",":","The","number","of","classes",".","If",":","obj",":","`","None","`",",","it","can","be","infered","if",":","obj",":","`","pretrained_model","`","is","given",".","pretrained_model","(","string",")",":","The","destination","of","the","pretrained","chainer","model","serialized","as","a",":","obj",":","`",".npz","`","file",".","If","this","is","one","of","the","strings","described","above",",","it","automatically","loads","weights","stored","under","a","directory",":","obj",":","`","$","CHAINER_DATASET_ROOT\/pfnet\/chainercv\/models\/","`",",","where",":","obj",":","`","$","CHAINER_DATASET_ROOT","`","is","set","as",":","obj",":","`","$","HOME\/.chainer\/dataset","`","unless","you","specify","another","value","by","modifying","the","environment","variable",".","initialW","(","callable",")",":","Initializer","for","convolution","layers","."]
docstr: Conduct semantic segmentations from images.
  
  Args:
      imgs (iterable of numpy.ndarray): Arrays holding images.
          All images are in CHW and RGB format
          and the range of their values are :math:`[0, 255]`.
  
  Returns:
      list of numpy.ndarray:
  
      List of integer labels predicted from each image in the input             list.
docstr_tok: ["Conduct","semantic","segmentations","from","images",".","Args",":","imgs","(","iterable","of","numpy.ndarray",")",":","Arrays","holding","images",".","All","images","are","in","CHW","and","RGB","format","and","the","range","of","their","values","are",":","math",":","`","[","0",",","255","]","`",".","Returns",":","list","of","numpy.ndarray",":","List","of","integer","labels","predicted","from","each","image","in","the","input","list","."]
code: def predict(self, imgs):
      """Conduct semantic segmentations from images.
  
          Args:
              imgs (iterable of numpy.ndarray): Arrays holding images.
                  All images are in CHW and RGB format
                  and the range of their values are :math:`[0, 255]`.
  
          Returns:
              list of numpy.ndarray:
  
              List of integer labels predicted from each image in the input \
              list.
  
          """
      labels = []
      for img in imgs:
          C, H, W = img.shape
          with chainer.using_config(
              "train", False
          ), chainer.function.no_backprop_mode():
              x = chainer.Variable(self.xp.asarray(img[np.newaxis]))
              score = self.forward(x)[0].array
          score = chainer.backends.cuda.to_cpu(score)
          if score.shape != (C, H, W):
              dtype = score.dtype
              score = resize(score, (H, W)).astype(dtype)
  
          label = np.argmax(score, axis=0).astype(np.int32)
          labels.append(label)
      return labels
  
file_path: chainercv/chainercv/links/model/segnet/segnet_basic.py
imports: from __future__ import division
  import numpy
  import chainer
  import chainer.functions
  import chainer.links
  from chainercv.transforms import resize
  from chainercv import utils
label_desc: Use image node_id 4 for calling the SegNetBasic obj's underlying member method code with example usage: obj.predict(imgs) and returns: labels