Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(284)

Side by Side Diff: webrtc/modules/audio_processing/test/py_quality_assessment/apm_quality_assessment.sh

Issue 2715943002: APM Quality Assessment, simulation controller and libraries (Closed)
Patch Set: revert to Python 2 Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 #!/bin/bash 1 #!/bin/bash
2 # Copyright (c) 2017 The WebRTC project authors. All Rights Reserved. 2 # Copyright (c) 2017 The WebRTC project authors. All Rights Reserved.
3 # 3 #
4 # Use of this source code is governed by a BSD-style license 4 # Use of this source code is governed by a BSD-style license
5 # that can be found in the LICENSE file in the root of the source 5 # that can be found in the LICENSE file in the root of the source
6 # tree. An additional intellectual property rights grant can be found 6 # tree. An additional intellectual property rights grant can be found
7 # in the file PATENTS. All contributing project authors may 7 # in the file PATENTS. All contributing project authors may
8 # be found in the AUTHORS file in the root of the source tree. 8 # be found in the AUTHORS file in the root of the source tree.
9 9
10 # Customize probing signals, noise sources and scores if needed. 10 # Customize probing signals, noise sources and scores if needed.
11 PROBING_SIGNALS=(py_quality_assessment/probing_signals/*.wav) 11 PROBING_SIGNALS=(probing_signals/*.wav)
12 NOISE_SOURCES=( \ 12 NOISE_SOURCES=( \
13 "identity" \ 13 "identity" \
14 "white" \ 14 "white" \
15 "environmental" \ 15 "environmental" \
16 "echo" \ 16 "echo" \
17 ) 17 )
18 SCORES=( \ 18 SCORES=( \
19 "polqa" \ 19 "polqa" \
20 "audio_level" \ 20 "audio_level" \
21 ) 21 )
22 OUTPUT_PATH=output 22 OUTPUT_PATH=output
23 23
24 # Generate standard APM config files. 24 # Generate standard APM config files.
25 chmod +x apm_quality_assessment-gencfgs.py 25 chmod +x apm_quality_assessment-gencfgs.py
26 ./apm_quality_assessment-gencfgs.py 26 ./apm_quality_assessment-gencfgs.py
27 27
28 # Customize APM configurations if needed. 28 # Customize APM configurations if needed.
29 APM_CONFIGS=(py_quality_assessment/apm_configs/*.json) 29 APM_CONFIGS=(apm_configs/*.json)
30 30
31 # Add output path if missing. 31 # Add output path if missing.
32 if [ ! -d ${OUTPUT_PATH} ]; then 32 if [ ! -d ${OUTPUT_PATH} ]; then
33 mkdir ${OUTPUT_PATH} 33 mkdir ${OUTPUT_PATH}
34 fi 34 fi
35 35
36 # Start one process for each "probing signal"-"noise source" pair. 36 # Start one process for each "probing signal"-"noise source" pair.
37 chmod +x apm_quality_assessment.py 37 chmod +x apm_quality_assessment.py
38 for probing_signal_filepath in "${PROBING_SIGNALS[@]}" ; do 38 for probing_signal_filepath in "${PROBING_SIGNALS[@]}" ; do
39 probing_signal_name="$(basename $probing_signal_filepath)" 39 probing_signal_name="$(basename $probing_signal_filepath)"
40 probing_signal_name="${probing_signal_name%.*}" 40 probing_signal_name="${probing_signal_name%.*}"
41 for noise_source_name in "${NOISE_SOURCES[@]}" ; do 41 for noise_source_name in "${NOISE_SOURCES[@]}" ; do
42 LOG_FILE="${OUTPUT_PATH}/apm_qa-${probing_signal_name}-"` 42 LOG_FILE="${OUTPUT_PATH}/apm_qa-${probing_signal_name}-"`
43 `"${noise_source_name}.log" 43 `"${noise_source_name}.log"
44 echo "Starting ${probing_signal_name} ${noise_source_name} "` 44 echo "Starting ${probing_signal_name} ${noise_source_name} "`
45 `"(see ${LOG_FILE})" 45 `"(see ${LOG_FILE})"
46 ./apm_quality_assessment.py \ 46 ./apm_quality_assessment.py \
47 -i ${probing_signal_filepath}\ 47 -i ${probing_signal_filepath}\
48 -o ${OUTPUT_PATH} \ 48 -o ${OUTPUT_PATH} \
49 -n ${noise_source_name} \ 49 -n ${noise_source_name} \
50 -c "${APM_CONFIGS[@]}" \ 50 -c "${APM_CONFIGS[@]}" \
51 -e "${SCORES[@]}" > $LOG_FILE 2>&1 & 51 -e "${SCORES[@]}" > $LOG_FILE 2>&1 &
52 done 52 done
53 done 53 done
54 54
55 # Join. 55 # Join.
56 wait 56 wait
57 57
58 # Export results. 58 # Export results.
59 chmod +x ./apm_quality_assessment-export.py
59 ./apm_quality_assessment-export.py -o ${OUTPUT_PATH} 60 ./apm_quality_assessment-export.py -o ${OUTPUT_PATH}
60 61
61 # Show results in the browser. 62 # Show results in the browser.
62 RESULTS_FILE="$(realpath ${OUTPUT_PATH}/results.html)" 63 RESULTS_FILE="$(realpath ${OUTPUT_PATH}/results.html)"
63 sensible-browser "file://${RESULTS_FILE}" > /dev/null 2>&1 & 64 sensible-browser "file://${RESULTS_FILE}" > /dev/null 2>&1 &
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698