123456789101112131415161718192021222324252627282930 |
- import celery
- import string
- import random
- import os
- # export CUDA_VISIBLE_DEVICES=0 ; python3.7 train.py -content /tmp/demo.wav -style input/girl52.wav
- #py -3.7 save_mel.py --face a1.mp4 --audio eng1.mp3 --checkpoint_path wav2lip_gan.pth
- #export CUDA_VISIBLE_DEVICES=0 ; python3.7 save_mel.py --face nina.mp4 --audio /tmp/demo.wav --checkpoint_path wav2lip_gan.pth
- from celery import Celery
- app = Celery('tasks', broker='redis://db.ptt.cx/0')
- @app.task
- def to_video(fname):
- os.chdir('/home/jared/to_video')
- os.system('export CUDA_VISIBLE_DEVICES=0 ; python3.7 save_mel.py --face nina-no-ges.mp4 --audio /var/wav/'+fname+'.wav --outfile /var/video/'+fname+'.mp4 --checkpoint_path gan.pth')
- #text2mel_name="TACOTRON"
- return "ok"
- @app.task
- def to_wav(txt):
- import zhtts
- letters = string.digits
- rstr= ''.join(random.choice(letters) for i in range(10))
- #text2mel_name="TACOTRON"
- tts = zhtts.TTS() # use fastspeech2 by default
- #tts = zhtts.TTS(text2mel_name="TACOTRON") # use fastspeech2 by default
- tts.text2wav(txt, "/var/wav/"+rstr+".wav")
- return rstr
|