class_docstr: Preprocessor for object detector.
class_docstr_tok: ["Preprocessor","for","object","detector","."]
docstr: Initialize a Preprocessor.
docstr_tok: ["Initialize","a","Preprocessor","."]
code: def __init__(self, model_spec: ms.ModelSpec):
      """Initialize a Preprocessor."""
      self._mean_norm = model_spec.mean_norm
      self._stddev_norm = model_spec.stddev_norm
      self._output_size = model_spec.input_image_shape[:2]
      self._min_level = model_spec.min_level
      self._max_level = model_spec.max_level
      self._num_scales = 3
      self._aspect_ratios = [0.5, 1, 2]
      self._anchor_size = 3
      self._dtype = tf.float32
      self._match_threshold = 0.5
      self._unmatched_threshold = 0.5
      self._aug_scale_min = 0.5
      self._aug_scale_max = 2.0
      self._max_num_instances = 100
  
      self._padded_size = preprocess_ops.compute_padded_size(
          self._output_size, 2**self._max_level
      )
  
      input_anchor = anchor.build_anchor_generator(
          min_level=self._min_level,
          max_level=self._max_level,
          num_scales=self._num_scales,
          aspect_ratios=self._aspect_ratios,
          anchor_size=self._anchor_size,
      )
      self._anchor_boxes = input_anchor(image_size=self._output_size)
      self._anchor_labeler = anchor.AnchorLabeler(
          self._match_threshold, self._unmatched_threshold
      )
  
file_path: mediapipe/mediapipe/model_maker/python/vision/object_detector/preprocessor.py
imports: from typing import Any, Mapping, Tuple
  import tensorflow
  from mediapipe.model_maker.python.vision.object_detector import model_spec
  from official.vision.dataloaders import utils
  from official.vision.ops import anchor
  from official.vision.ops import box_ops
  from official.vision.ops import preprocess_ops
label_desc: Use image node_id 1 to create a new Preprocessor object from inherited base classes: object with example: obj = Preprocessor(model_spec)