o
    rqi
                     @   sf  d dl Z d dlmZmZmZmZmZmZ d dlZd dl	Z	d dl
mZ d dlmZ d dlmZ d dlmZ d dlmZ d dlmZmZ d d	lmZmZmZ d d
lmZ e ZdgZejej ej!dejej"ej!dejej#ej!dejej$ej!dejej%ej!dejej&ej!dejej'ej!dejej(ej!dejej)ej!dG dd deZ*dS )    N)AnyDictListSequenceTupleUnion)	Pipelines)Model)
OutputKeys)Pipeline)	PIPELINES)generate_scp_from_urlupdate_local_model)
Frameworks	ModelFileTasks)
get_loggerFunASRPipeline)module_namec                       sF   e Zd ZdZd	deeef f fddZdeee	f fddZ
  ZS )
r   a  Voice Activity Detection Inference Pipeline
    use `model` to create a Voice Activity Detection pipeline.

    Args:
        model: A model instance, or a model local dir, or a model id in the model hub.
        kwargs (dict, `optional`):
            Extra kwargs passed into the preprocessor's constructor.

    Example:
        >>> from modelscope.pipelines import pipeline
        >>> p = pipeline(
        >>>    task=Tasks.voice_activity_detection, model='damo/speech_fsmn_vad_zh-cn-16k-common-pytorch')
        >>> audio_in='https://isv-data.oss-cn-hangzhou.aliyuncs.com/ics/MaaS/ASR/test_audio/vad_example.pcm'
        >>> print(p(audio_in))

    Nmodelc                    s   t  jdd|i| dS )z=use `model` to create an vad pipeline for prediction
        r   N )super__init__)selfr   kwargs	__class__r   q/home/app/PaddleOCR-VL/.venv_paddleocr/lib/python3.10/site-packages/modelscope/pipelines/audio/funasr_pipeline.pyr   ;   s   zFunASRPipeline.__init__returnc                 O   s   | j |i |}|S )z
        Decoding the input audios
        Args:
            input('str' or 'bytes'):
        Return:
            a list of dictionary of result.
        )r   )r   argsr   outputr   r   r   __call__@   s   	zFunASRPipeline.__call__)N)__name__
__module____qualname____doc__r   r	   strr   r   r   r!   __classcell__r   r   r   r   r      s    )+ostypingr   r   r   r   r   r   jsonyamlZmodelscope.metainfor   Zmodelscope.modelsr	   Zmodelscope.outputsr
   Zmodelscope.pipelines.baser   Zmodelscope.pipelines.builderr   Z"modelscope.utils.audio.audio_utilsr   r   Zmodelscope.utils.constantr   r   r   Zmodelscope.utils.loggerr   logger__all__Zregister_moduleZauto_speech_recognitionZfunasr_pipelineZvoice_activity_detectionZlanguage_score_predictionpunctuationZspeaker_diarizationZspeaker_verificationZspeech_separationZspeech_timestampZemotion_recognitionr   r   r   r   r   <module>   sT    &