class_docstr: Base options for MediaPipe Tasks' Python APIs.
  
  Represents external model asset used by the Task APIs. The files can be
  specified by one of the following two ways:
  
  (1) model asset file path in `model_asset_path`.
  (2) model asset contents loaded in `model_asset_buffer`.
  
  If more than one field of these fields is provided, they are used in this
  precedence order.
  
  Attributes:
    model_asset_path: Path to the model asset file.
    model_asset_buffer: The model asset file contents as bytes.
    delegate: Acceleration to use. Supported values are GPU and CPU. GPU support
      is currently limited to Ubuntu platforms.
class_docstr_tok: ["Base","options","for","MediaPipe","Tasks","'","Python","APIs",".","Represents","external","model","asset","used","by","the","Task","APIs",".","The","files","can","be","specified","by","one","of","the","following","two","ways",":","(","1",")","model","asset","file","path","in","`","model_asset_path","`",".","(","2",")","model","asset","contents","loaded","in","`","model_asset_buffer","`",".","If","more","than","one","field","of","these","fields","is","provided",",","they","are","used","in","this","precedence","order",".","Attributes",":","model_asset_path",":","Path","to","the","model","asset","file",".","model_asset_buffer",":","The","model","asset","file","contents","as","bytes",".","delegate",":","Acceleration","to","use",".","Supported","values","are","GPU","and","CPU",".","GPU","support","is","currently","limited","to","Ubuntu","platforms","."]
docstr: Creates a `BaseOptions` object from the given protobuf object.
docstr_tok: ["Creates","a","`","BaseOptions","`","object","from","the","given","protobuf","object","."]
code: def create_from_pb2(cls, pb2_obj: _BaseOptionsProto) -> "BaseOptions":
      """Creates a `BaseOptions` object from the given protobuf object."""
      delegate = None
      if pb2_obj.acceleration is not None:
          delegate = (
              BaseOptions.Delegate.GPU
              if pb2_obj.acceleration.gpu is not None
              else BaseOptions.Delegate.CPU
          )
  
      return BaseOptions(
          model_asset_path=pb2_obj.model_asset.file_name,
          model_asset_buffer=pb2_obj.model_asset.file_content,
          delegate=delegate,
      )
  
file_path: mediapipe/mediapipe/tasks/python/core/base_options.py
imports: import dataclasses
  import enum
  import os
  import platform
  from typing import Any, Optional
  from mediapipe.calculators.tensor import inference_calculator_pb2
  from mediapipe.tasks.cc.core.proto import acceleration_pb2
  from mediapipe.tasks.cc.core.proto import base_options_pb2
  from mediapipe.tasks.cc.core.proto import external_file_pb2
  from mediapipe.tasks.python.core.optional_dependencies import doc_controls
label_desc: Use image node_id 2 for calling the BaseOptions obj's underlying member method code with example usage: obj.create_from_pb2(cls, pb2_obj) and returns: BaseOptions