class_docstr: CacheFilesWriter class to write the cached files.
class_docstr_tok: ["CacheFilesWriter","class","to","write","the","cached","files","."]
docstr: Initializes CacheFilesWriter for object detector.
  
  Args:
    label_map: Dict, map label integer ids to string label names such as {1:
      'person', 2: 'notperson'}. 0 is the reserved key for `background` and
      doesn't need to be included in `label_map`. Label names can't be
      duplicated.
    max_num_images: Max number of images to process. If None, process all the
      images.
docstr_tok: ["Initializes","CacheFilesWriter","for","object","detector",".","Args",":","label_map",":","Dict",",","map","label","integer","ids","to","string","label","names","such","as","{","1",":","'person","'",",","2",":","'notperson","'","}",".","0","is","the","reserved","key","for","`","background","`","and","does","n't","need","to","be","included","in","`","label_map","`",".","Label","names","ca","n't","be","duplicated",".","max_num_images",":","Max","number","of","images","to","process",".","If","None",",","process","all","the","images","."]
code: def __init__(
      self,
      label_map: Dict[int, str],
      max_num_images: Optional[int] = None,
  ) -> None:
      """Initializes CacheFilesWriter for object detector.
  
      Args:
        label_map: Dict, map label integer ids to string label names such as {1:
          'person', 2: 'notperson'}. 0 is the reserved key for `background` and
          doesn't need to be included in `label_map`. Label names can't be
          duplicated.
        max_num_images: Max number of images to process. If None, process all the
          images.
      """
      self.label_map = label_map
      self.max_num_images = max_num_images
  
imports: import abc
  import collections
  import hashlib
  import json
  import math
  import os
  import tempfile
  from typing import Any, Dict, List, Mapping, Optional
  import xml.etree.ElementTree
  import tensorflow
  from mediapipe.model_maker.python.core.data import cache_files
  from official.vision.data import tfrecord_lib
label_desc: Use image node_id 1 to create a new CacheFilesWriter object from inherited base classes: abc with example: obj = CacheFilesWriter(label_map, max_num_images)