|
import gradio as gr |
|
from transformers import pipeline |
|
|
|
|
|
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() |
|
|