Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -7,6 +7,15 @@ import random
|
|
7 |
labels = ["Real Audio 🗣️", "Cloned Audio 🤖"]
|
8 |
DURATION = 2
|
9 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
10 |
|
11 |
def get_accuracy(score_matrix) -> str:
|
12 |
|
@@ -29,8 +38,10 @@ def confusion_matrix_to_markdown(matrix, labels=None):
|
|
29 |
labels = labels or [f"Class {i}" for i in range(num_labels)]
|
30 |
accuracy = get_accuracy(matrix)
|
31 |
|
|
|
|
|
32 |
# Header row
|
33 |
-
markdown
|
34 |
markdown += f"| {' | '.join(['---'] * (num_labels + 1))} |\n"
|
35 |
|
36 |
# Data rows
|
@@ -104,6 +115,8 @@ with gr.Blocks() as demo:
|
|
104 |
current_audio = gr.State(get_random_audio)
|
105 |
score_matrix = gr.State([[0, 0], [0, 0]])
|
106 |
|
|
|
|
|
107 |
with gr.Column():
|
108 |
with gr.Row():
|
109 |
audio_cmp = gr.Audio(
|
|
|
7 |
labels = ["Real Audio 🗣️", "Cloned Audio 🤖"]
|
8 |
DURATION = 2
|
9 |
|
10 |
+
MD_DESCRIPTION = """
|
11 |
+
# Clone Guesser
|
12 |
+
|
13 |
+
Try to guess if the voice is real 🗣️ or cloned 🤖.
|
14 |
+
|
15 |
+
Each cloned voice is taken from a real voice, so the text itself is not a hint!
|
16 |
+
|
17 |
+
For more information about the data, see the [dataset page](https://huggingface.co/datasets/jerpint/vox-cloned-data)
|
18 |
+
"""
|
19 |
|
20 |
def get_accuracy(score_matrix) -> str:
|
21 |
|
|
|
38 |
labels = labels or [f"Class {i}" for i in range(num_labels)]
|
39 |
accuracy = get_accuracy(matrix)
|
40 |
|
41 |
+
markdown = "Scoreboard \n"
|
42 |
+
|
43 |
# Header row
|
44 |
+
markdown += f"| {' | '.join([''] + labels)} |\n"
|
45 |
markdown += f"| {' | '.join(['---'] * (num_labels + 1))} |\n"
|
46 |
|
47 |
# Data rows
|
|
|
115 |
current_audio = gr.State(get_random_audio)
|
116 |
score_matrix = gr.State([[0, 0], [0, 0]])
|
117 |
|
118 |
+
gr.Markdown(MD_DESCRIPTION)
|
119 |
+
|
120 |
with gr.Column():
|
121 |
with gr.Row():
|
122 |
audio_cmp = gr.Audio(
|