|
|
|
import pandas as pd |
|
import gradio as gr |
|
from utils import load_leaderboard |
|
import numpy as np |
|
from huggingface_hub import snapshot_download |
|
|
|
|
|
def make_clickable(url, name): |
|
return f'<a href="{url}" target="_blank">{name}</a>' |
|
|
|
def render_info_html(): |
|
info_text = "With the growing advent of machine-generated speech, the scientific community is responding with exciting resources " \ |
|
"to detect deep fakes. With research moving at such a rapid pace, it becomes challenging to keep track of generalizability " \ |
|
"of SOTA DF detection systems. This leaderboard thus presents a comprehensive benchmark of 10 SOTA speech antispoofing " \ |
|
"systems across 13 popular speech deep fake detection datasets." |
|
|
|
|
|
return gr.Markdown(info_text) |
|
|
|
def highlight_min(s, props=''): |
|
return np.where(s == np.nanmin(s.values), props, '') |
|
|
|
def render_leader_board(leaderboard_df, model_citations): |
|
|
|
if not leaderboard_df.empty: |
|
|
|
|
|
|
|
leaderboard_df.insert(1, 'Average', leaderboard_df.loc[:, ['In-the-wild','ASVSpoof2019','ASVSpoof2021LA','ASVSpoof2021DF','ASVSpoof2024-Dev','ASVSpoof2024-Eval','FakeOrReal','codecfake3','ADD2022','ADD2023','DFADD','LibriVoc','SONAR']].mean(axis=1)) |
|
|
|
leaderboard_df = leaderboard_df.sort_values(by="Average", ascending=True).reset_index(drop=True) |
|
|
|
|
|
leaderboard_df["System"] = leaderboard_df["System"].apply(lambda x: f"[{x}]({model_citations.get(x, '#')})") |
|
|
|
emojis = ["π₯", "π₯", "π₯"] |
|
|
|
leaderboard_df.System[0] = f"{emojis[0]} {leaderboard_df.System[0]}" |
|
leaderboard_df.System[1] = f"{emojis[1]} {leaderboard_df.System[1]}" |
|
leaderboard_df.System[2] = f"{emojis[2]} {leaderboard_df.System[2]}" |
|
temp = leaderboard_df.loc[:, ['System', 'Training Data', 'Num Parameters', 'Data Augmentation']] |
|
|
|
styler = ( |
|
leaderboard_df |
|
.drop(columns=['Training Data', 'Num Parameters', 'Data Augmentation'], axis=1).style \ |
|
.format(precision=2)) |
|
styler.apply(highlight_min, props='color:green', axis=0) |
|
|
|
|
|
|
|
|
|
|
|
return gr.Dataframe(styler, datatype=['markdown'] * 1 + ['number'] * 14) |
|
return gr.HTML(value="<p>No data available in the leaderboard.</p>") |
|
|