xref: /aosp_15_r20/external/libopus/dnn/torch/testsuite/README.md (revision a58d3d2adb790c104798cd88c8a3aff4fa8b82cc)
1*a58d3d2aSXin Li# lpcnet-testsuite
2*a58d3d2aSXin Li
3*a58d3d2aSXin Li## setup
4*a58d3d2aSXin LiThe test script is written for Linux only. It requires sox to be installed and available.
5*a58d3d2aSXin Li
6*a58d3d2aSXin LiSetup is done as usual via
7*a58d3d2aSXin Li
8*a58d3d2aSXin Li```
9*a58d3d2aSXin Lipip install -r requirements.txt
10*a58d3d2aSXin Li```
11*a58d3d2aSXin Li
12*a58d3d2aSXin LiThe test scrip run_warpq_test.py requires a setup file in yaml format, which specifies how
13*a58d3d2aSXin Lito generate a wave file OUTPUT from a wave file INPUT sampled resampled to the specified
14*a58d3d2aSXin Lisampling rate as a list of shell commands. This makes it easy to test other neural vocoders
15*a58d3d2aSXin Liwith it as well. Two examples are given in examples. INPUT and OUTPUT will be replaced by using
16*a58d3d2aSXin Lithe string.format(INPUT=input,OUTPUT=output) method.
17*a58d3d2aSXin Li
18*a58d3d2aSXin LiHere is one example:
19*a58d3d2aSXin Li
20*a58d3d2aSXin Li```
21*a58d3d2aSXin Litest: "LPCNet reference test"
22*a58d3d2aSXin Liprocessing:
23*a58d3d2aSXin Li  - "sox {INPUT} {INPUT}.raw"
24*a58d3d2aSXin Li  - "/local/code/LPCNet/lpcnet_demo -features {INPUT}.raw {INPUT}.features.f32"
25*a58d3d2aSXin Li  - "/local/code/LPCNet/lpcnet_demo -synthesis {INPUT}.features.f32 {INPUT}.decoded.raw"
26*a58d3d2aSXin Li  - "sox -r 16000 -L -e signed-integer -b 16 -c 1 {INPUT}.decoded.raw {OUTPUT}"
27*a58d3d2aSXin Li```
28*a58d3d2aSXin Li
29*a58d3d2aSXin LiThe structure of the output folder is as follows:
30*a58d3d2aSXin Li
31*a58d3d2aSXin Li```
32*a58d3d2aSXin Lioutput_folder
33*a58d3d2aSXin Li+-- html
34*a58d3d2aSXin Li    +-- index.html
35*a58d3d2aSXin Li    +-- items
36*a58d3d2aSXin Li+-- processing
37*a58d3d2aSXin Li+-- setup.yml
38*a58d3d2aSXin Li+-- stats.txt
39*a58d3d2aSXin Li+-- scores.txt
40*a58d3d2aSXin Li```
41*a58d3d2aSXin Li
42*a58d3d2aSXin Liscores.txt contains the WARP-Q scores in descending order (best to worse)
43*a58d3d2aSXin Listats.txt contains mean values over all, the 10 best and the 10 worst items
44*a58d3d2aSXin Lisetup.yml contains all information to repeat the run
45*a58d3d2aSXin Lihtms contains a self-contained website displaying the 10 best and 10 worst items
46*a58d3d2aSXin Liprocessing contains processing output