readme: ---
  language:
  - en
  library_name: nemo
  datasets:
  - VOXCELEB-1
  - VOXCELEB-2
  - FISHER
  - switchboard
  - librispeech_asr
  - SRE (2004-2010) 
  thumbnail: null
  tags:
  - speaker
  - speech
  - audio
  - speaker-verification
  - speaker-recognition
  - speaker-diarization
  - titanet
  - NeMo
  - pytorch
  license: cc-by-4.0
  widget:
  - src: https://huggingface.co/nvidia/speakerverification_en_titanet_large/resolve/main/an255-fash-b.wav
    example_title: Speech sample 1
  - src: https://huggingface.co/nvidia/speakerverification_en_titanet_large/resolve/main/cen7-fash-b.wav
    example_title: Speech sample 2
  model-index:
  - name: speakerverification_en_titanet_large
    results:
    - task:
        name: Speaker Verification
        type: speaker-verification
      dataset:
        name: voxceleb1
        type: voxceleb1-O
        config: clean
        split: test
        args:
          language: en
      metrics:
      - name: Test EER
        type: eer
        value: 0.66
    - task:
        type: Speaker Diarization
        name: speaker-diarization
      dataset:
        name: ami-mixheadset
        type: ami_diarization
        config: oracle-vad-known-number-of-speakers
        split: test
        args:
          language: en
      metrics:
      - name: Test DER
        type: der
        value: 1.73  
    - task:
        type: Speaker Diarization
        name: speaker-diarization
      dataset:
        name: ami-lapel
        type: ami_diarization
        config: oracle-vad-known-number-of-speakers
        split: test
        args:
          language: en
      metrics:
      - name: Test DER
        type: der
        value: 2.03
    - task:
        type: Speaker Diarization
        name: speaker-diarization
      dataset:
        name: ch109
        type: callhome_diarization
        config: oracle-vad-known-number-of-speakers
        split: test
        args:
          language: en
      metrics:
      - name: Test DER
        type: der
        value: 1.19
    - task:
        type: Speaker Diarization
        name: speaker-diarization
      dataset:
        name: nist-sre-2000
        type: nist-sre_diarization
        config: oracle-vad-known-number-of-speakers
        split: test
        args:
          language: en
      metrics:
      - name: Test DER
        type: der
        value: 6.73
  ---
  
  # NVIDIA TitaNet-Large (en-US)
  
  <style>
  img {
   display: inline;
  }
  </style>
  
  | [![Model architecture](https://img.shields.io/badge/Model_Arch-TitaNet--Large-lightgrey#model-badge)](#model-architecture)
  | [![Model size](https://img.shields.io/badge/Params-23M-lightgrey#model-badge)](#model-architecture)
  | [![Language](https://img.shields.io/badge/Language-en--US-lightgrey#model-badge)](#datasets)
  
  
  This model extracts speaker embeddings from given speech, which is the backbone for speaker verification and diarization tasks.
  It is a "large" version of TitaNet (around 23M parameters) models.  
  See the [model architecture](#model-architecture) section and [NeMo documentation](https://docs.nvidia.com/deeplearning/nemo/user-guide/docs/en/stable/asr/speaker_recognition/models.html#titanet) for complete architecture details.
  
  ## NVIDIA NeMo: Training
  
  To train, fine-tune or play with the model you will need to install [NVIDIA NeMo](https://github.com/NVIDIA/NeMo). We recommend you install it after you've installed the latest Pytorch version.
  ```
  pip install nemo_toolkit['all']
  ``` 
  
  ## How to Use this Model
  
  The model is available for use in the NeMo toolkit [3] and can be used as a pre-trained checkpoint for inference or for fine-tuning on another dataset.
  
  ### Automatically instantiate the model
  
  ```python
  import nemo.collections.asr as nemo_asr
  speaker_model = nemo_asr.models.EncDecSpeakerLabelModel.from_pretrained("nvidia/speakerverification_en_titanet_large")
  ```
  
  ### Embedding Extraction
  
  Using 
  
  ```python
  emb = speaker_model.get_embedding("an255-fash-b.wav")
  ```
  
  ### Verifying two utterances (Speaker Verification)
  
  Now to check if two audio files are from the same speaker or not, simply do:
  
  ```python
  speaker_model.verify_speakers("an255-fash-b.wav","cen7-fash-b.wav")
  ```
  
  ### Extracting Embeddings for more audio files
  
  To extract embeddings from a bunch of audio files:
  
  Write audio files to a `manifest.json` file with lines as in format:
  
  ```json
  {"audio_filepath": "<absolute path to dataset>/audio_file.wav", "duration": "duration of file in sec", "label": "speaker_id"}
  ```
  
  Then running following script will extract embeddings and writes to current working directory:
  ```shell
  python <NeMo_root>/examples/speaker_tasks/recognition/extract_speaker_embeddings.py --manifest=manifest.json
  ```
  
  ### Input
  
  This model accepts 16000 KHz Mono-channel Audio (wav files) as input.
  
  ### Output
  
  This model provides speaker embeddings for an audio file. 
  
  ## Model Architecture
  
  TitaNet model is a depth-wise separable conv1D model [1] for Speaker Verification and diarization tasks. You may find more info on the detail of this model here: [TitaNet-Model](https://docs.nvidia.com/deeplearning/nemo/user-guide/docs/en/main/asr/speaker_recognition/models.html). 
  
  ## Training
  
  The NeMo toolkit [3] was used f