# Path: automl_video_ondevice/object_tracking/base_object_detection.py
# class BaseObjectDetectionInference:
#   """Interface that must be implemented for support of different model types."""
# 
#   def __init__(self, frozen_graph_path, label_map_path, config):
#     raise NotImplementedError()
# 
#   def input_size(self):
#     return Size(256, 256)
# 
#   def run(self, timestamp, frame, annotations):
#     raise NotImplementedError()
# 
# Path: automl_video_ondevice/types.py
# class NormalizedBoundingBox:
#   left: float
#   top: float
#   right: float
#   bottom: float
# 
# Path: automl_video_ondevice/types.py
# class ObjectTrackingAnnotation:
#   timestamp: float
#   track_id: int
#   class_id: int
#   class_name: str
#   confidence_score: float
#   bbox: NormalizedBoundingBox


import numpy as np
  import platform
from automl_video_ondevice.object_tracking.base_object_detection import BaseObjectDetectionInference
from automl_video_ondevice.types import NormalizedBoundingBox
from automl_video_ondevice.types import ObjectTrackingAnnotation
    from automl_video_ondevice.object_tracking.mediapipe_tracker.aarch64 import mediapipe_tracker  # pylint: disable=line-too-long

  node_options: {
    [type.googleapis.com/mediapipe.MotionAnalysisCalculatorOptions]: {
      analysis_options {
        analysis_policy: ANALYSIS_POLICY_CAMERA_MOBILE
        flow_options {
          fast_estimation_min_block_size: 100
          top_inlier_sets: 1
          frac_inlier_error_threshold: 3e-3
          downsample_mode: DOWNSAMPLE_TO_INPUT_SIZE
          # downsample_factor: 2.0
          verification_distance: 5.0
          verify_long_feature_acceleration: true
          verify_long_feature_trigger_ratio: 0.1
          tracking_options {
            max_features: 2000
            min_feature_distance: 4
            reuse_features_max_frame_distance: 3
            reuse_features_min_survived_frac: 0.9
            adaptive_extraction_levels: 2
            min_eig_val_settings {
              adaptive_lowest_quality_level: 2e-4
            }
            klt_tracker_implementation: KLT_OPENCV
          }
        }
        motion_options {
          label_empty_frames_as_valid: false
        }
      }

# Path: automl_video_ondevice/object_tracking/base_object_detection.py
# class BaseObjectDetectionInference:
#   """Interface that must be implemented for support of different model types."""
# 
#   def __init__(self, frozen_graph_path, label_map_path, config):
#     raise NotImplementedError()
# 
#   def input_size(self):
#     return Size(256, 256)
# 
#   def run(self, timestamp, frame, annotations):
#     raise NotImplementedError()
# 
# Path: automl_video_ondevice/types.py
# class NormalizedBoundingBox:
#   left: float
#   top: float
#   right: float
#   bottom: float
# 
# Path: automl_video_ondevice/types.py
# class ObjectTrackingAnnotation:
#   timestamp: float
#   track_id: int
#   class_id: int
#   class_name: str
#   confidence_score: float
#   bbox: NormalizedBoundingBox


# Path: automl_video_ondevice/object_tracking/mediapipe_object_tracker.py
import numpy as np
  import platform
from automl_video_ondevice.object_tracking.base_object_detection import BaseObjectDetectionInference
from automl_video_ondevice.types import NormalizedBoundingBox
from automl_video_ondevice.types import ObjectTrackingAnnotation
    from automl_video_ondevice.object_tracking.mediapipe_tracker.aarch64 import mediapipe_tracker  # pylint: disable=line-too-long


  node_options: {
    [type.googleapis.com/mediapipe.MotionAnalysisCalculatorOptions]: {
      analysis_options {
        analysis_policy: ANALYSIS_POLICY_CAMERA_MOBILE
        flow_options {
          fast_estimation_min_block_size: 100
          top_inlier_sets: 1
          frac_inlier_error_threshold: 3e-3
          downsample_mode: DOWNSAMPLE_TO_INPUT_SIZE
          # downsample_factor: 2.0
          verification_distance: 5.0
          verify_long_feature_acceleration: true
          verify_long_feature_trigger_ratio: 0.1
          tracking_options {
            max_features: 2000
            min_feature_distance: 4
            reuse_features_max_frame_distance: 3
            reuse_features_min_survived_frac: 0.9
            adaptive_extraction_levels: 2
            min_eig_val_settings {
              adaptive_lowest_quality_level: 2e-4
            }
            klt_tracker_implementation: KLT_OPENCV
          }
        }
        motion_options {
          label_empty_frames_as_valid: false
        }
      }

    }