File size: 639 Bytes
fa549cd
 
 
38d6c01
fa549cd
 
38d6c01
 
 
 
 
fa549cd
38d6c01
 
 
fa549cd
38d6c01
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
import gradio as gr
from transformers import pipeline

# Load audio classification pipeline with an open model
model = pipeline("audio-classification", model="motheecreator/Deepfake-audio-detection")

def detect_deepfake(audio):
    result = model(audio)[0]
    label = result['label']
    score = result['score']
    return f"{label} ({round(score * 100, 2)}%)"

gr.Interface(
    fn=detect_deepfake,
    inputs=gr.Audio(type="filepath", label="Upload a voice clip"),
    outputs="text",
    title="AI Voice Detector",
    description="This tool uses a trained AI model to detect whether a voice clip is real or AI-generated."
).launch()