Update README.md
Browse files
README.md
CHANGED
|
@@ -1,26 +1,22 @@
|
|
| 1 |
-
|
| 2 |
-
library_name: transformers
|
| 3 |
-
base_model: Gustking/wav2vec2-large-xlsr-deepfake-audio-classification
|
| 4 |
-
base_model_relation: finetune
|
| 5 |
license: apache-2.0
|
| 6 |
-
language:
|
| 7 |
-
- en
|
| 8 |
pipeline_tag: audio-classification
|
|
|
|
| 9 |
tags:
|
| 10 |
-
|
| 11 |
- wav2vec2
|
| 12 |
- deepfake-detection
|
| 13 |
- synthetic-speech
|
| 14 |
- tts
|
| 15 |
- voice-cloning
|
| 16 |
-
datasets:
|
| 17 |
-
- garystafford/deepfake-audio-detection
|
| 18 |
metrics:
|
| 19 |
- accuracy
|
| 20 |
- f1
|
| 21 |
- precision
|
| 22 |
- recall
|
| 23 |
- roc_auc
|
|
|
|
| 24 |
Deepfake Audio Detection Model
|
| 25 |
Fine-tuned Wav2Vec2 model for detecting AI-generated speech. Determines if audio was spoken by a human or created by AI text-to-speech/voice cloning software.
|
| 26 |
|
|
@@ -56,7 +52,6 @@ import librosa
|
|
| 56 |
from transformers import AutoModelForAudioClassification, AutoFeatureExtractor
|
| 57 |
|
| 58 |
# Load model and feature extractor
|
| 59 |
-
model_name = "garystafford/wav2vec2-deepfake-voice-detector"
|
| 60 |
model = AutoModelForAudioClassification.from_pretrained(model_name)
|
| 61 |
feature_extractor = AutoFeatureExtractor.from_pretrained(model_name)
|
| 62 |
|
|
@@ -105,8 +100,6 @@ dim=-1: Applies softmax across classes for each sample, not across samples
|
|
| 105 |
Batch Processing Example
|
| 106 |
import glob
|
| 107 |
|
| 108 |
-
audio_files = glob.glob("audio_folder/*.wav")
|
| 109 |
-
|
| 110 |
for audio_path in audio_files:
|
| 111 |
audio, _ = librosa.load(audio_path, sr=16000, mono=True)
|
| 112 |
inputs = feature_extractor(audio, sampling_rate=16000, return_tensors="pt", padding=True)
|
|
|
|
| 1 |
+
---
|
|
|
|
|
|
|
|
|
|
| 2 |
license: apache-2.0
|
| 3 |
+
language: en
|
|
|
|
| 4 |
pipeline_tag: audio-classification
|
| 5 |
+
library_name: transformers
|
| 6 |
tags:
|
| 7 |
+
- audio
|
| 8 |
- wav2vec2
|
| 9 |
- deepfake-detection
|
| 10 |
- synthetic-speech
|
| 11 |
- tts
|
| 12 |
- voice-cloning
|
|
|
|
|
|
|
| 13 |
metrics:
|
| 14 |
- accuracy
|
| 15 |
- f1
|
| 16 |
- precision
|
| 17 |
- recall
|
| 18 |
- roc_auc
|
| 19 |
+
---
|
| 20 |
Deepfake Audio Detection Model
|
| 21 |
Fine-tuned Wav2Vec2 model for detecting AI-generated speech. Determines if audio was spoken by a human or created by AI text-to-speech/voice cloning software.
|
| 22 |
|
|
|
|
| 52 |
from transformers import AutoModelForAudioClassification, AutoFeatureExtractor
|
| 53 |
|
| 54 |
# Load model and feature extractor
|
|
|
|
| 55 |
model = AutoModelForAudioClassification.from_pretrained(model_name)
|
| 56 |
feature_extractor = AutoFeatureExtractor.from_pretrained(model_name)
|
| 57 |
|
|
|
|
| 100 |
Batch Processing Example
|
| 101 |
import glob
|
| 102 |
|
|
|
|
|
|
|
| 103 |
for audio_path in audio_files:
|
| 104 |
audio, _ = librosa.load(audio_path, sr=16000, mono=True)
|
| 105 |
inputs = feature_extractor(audio, sampling_rate=16000, return_tensors="pt", padding=True)
|