
    -i                     d    d Z ddlmZmZ ddlmZ  G d ded      Ze G d d	e             Zd	gZy
)z
Processor class for TVP.
   )ProcessingKwargsProcessorMixin)auto_docstringc                       e Zd ZddddddiZy)TvpProcessorKwargstext_kwargsT
max_lengthF)
truncationpaddingpad_to_max_lengthreturn_token_type_idsN)__name__
__module____qualname__	_defaults     b/mnt/e/genesis-system/.venv/lib/python3.12/site-packages/transformers/models/tvp/processing_tvp.pyr   r      s    #!%%*	
Ir   r   F)totalc                   &     e Zd Zd fd	Zd Z xZS )TvpProcessorc                 4    t         |   ||       || _        y )N)super__init__video_processor)selfimage_processor	tokenizerkwargs	__class__s       r   r   zTvpProcessor.__init__#   s    )4.r   c                     t        |j                         d   d   |z  d      t        |j                         d   d   |z  d      }}||fS )a  
        Compute the time of the video.

        Args:
            logits (`torch.Tensor`):
                The logits output of TvpForVideoGrounding.
            video_durations (`float`):
                The video's duration.

        Returns:
            start (`float`):
                The start time of the video.
            end (`float`):
                The end time of the video.
               )roundtolist)r   logitsvideo_durationsstartends        r   post_process_video_groundingz)TvpProcessor.post_process_video_grounding'   sU    " &--/!$Q'/91=&--/!$Q'/91= 
 czr   )NN)r   r   r   r   r*   __classcell__)r    s   @r   r   r   !   s    /r   r   N)	__doc__processing_utilsr   r   utilsr   r   r   __all__r   r   r   <module>r0      sG    A #)  >  : 
r   