class_docstr: MediaPipe Hands.
  
  MediaPipe Hands processes an RGB image and returns the hand landmarks and
  handedness (left v.s. right hand) of each detected hand.
  
  Note that it determines handedness assuming the input image is mirrored,
  i.e., taken with a front-facing/selfie camera (
  https://en.wikipedia.org/wiki/Front-facing_camera) with images flipped
  horizontally. If that is not the case, use, for instance, cv2.flip(image, 1)
  to flip the image first for a correct handedness output.
  
  Please refer to https://solutions.mediapipe.dev/hands#python-solution-api for
  usage examples.
class_docstr_tok: ["MediaPipe","Hands",".","MediaPipe","Hands","processes","an","RGB","image","and","returns","the","hand","landmarks","and","handedness","(","left","v.s",".","right","hand",")","of","each","detected","hand",".","Note","that","it","determines","handedness","assuming","the","input","image","is","mirrored",",","i.e.",",","taken","with","a","front-facing\/selfie","camera","(","https",":","\/\/en.wikipedia.org\/wiki\/Front-facing_camera",")","with","images","flipped","horizontally",".","If","that","is","not","the","case",",","use",",","for","instance",",","cv2.flip","(","image",",","1",")","to","flip","the","image","first","for","a","correct","handedness","output",".","Please","refer","to","https",":","\/\/solutions.mediapipe.dev\/hands","#","python-solution-api","for","usage","examples","."]
docstr: Initializes a MediaPipe Hand object.
  
  Args:
    static_image_mode: Whether to treat the input images as a batch of static
      and possibly unrelated images, or a video stream. See details in
      https://solutions.mediapipe.dev/hands#static_image_mode.
    max_num_hands: Maximum number of hands to detect. See details in
      https://solutions.mediapipe.dev/hands#max_num_hands.
    model_complexity: Complexity of the hand landmark model: 0 or 1.
      Landmark accuracy as well as inference latency generally go up with the
      model complexity. See details in
      https://solutions.mediapipe.dev/hands#model_complexity.
    min_detection_confidence: Minimum confidence value ([0.0, 1.0]) for hand
      detection to be considered successful. See details in
      https://solutions.mediapipe.dev/hands#min_detection_confidence.
    min_tracking_confidence: Minimum confidence value ([0.0, 1.0]) for the
      hand landmarks to be considered tracked successfully. See details in
      https://solutions.mediapipe.dev/hands#min_tracking_confidence.
docstr_tok: ["Initializes","a","MediaPipe","Hand","object",".","Args",":","static_image_mode",":","Whether","to","treat","the","input","images","as","a","batch","of","static","and","possibly","unrelated","images",",","or","a","video","stream",".","See","details","in","https",":","\/\/solutions.mediapipe.dev\/hands","#","static_image_mode",".","max_num_hands",":","Maximum","number","of","hands","to","detect",".","See","details","in","https",":","\/\/solutions.mediapipe.dev\/hands","#","max_num_hands",".","model_complexity",":","Complexity","of","the","hand","landmark","model",":","0","or","1",".","Landmark","accuracy","as","well","as","inference","latency","generally","go","up","with","the","model","complexity",".","See","details","in","https",":","\/\/solutions.mediapipe.dev\/hands","#","model_complexity",".","min_detection_confidence",":","Minimum","confidence","value","(","[","0.0",",","1.0","]",")","for","hand","detection","to","be","considered","successful",".","See","details","in","https",":","\/\/solutions.mediapipe.dev\/hands","#","min_detection_confidence",".","min_tracking_confidence",":","Minimum","confidence","value","(","[","0.0",",","1.0","]",")","for","the","hand","landmarks","to","be","considered","tracked","successfully",".","See","details","in","https",":","\/\/solutions.mediapipe.dev\/hands","#","min_tracking_confidence","."]
code: def __init__(
      self,
      static_image_mode=False,
      max_num_hands=2,
      model_complexity=1,
      min_detection_confidence=0.5,
      min_tracking_confidence=0.5,
  ):
      """Initializes a MediaPipe Hand object.
  
      Args:
        static_image_mode: Whether to treat the input images as a batch of static
          and possibly unrelated images, or a video stream. See details in
          https://solutions.mediapipe.dev/hands#static_image_mode.
        max_num_hands: Maximum number of hands to detect. See details in
          https://solutions.mediapipe.dev/hands#max_num_hands.
        model_complexity: Complexity of the hand landmark model: 0 or 1.
          Landmark accuracy as well as inference latency generally go up with the
          model complexity. See details in
          https://solutions.mediapipe.dev/hands#model_complexity.
        min_detection_confidence: Minimum confidence value ([0.0, 1.0]) for hand
          detection to be considered successful. See details in
          https://solutions.mediapipe.dev/hands#min_detection_confidence.
        min_tracking_confidence: Minimum confidence value ([0.0, 1.0]) for the
          hand landmarks to be considered tracked successfully. See details in
          https://solutions.mediapipe.dev/hands#min_tracking_confidence.
      """
      super().__init__(
          binary_graph_path=_BINARYPB_FILE_PATH,
          side_inputs={
              "model_complexity": model_complexity,
              "num_hands": max_num_hands,
              "use_prev_landmarks": not static_image_mode,
          },
          calculator_params={
              "palmdetectioncpu__TensorsToDetectionsCalculator.min_score_thresh": min_detection_confidence,
              "handlandmarkcpu__ThresholdingCalculator.threshold": min_tracking_confidence,
          },
          outputs=[
              "multi_hand_landmarks",
              "multi_hand_world_landmarks",
              "multi_handedness",
          ],
      )
  
imports: import enum
  from typing import NamedTuple
  import numpy
  from mediapipe.calculators.core import constant_side_packet_calculator_pb2
  from mediapipe.calculators.core import gate_calculator_pb2
  from mediapipe.calculators.core import split_vector_calculator_pb2
  from mediapipe.calculators.tensor import image_to_tensor_calculator_pb2
  from mediapipe.calculators.tensor import inference_calculator_pb2
  from mediapipe.calculators.tensor import tensors_to_classification_calculator_pb2
  from mediapipe.calculators.tensor import tensors_to_detections_calculator_pb2
  from mediapipe.calculators.tensor import tensors_to_landmarks_calculator_pb2
  from mediapipe.calculators.tflite import ssd_anchors_calculator_pb2
  from mediapipe.calculators.util import association_calculator_pb2
  from mediapipe.calculators.util import detections_to_rects_calculator_pb2
  from mediapipe.calculators.util import logic_calculator_pb2
  from mediapipe.calculators.util import non_max_suppression_calculator_pb2
  from mediapipe.calculators.util import rect_transformation_calculator_pb2
  from mediapipe.calculators.util import thresholding_calculator_pb2
  from mediapipe.python.solution_base import SolutionBase
  from mediapipe.python.solutions.hands_connections import HAND_CONNECTIONS
label_desc: Use image node_id 1 to create a new Hands object from inherited base classes: SolutionBase with example: obj = Hands(static_image_mode, max_num_hands, model_complexity, min_detection_confidence, min_tracking_confidence)