Download app.py from Pablo276/prova: direct link, hf CLI and curl.
- Browser
- Download file 505 Bytes
-
https://huggingface.co/spaces/Pablo276/prova/resolve/main/app.py
- Command line
-
hf download hf://spaces/Pablo276/prova/app.py
-
curl -L -o app.py https://huggingface.co/spaces/Pablo276/prova/resolve/main/app.py
505 Bytes
| import gradio as gr | |
| import pesq | |
| def calculate_mos_difference(ref_file, deg_file): | |
| ref_mos = pesq.pesq(ref_file, ref_file, 'wb') | |
| deg_mos = pesq.pesq(ref_file, deg_file, 'wb') | |
| mos_difference = ref_mos - deg_mos | |
| return mos_difference | |
| audio_inputs = [ | |
| gr.inputs.Audio(label="Reference Audio"), | |
| gr.inputs.Audio(label="Degraded Audio") | |
| ] | |
| output = gr.outputs.Textbox(label="MOS Value Difference") | |
| gr.Interface(fn=calculate_mos_difference, inputs=audio_inputs, outputs=output).launch() | |