class_docstr: Represents the classification results for a given classifier head.
  
  Attributes:
    categories: The array of predicted categories, usually sorted by descending
      scores (e.g. from high to low probability).
    head_index: The index of the classifier head these categories refer to. This
      is useful for multi-head models.
    head_name: The name of the classifier head, which is the corresponding
      tensor metadata name.
class_docstr_tok: ["Represents","the","classification","results","for","a","given","classifier","head",".","Attributes",":","categories",":","The","array","of","predicted","categories",",","usually","sorted","by","descending","scores","(","e.g",".","from","high","to","low","probability",")",".","head_index",":","The","index","of","the","classifier","head","these","categories","refer","to",".","This","is","useful","for","multi-head","models",".","head_name",":","The","name","of","the","classifier","head",",","which","is","the","corresponding","tensor","metadata","name","."]
docstr: Creates a `Classifications` object from the given protobuf object.
docstr_tok: ["Creates","a","`","Classifications","`","object","from","the","given","protobuf","object","."]
code: def create_from_pb2(
      cls, pb2_obj: _ClassificationsProto
  ) -> "Classifications":
      """Creates a `Classifications` object from the given protobuf object."""
      categories = []
      for classification in pb2_obj.classification_list.classification:
          categories.append(
              category_module.Category.create_from_pb2(classification)
          )
      return Classifications(
          categories=categories,
          head_index=pb2_obj.head_index,
          head_name=pb2_obj.head_name,
      )
  
file_path: mediapipe/mediapipe/tasks/python/components/containers/classification_result.py
imports: import dataclasses
  from typing import List, Optional
  from mediapipe.framework.formats import classification_pb2
  from mediapipe.tasks.cc.components.containers.proto import classifications_pb2
  from mediapipe.tasks.python.components.containers import category
  from mediapipe.tasks.python.core.optional_dependencies import doc_controls
label_desc: Use image node_id 2 for calling the Classifications obj's underlying member method code with example usage: obj.create_from_pb2(cls, pb2_obj) and returns: Classifications