Spaces:
Runtime error
Runtime error
File size: 1,370 Bytes
3be9ff2 e0dec14 3be9ff2 9f6e983 3be9ff2 785a1fb 3be9ff2 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 |
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) |