Spaces:
Running
Running
updated the UI
Browse files
app.py
CHANGED
@@ -89,45 +89,63 @@ class VPInterface:
|
|
89 |
|
90 |
model = VPInterface()
|
91 |
|
|
|
92 |
article = """
|
93 |
-
|
94 |
-
|
95 |
-
you should receive a new voice.
|
96 |
|
97 |
-
|
98 |
-
|
99 |
-
|
100 |
|
101 |
-
|
102 |
-
this Huggingface space runs on CPU which makes the demo quite slow.
|
103 |
|
104 |
-
|
|
|
|
|
|
|
|
|
|
|
105 |
"""
|
106 |
|
107 |
description = """
|
108 |
-
##
|
|
|
109 |
"""
|
110 |
|
111 |
css = """
|
112 |
-
.gr-button-primary {
|
|
|
|
|
|
|
113 |
"""
|
114 |
|
115 |
-
iface = gr.Interface(
|
116 |
-
|
117 |
-
|
118 |
-
|
119 |
-
|
120 |
-
|
121 |
-
|
122 |
-
|
123 |
-
|
124 |
-
|
125 |
-
|
126 |
-
|
127 |
-
|
128 |
-
|
129 |
-
|
130 |
-
|
131 |
-
|
132 |
-
|
133 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
89 |
|
90 |
model = VPInterface()
|
91 |
|
92 |
+
# ββ UI copy & look-and-feel for βanamedi Ghostβ ββββββββββββββββββββββββββββββββ
|
93 |
article = """
|
94 |
+
**anamedi Ghost** lets you **anonymize _and_ pseudonymize** short speech samples in a single click.
|
95 |
+
Under the hood the demo chains three micro-models:
|
|
|
96 |
|
97 |
+
* **ASR engine** β turns speech into text
|
98 |
+
* **Voice-privacy module** β scrambles the speaker embedding (pool/random/pool-raw)
|
99 |
+
* **TTS synthesizer** β renders the same words with a surrogate voice
|
100 |
|
101 |
+
Every time you hit **Submit** youβll get a new, privacy-safe version of your input.
|
|
|
102 |
|
103 |
+
> **Heads-up**
|
104 |
+
> β’ This Space runs on CPU, so inference can take ~20 s.
|
105 |
+
> β’ The βpoolβ setting uses an ad-hoc scaler (`StandardScaler`) because we process just one sample at a time; in production Ghost uses a batch-optimised `MinMaxScaler`.
|
106 |
+
> β’ Quality is still work-in-progressβplease report glitches!
|
107 |
+
|
108 |
+
π Source & docs: <https://github.com/anamedi/ghost>
|
109 |
"""
|
110 |
|
111 |
description = """
|
112 |
+
## anamedi Ghost β Voice Privacy Demo (v0.1)
|
113 |
+
Try it out: record a short English sentence, pick your privacy mode, then listen to the anonymized result.
|
114 |
"""
|
115 |
|
116 |
css = """
|
117 |
+
.gr-button-primary {
|
118 |
+
background-color: #00b7c2 !important; /* anamedi teal */
|
119 |
+
border-color: #00b7c2 !important;
|
120 |
+
}
|
121 |
"""
|
122 |
|
123 |
+
iface = gr.Interface(
|
124 |
+
fn=model.read,
|
125 |
+
inputs=[
|
126 |
+
gr.inputs.Audio(source="microphone", type="numpy",
|
127 |
+
label="ποΈ Speak a sentence (English)"),
|
128 |
+
gr.inputs.Dropdown(
|
129 |
+
["phones", "STT", "TTS"],
|
130 |
+
type="value", default="phones",
|
131 |
+
label="ASR engine"),
|
132 |
+
gr.inputs.Dropdown(
|
133 |
+
["pool", "random", "pool raw"],
|
134 |
+
type="value", default="pool",
|
135 |
+
label="Privacy mode"),
|
136 |
+
gr.inputs.Dropdown(
|
137 |
+
["Libri100", "Libri100 + finetuned", "Libri600",
|
138 |
+
"Libri600 + finetuned"],
|
139 |
+
type="value", default="Libri100",
|
140 |
+
label="TTS voice")
|
141 |
+
],
|
142 |
+
outputs=gr.outputs.Audio(type="numpy", label="π Anonymized audio"),
|
143 |
+
layout="vertical",
|
144 |
+
title="anamedi Ghost β Voice Privacy Demo",
|
145 |
+
description=description,
|
146 |
+
theme="default",
|
147 |
+
allow_flagging="never",
|
148 |
+
article=article,
|
149 |
+
allow_screenshot=False
|
150 |
+
)
|
151 |
+
iface.launch(enable_queue=True)
|