class_docstr: Replaces the pixel values in range [0-255] with class values from supplied value_map.
  
  :return     : numpy.ndarray with dtype=np.uint8
class_docstr_tok: ["Replaces","the","pixel","values","in","range","[","0-255","]","with","class","values","from","supplied","value_map",".",":","return",":","numpy.ndarray","with","dtype=np.uint8"]
docstr: :param mask: PIL or OpenCV mask with pixel values in [0-255] range
  :return:
code: def __call__(self, mask):
      """
      :param mask: PIL or OpenCV mask with pixel values in [0-255] range
      :return:
      """
      mask = np.array(mask)  # convert to np
      for k, v in self.value_map.items():
          mask[mask == k] = v  # replace pixels with class values
  
      return mask.astype(np.uint8)
  
imports: import random
  import torch
  from torchvision.transforms.functional import to_tensor
  import numpy
  from ..utils import th_random_choice
label_desc: Use image node_id 2 for calling the MaskPixelsToMap obj's underlying member method code with example usage: obj.__call__(mask) and returns: mask