Spaces:
Runtime error
Runtime error
import gradio as gr | |
import argparse | |
import functools | |
import numpy as np | |
import torch | |
from infer_contrast import run | |
from utils.reader import load_audio | |
from utils.utility import add_arguments, print_arguments | |
def voiceRecognition(audio1,audio2): | |
text = run(audio1,audio2) | |
return text | |
title = "Voice Recognition" | |
description = "This voice recognition demo(Chinese Format) is a simple implementation based on ResNet. It used ArcFace Loss and an open source Chinese voice corpus - zhvoice." | |
inputs = [gr.inputs.Audio(source="upload",type="filepath", label="Speaker1"), | |
gr.inputs.Audio(source="upload",type="filepath", label="Speaker2")] | |
article = ( | |
"<p style='text-align: center'>" | |
"<a href='https://github.com/yeyupiaoling/VoiceprintRecognition-Pytorch' target='_blank'>💻 Original Dataset</a> | " | |
"<a href='https://github.com/fighting41love/zhvoice' target='_blank'>🎙️ zhvoice dataset</a> | " | |
"</p>" | |
) | |
examples = [ | |
["samples/李云龙1.wav", "samples/李云龙2.wav"], | |
["samples/马保国1.wav", "samples/马保国2.wav"], | |
["samples/周杰伦1.wav", "samples/周杰伦2.wav"]] | |
interface = gr.Interface( | |
fn=voiceRecognition, | |
inputs=inputs, | |
outputs="text", | |
title=title, | |
description=description, | |
examples=examples, | |
enable_queue=True) | |
interface.launch(debug=True,share=True) |