Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[TTS][Paddle-Lite]add a TTS demo for ARM Linux #2991

Merged
merged 16 commits into from Mar 7, 2023

Conversation

SwimmingTiger
Copy link
Contributor

@SwimmingTiger SwimmingTiger commented Mar 6, 2023

PR types

Others

PR changes

Others

Describe

Add a TTS demo for ARM Linux.


PaddleSpeech TTS 文本到语音 ARM Linux Demo

修改自demos/TTSAndroid,模型也来自该安卓Demo。

使用与安卓Demo版本相同的Paddle-Lite推理库(Paddle-Lite:68b66fd35),
该库兼容 Ubuntu 16.04 到 20.04,如果你的发行版与其不兼容,可以自行从源代码编译。

注意 Paddle-Lite 2.12 与TTS不兼容,无法导出或运行TTS模型,需要使用更新的版本(比如develop分支中的代码)。

配置

git clone -b upstream-pr1 https://github.com/SwimmingTiger/PaddleSpeech.git
cd ./PaddleSpeech/demos/TTSArmLinux

打开 config.sh 按需修改配置。

默认编译64位版本,如果要编译32位版本,把ARM_ABI=armv8改成ARM_ABI=armv7hf

下载Paddle Lite库文件和模型文件

./download.sh

安装依赖

以 Ubuntu 18.04 为例:

sudo apt install build-essential cmake libopencv-dev

编译

./build.sh

运行

./run.sh

将把src/main.cpp里定义在sentencesToChoose数组中的十句话转换为wav文件,保存在output文件夹中。

测试环境

我在 RK3588 上用 docker 测的
docker run --name ubuntu-18.04-armhf --privileged -v ~/work:/parent/work --network=host -it armv7/armhf-ubuntu:18.04
docker run --name ubuntu-18.04 --privileged -v ~/work:/parent/work --network=host -it ubuntu:18.04 # host是arm64

macOS里的docker应该也能这样测吧

@paddle-bot
Copy link

paddle-bot bot commented Mar 6, 2023

Thanks for your contribution!

@CLAassistant
Copy link

CLAassistant commented Mar 6, 2023

CLA assistant check
All committers have signed the CLA.

@yt605155624
Copy link
Collaborator

大神,加微信聊下?PaddleSpeech 用户群搜索 “子龙”

@yt605155624 yt605155624 changed the title add a TTS demo for ARM Linux [TTS]add a TTS demo for ARM Linux Mar 6, 2023
@yt605155624 yt605155624 self-requested a review March 6, 2023 03:11
@yt605155624 yt605155624 added this to the r1.4.0 milestone Mar 6, 2023
> Paddle-Lite/lite/api/light_api.cc:462 CheckInputValid]  Error input tensor precision type. Input index (0) Tensor name (text) Require precision type (int64_t) Input precision type (float).
@yt605155624
Copy link
Collaborator

TODO: 引入 paddlespeech_tts_cpp

@yt605155624
Copy link
Collaborator

yt605155624 commented Mar 6, 2023

x86 ubuntu 18.04 上报错如下,应该是符合预期的, 因为 gcc/g++ 环境不对
image

 The prebuilt libraries has been placed to a BCE BOS server.
Demo does not use OpenCV functions. Even if the Paddle-Lite library enables OpenCV, it does not need to be installed when building the demo.
add steps for building paddle-lite library.
In CentOS 7, its aarch64-redhat-linux-g++.

It might be a good idea not to give a compiler name and let cmake find it by itself.
@yt605155624
Copy link
Collaborator

yt605155624 commented Mar 6, 2023

在鲲鹏 (CentOS Linux release 7.9.2009 (AltArch))上按照 README 最下方重新编译 Paddle-Lite 后可以成功运行
image

@yt605155624 yt605155624 changed the title [TTS]add a TTS demo for ARM Linux [TTS][Paddle-Lite]add a TTS demo for ARM Linux Mar 6, 2023
Copy link
Collaborator

@yt605155624 yt605155624 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@yt605155624 yt605155624 merged commit cac96ac into PaddlePaddle:develop Mar 7, 2023
1 check passed
@yt605155624
Copy link
Collaborator

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

None yet

4 participants