
    sg                     *    d Z ddlmZ  G d de      Zy)z
Processor class for TVLT.
   )ProcessorMixinc                   V     e Zd ZdZddgZdZdZ fdZ	 	 	 	 	 	 d	dZe	d        Z
 xZS )
TvltProcessora`  
    Constructs a TVLT processor which wraps a TVLT image processor and TVLT feature extractor into a single processor.

    [`TvltProcessor`] offers all the functionalities of [`TvltImageProcessor`] and [`TvltFeatureExtractor`]. See the
    docstring of [`~TvltProcessor.__call__`] for more information.

    Args:
        image_processor (`TvltImageProcessor`):
            An instance of [`TvltImageProcessor`]. The image processor is a required input.
        feature_extractor (`TvltFeatureExtractor`):
            An instance of [`TvltFeatureExtractor`]. The feature extractor is a required input.
    image_processorfeature_extractorTvltImageProcessorTvltFeatureExtractorc                 D    t         |   ||       || _        || _        y )N)r   r   )super__init__r   r   )selfr   r   	__class__s      f/var/www/html/venv/lib/python3.12/site-packages/transformers/models/deprecated/tvlt/processing_tvlt.pyr   zTvltProcessor.__init__(   s&    L]^.!2    c                 <   ||t        d      d}	| | j                  |g|d|i|}
| | j                  |g|ddi|}	| | j                  |g|||d|}i }||j                         ||j                  
       |	|j                  |	       |S )a  
        Forwards the `images` argument to TvltImageProcessor's [`~TvltImageProcessor.preprocess`] and the `audio`
        argument to TvltFeatureExtractor's [`~TvltFeatureExtractor.__call__`]. Please refer to the docstring of the
        above two methods for more information.
        NzCYou need to specify either an `images` or `audio` input to process.
mask_pixelis_mixedT)sampling_rate
mask_audio)
ValueErrorr   r   update)r   imagesaudioimages_mixedr   r   r   argskwargsimages_mixed_dictimages_dict
audio_dictoutput_dicts                r   __call__zTvltProcessor.__call__.   s    " >embcc .$..v^t^*^W]^K# 4 4 4\ bSW bD b[a b///,9jTZJ z*{+(01r   c                     | j                   j                  }| j                  j                  }t        t        j                  ||z               S )N)r   model_input_namesr   listdictfromkeys)r   image_processor_input_namesfeature_extractor_input_namess      r   r#   zTvltProcessor.model_input_namesU   sA    &*&:&:&L&L#(,(>(>(P(P%DMM"=@]"]^__r   )NNNNFF)__name__
__module____qualname____doc__
attributesimage_processor_classfeature_extractor_classr   r!   propertyr#   __classcell__)r   s   @r   r   r      sV     $%89J043 %N ` `r   r   N)r,   processing_utilsr   r    r   r   <module>r4      s    0C`N C`r   