Hyperion Grl Deepfake Detector
This repository packages a Hyperion GRL-trained audio deepfake detector for local inference from a cloned Hugging Face repository. The needed Hyperion runtime code is included under hyperion/, so you do not need a...
Model source
- Kind
- Other
- File size
- 1.21 GB
- Version
- vRevision 1418413
- Updated
- Oct 19, 2026
- Downloads
- 10
- Source
- Hugging Face
Source description
Hyperion GRL Deepfake Detector
This repository packages a Hyperion GRL-trained audio deepfake detector for local inference from a cloned Hugging Face repository. The needed Hyperion runtime code is included under hyperion/, so you do not need a separate Hyperion checkout for inference.
Model
- Backbone:
facebook/wav2vec2-xls-r-300m - Classifier: Hyperion wav2vec2 + ResNet1D x-vector head
- Training variant: GRL deepfake detector
- Source checkpoint epoch:
model_ep0001.pth - Input: mono waveform, resampled to 16 kHz
- Output labels:
bonafide,spoof - Packaged checkpoint:
model.pth
Setup
Create a Python 3.10 conda environment, clone the repository, and install dependencies:
conda create -n hyperion_grl_infer python=3.10 -y
conda activate hyperion_grl_infer
git lfs install
git clone https://huggingface.co/RuiRuihigh/hyperion-grl-deepfake-detector
cd hyperion-grl-deepfake-detector
pip install -r requirements.txt
Confirm that the model checkpoint was downloaded by Git LFS:
ls -lh model.pth
If model.pth is only a few KB, run:
git lfs pull
Command Line Inference
Run inference from inside the cloned repository:
python inference.py example.wav --model-dir .
By default, the script uses GPU automatically when CUDA is available. If CUDA is not available, it falls back to CPU.
For multiple audio files:
python inference.py a.wav b.wav c.wav --model-dir . --batch-size 8
Force CPU inference:
python inference.py example.wav --model-dir . --device cpu
Force GPU inference:
python inference.py example.wav --model-dir . --device cuda
Command Line Arguments
audio: one or more input audio files to classify. Example:example.wavora.wav b.wav c.wav.--model-dir: directory containingconfig.json,model.pth, and the vendoredhyperion/code. Default:..--device: inference device. Choices:auto,cpu,cuda. Default:auto, which uses CUDA if available and otherwise uses CPU.--batch-size: number of audio files processed per batch when more than one input file is provided. Default:8.
Example output:
{
"label": "bonafide",
"score": 0.946759045124054,
"scores": {
"bonafide": 0.946759045124054,
"spoof": 0.053241003304719925
}
}
Python API
If your Python script is inside the cloned repository, load the local model directory with from_local_dir:
from inference import DeepfakeDetector
detector = DeepfakeDetector.from_local_dir(".")
result = detector.predict("example.wav")
print(result)
from_local_dir(".") also uses GPU automatically when CUDA is available. To force a device:
detector = DeepfakeDetector.from_local_dir(".", device="cpu")
# or
detector = DeepfakeDetector.from_local_dir(".", device="cuda")
Batch inference:
from inference import DeepfakeDetector
detector = DeepfakeDetector.from_local_dir(".")
results = detector.predict_batch(["a.wav", "b.wav", "c.wav"], batch_size=8)
for result in results:
print(result)
If your Python script is outside the cloned repository, add the cloned repository to PYTHONPATH or run the script from this directory, and pass the full model directory path:
from inference import DeepfakeDetector
detector = DeepfakeDetector.from_local_dir("/path/to/hyperion-grl-deepfake-detector")
result = detector.predict("/path/to/example.wav")
print(result)
Python API Arguments
DeepfakeDetector.from_local_dir(model_dir, device=None): loadsconfig.jsonandmodel.pthfrom a local model directory.device=Nonemeans auto-select CUDA if available, otherwise CPU.DeepfakeDetector.from_pretrained(repo_id, device=None): downloadsconfig.jsonandmodel.pthfrom a Hugging Face repo, then loads the model. This still requiresinference.pyand the vendoredhyperion/code to be importable locally.detector.predict(audio_path): runs inference for one audio file and returns a dictionary withlabel,score, andscores.detector.predict_batch(audio_paths, batch_size=8): runs batched inference for a list of audio files.
Files
inference.py: command line inference and Python API.config.json: model metadata and runtime settings.model.pth: checkpoint containingmodel_cfgandmodel_state_dict.hyperion/: vendored runtime modules needed to reconstruct the model.requirements.txt: Python dependencies.
Notes
--model-dir .means the model files are in the current directory.- CPU inference can be slow because the model uses
wav2vec2-xls-r-300m. - Audio is loaded with
soundfileand resampled to 16 kHz when needed.
Sources
1 source
Sources
1 sourceVerified Oct 19
Model artifacts
1 artifact
Model artifacts
1 artifactSource excerpts
3 excerpts
Source excerpts
3 excerpts--- library_name: pytorch pipeline_tag: audio-classification tags: - audio - deepfake-detection - spoofing-detection - wav2vec2 - pytorch --- # Hyperion GRL Deepfake Detector This repository packages a Hyperion GRL-trained audio deepfake detector for local inference from a cloned Hugging Face repository. The needed Hyperion runtime code is included under `hyperion/`, so you do not need a separate Hyperion checkout for inference. ## Model - Backbone: `facebook/wav2vec2-xls-r-300m` - Classifier: Hyperion wav2vec2 + ResNet1D x-vector head - Training variant: GRL deepfake detector - Source checkpoint epoch: `model_ep0001.pth` - Input: mono waveform, resampled to 16 kHz - Output labels: `bonafide`, `spoof` - Packaged checkpoint: `model.pth` ## Setup Create a Python 3.10 conda environment, clone the repository, and install dependencies: ```bash conda create -n hyperion_grl_infer python=3.10 -y conda activate hyperion_grl_infer git lfs install git clone https://huggingface.co/RuiRuihigh/hyperion-grl-deepfake-detector cd hyperion-grl-deepfake-detector pip install -r requirements.txt ``` Confirm that the model checkpoint was downloaded by Git LFS: ```bash ls -lh model.pth ``` If `model.pth` is only a few KB, run: ```bash git lfs pull ``` ## Command Line Inference Run inference from inside the cloned repository: ```bash python inference.py example.wav --model-dir . ``` By default, the script uses GPU automatically when CUDA is available. If CUDA is not available, it falls back to CPU. For multiple audio files: ```bash python inference.py a.wav b.wav c.wav --model-dir . --batch-size 8 ``` Force CPU inference: ```bash python inference.py example.wav --model-dir . --device cpu ``` Force GPU inference: ```bash python inference.py example.wav --model-dir . --device cuda ``` ### Command Line Arguments - `audio`: one or more input audio files to classify. Example: `example.wav` or `a.wav b.wav c.wav`. - `--model-dir`: directory containing `config.json`, `model.pth`, and the vendored `hyperion/` code. Default: `.`. - `--device`: inference device. Choices: `auto`, `cpu`, `cuda`. Default: `auto`, which uses CUDA if available and otherwise uses CPU. - `--batch-size`: number of audio files processed per batch when more than one input file is provided. Default: `8`. Example output: ```json { "label": "bonafide", "score": 0.946759045124054, "scores"...
Source context: 10 downloads · 0 likes · Pipeline audio-classification · Library pytorch · Repo RuiRuihigh/hyperion-grl-deepfake-detector
Source context: 4 downloads · 0 likes · Pipeline audio-classification · Library pytorch · Repo RuiRuihigh/hyperion-grl-deepfake-detector
