Deepstory 是一件将自然语言生成(NLG)w/GPT-2、文本转语音(TTS)w/深度卷积 TTS、语音动画 w/语音驱动动画和图像动画 w/一阶运动模型融入其中的艺术作品。媒体应用程序。
简而言之,它将文本/生成的文本转换为视频,其中角色被动画化,用他/她的声音讲述你的故事。
您可以将图像转换为视频,如下所示:
它提供了一个舒适的网络界面和用flask编写的后端来创建你自己的故事。
它支持 Transformer 模型和 pytorch-dctts 模型
Colab (flask-ngrok):https://colab.research.google.com/drive/1HYCPUmFw5rN8kvZdwzFpfBlaUMWPNHas?usp=sharing
视频(如果您需要说明):https://blog.thetobysiu.com/video/
Colab版本即将上线!
Deepstory
├── animator.py
├── app.py
├── data
│ ├── dctts
│ │ ├── Geralt
│ │ │ ├── ssrn.pth
│ │ │ └── t2m.pth
│ │ ├── LJ
│ │ │ ├── ssrn.pth
│ │ │ └── t2m.pth
│ │ └── Yennefer
│ │ ├── ssrn.pth
│ │ └── t2m.pth
│ ├── fom
│ │ ├── vox-256.yaml
│ │ ├── vox-adv-256.yaml
│ │ ├── vox-adv-cpk.pth.tar
│ │ └── vox-cpk.pth.tar
│ ├── gpt2
│ │ ├── Waiting for Godot
│ │ │ ├── config.json
│ │ │ ├── default.txt
│ │ │ ├── merges.txt
│ │ │ ├── pytorch_model.bin
│ │ │ ├── special_tokens_map.json
│ │ │ ├── text.txt
│ │ │ ├── tokenizer_config.json
│ │ │ └── vocab.json
│ │ └── Witcher Books
│ │ ├── config.json
│ │ ├── default.txt
│ │ ├── merges.txt
│ │ ├── pytorch_model.bin
│ │ ├── special_tokens_map.json
│ │ ├── text.txt
│ │ ├── tokenizer_config.json
│ │ └── vocab.json
│ ├── images
│ │ ├── Geralt
│ │ │ ├── 0.jpg
│ │ │ └── fx.jpg
│ │ └── Yennefer
│ │ ├── 0.jpg
│ │ ├── 1.jpg
│ │ ├── 2.jpg
│ │ ├── 3.jpg
│ │ ├── 4.jpg
│ │ └── 5.jpg
│ └── sda
│ ├── grid.dat
│ └── image.bmp
├── deepstory.py
├── generate.py
├── modules
│ ├── dctts
│ │ ├── audio.py
│ │ ├── hparams.py
│ │ ├── __init__.py
│ │ ├── layers.py
│ │ ├── ssrn.py
│ │ └── text2mel.py
│ ├── fom
│ │ ├── animate.py
│ │ ├── dense_motion.py
│ │ ├── generator.py
│ │ ├── __init__.py
│ │ ├── keypoint_detector.py
│ │ ├── sync_batchnorm
│ │ │ ├── batchnorm.py
│ │ │ ├── comm.py
│ │ │ ├── __init__.py
│ │ │ └── replicate.py
│ │ └── util.py
│ └── sda
│ ├── encoder_audio.py
│ ├── encoder_image.py
│ ├── img_generator.py
│ ├── __init__.py
│ ├── rnn_audio.py
│ ├── sda.py
│ └── utils.py
├── README.md
├── requirements.txt
├── static
│ ├── bootstrap
│ │ ├── css
│ │ │ └── bootstrap.min.css
│ │ └── js
│ │ └── bootstrap.min.js
│ ├── css
│ │ └── styles.css
│ └── js
│ └── jquery.min.js
├── templates
│ ├── animate.html
│ ├── deepstory.js
│ ├── gen_sentences.html
│ ├── gpt2.html
│ ├── index.html
│ ├── map.html
│ ├── models.html
│ ├── sentences.html
│ ├── status.html
│ └── video.html
├── test.py
├── text.txt
├── util.py
└── voice.py
它们可以在该项目的谷歌驱动器版本中找到。所有模型(包括杰洛特、叶奈法)都包括在内。
您必须先下载 spacy 英文模型。
确保您的计算机中安装了 ffmpeg,并且安装了 ffmpeg-python。
https://drive.google.com/drive/folders/1AxORLF-QFd2wSORzMOKlvCQSFhdZSODJ?usp=sharing
为了简化事情,谷歌colab版本即将发布......
需要具有至少 4GB VRAM 的 nvidia GPU 才能运行此项目
https://github.com/tugstugi/pytorch-dc-tts
https://github.com/DinoMan/speech-driven-animation
https://github.com/AliaksandrSiarohin/first-order-model
https://github.com/huggingface/transformers
整个项目使用PyTorch,而tensorflow在requirements.txt中列出,它用于变压器将从gpt-2-simple训练的模型转换为Pytorch模型。
仅modules文件夹内的文件与原始文件略有修改。剩下的文件,除了一些引用的部分,都是我写的。
如果你在一个会话中一遍又一遍地合成句子,仍然会出现一些内存问题,但至少需要 10 次才会导致内存溢出。
我还创建了其他工具库来预处理文件。他们可以在我的个人资料中找到。