Ë
    »dæj/  ã                   ó¨   — d Z ddlZddlmZmZ ddlmZ ddlmZ ddl	m
Z
 ej                   G d„ d«      «       Zej                   G d	„ d
«      «       Zy)zClassifications data class.é    N)ÚListÚOptional)Úcategory)Úclassification_result_c)Údoc_controlsc                   ó    — e Zd ZU dZeej                     ed<   eed<   dZ	e
e   ed<   eej                  dej                   dd fd„«       «       Zy)	ÚClassificationsaµ  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.
  Ú
categoriesÚ
head_indexNÚ	head_nameÚc_structÚreturnc                 óh  — |j                   r\|j                  dkD  rMt        |j                  «      D �cg c].  }t        j                  j                  |j                   |   «      ‘Œ0 }}ng }t        ||j                  |j                  r |j                  j                  d«      ¬«      S d¬«      S c c}w )z@Creates a `Classifications` object from the given ctypes struct.r   zutf-8N)r
   r   r   )
r
   Úcategories_countÚrangeÚcategory_libÚCategoryÚfrom_ctypesr	   r   r   Údecode)Úclsr   Úir
   s       ú…/root/repos/pocs/video-evals/.venv/lib/python3.12/site-packages/mediapipe/tasks/python/components/containers/classification_result.pyr   zClassifications.from_ctypes)   s²   € ð ×Ò˜x×8Ñ8¸1Ò<ô ˜×2Ñ2Ó3öàô ×
Ñ
×
+Ñ
+¨H×,?Ñ,?ÀÑ,BÕ
Cð€jñ ð
 €jäØØ×&Ñ&à2:×2DÒ2DˆH×Ñ×%Ñ% gÓ.ô	ð ð KOô	ð ùòs   ³3B/)Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   r   r   Ú__annotations__Úintr   r   ÚstrÚclassmethodr   Údo_not_generate_docsr   ÚClassificationsCr   © ó    r   r	   r	      sc   … ñ	ð �<×(Ñ(Ñ)Ó)Øƒ/Ø!€)ˆX�c‰]Ó!àØ×$Ñ$ðØ,×=Ñ=ðàòó %ó ñr$   r	   c                   ó‚   — e Zd ZU dZee   ed<   dZee	   ed<   e
ej                  dej                  dd fd„«       «       Zy)ÚClassificationResultaU  Contains the classification results of a model.

  Attributes:
    classifications: A list of `Classifications` objects, each for a head of the
      model.
    timestamp_ms: The optional timestamp (in milliseconds) of the start of the
      chunk of data corresponding to these results. This is only used for
      classification on time series (e.g. audio classification). In these use
      cases, the amount of data to process might exceed the maximum size that
      the model can process: to solve this, the input data is split into
      multiple chunks starting at different timestamps.
  ÚclassificationsNÚtimestamp_msr   r   c                 ó  — |j                   rR|j                  dkD  rCt        |j                  «      D �cg c]$  }t        j	                  |j                   |   «      ‘Œ& }}ng }|j
                  r|j                  nd}t        ||¬«      S c c}w )z=Creates a `ClassificationResult` object from a ctypes struct.r   N)r'   r(   )r'   Úclassifications_countr   r	   r   Úhas_timestamp_msr(   r&   )r   r   r   r'   r(   s        r   r   z ClassificationResult.from_ctypesR   s�   € ð ×Ò H×$BÑ$BÀQÒ$Fô ˜×7Ñ7Ó8öàô ×
%Ñ
% h×&>Ñ&>¸qÑ&AÕ
Bð€oñ ð
 €oà,4×,EÒ,E�8×(Ò(È4€LÜØ'°lôð ùòs   ³)B)r   r   r   r   r   r	   r   r(   r   r   r    r   r!   r   ÚClassificationResultCr   r#   r$   r   r&   r&   @   sX   … ñð ˜Ñ(Ó(Ø $€,�˜‘Ó$àØ×$Ñ$ðØ,×BÑBðàòó %ó ñr$   r&   )r   ÚdataclassesÚtypingr   r   Ú,mediapipe.tasks.python.components.containersr   r   r   Ú1mediapipe.tasks.python.core.optional_dependenciesr   Ú	dataclassr	   r&   r#   r$   r   ú<module>r2      sX   ðñ "ã ß !å QÝ PÝ Jð ×Ñ÷$ð $ó ð$ðN ×Ñ÷"ð "ó ñ"r$   