File size: 1,059 Bytes
ba6b59e
2dce12e
 
d341a19
2dce12e
 
 
9a141af
d341a19
 
45b9477
d341a19
0a5fc1b
f007468
2dce12e
 
 
 
 
 
 
d341a19
2dce12e
 
 
 
 
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
import gradio as gr
import os
from pathlib import Path
from scipy.io.wavfile import write


def inference(audio):
  os.makedirs("out", exist_ok=True)
  #oldext = os.path.splitext(audio)[1]
  #os.rename(audio.name, "audio" + oldext)
  write('test.wav', audio[0], audio[1])
  os.system("python3 -m demucs.separate -n demucs48_hq -d cpu test.wav -o out")
  #audioname = Path(audio.name).stem
  return "./out/demucs48_hq/test/vocals.wav"
  
title = "Anime2Sketch"
description = "demo for Anime2Sketch. To use it, simply upload your image, or click one of the examples to load them. Read more at the links below."
article = "<p style='text-align: center'><a href='https://arxiv.org/abs/2104.05703'>Adversarial Open Domain Adaption for Sketch-to-Photo Synthesis</a> | <a href='https://github.com/Mukosame/Anime2Sketch'>Github Repo</a></p>"

gr.Interface(
    inference, 
    [gr.inputs.Audio(type="numpy", label="Input")], 
    gr.outputs.Audio(type="file", label="Output"),
    title=title,
    description=description,
    article=article
    ).launch(debug=True)