class_docstr: Utility class for mapping between class name and id.
class_docstr_tok: ["Utility","class","for","mapping","between","class","name","and","id","."]
code: def __init__(
      self,
      classes: Optional[Sequence[str]] = None,
      background: Optional[str] = BACKGROUND,
  ):
      self._lock = True
  
      self._id2class = copy(list(classes)) if classes else []
      # insert background if required
      self._background = background
      if self._background is not None:
          try:
              self._id2class.remove(self._background)
          except ValueError:
              pass
          # background is always index zero
          self._id2class.insert(0, self._background)
  
      self._class2id = {
          name: i for i, name in enumerate(self._id2class)
      }
  
file_path: icevision/icevision/core/class_map.py
imports: from icevision.imports import *
label_desc: Use image node_id 1 to create a new ClassMap object  with example: obj = ClassMap(classes, background)