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

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

Issue 2813883002: APM QA refactoring: render stream support, echo path simulation, new export engine (Closed)
Patch Set: merge Created 3 years, 4 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 # Path to the POLQA tool. 10 # Path to the POLQA tool.
(...skipping 14 matching lines...) Expand all
25 export AECHEN_IR_DATABASE_PATH='/var/opt/AIR_1_4' 25 export AECHEN_IR_DATABASE_PATH='/var/opt/AIR_1_4'
26 fi 26 fi
27 if [ -d "${AECHEN_IR_DATABASE_PATH}" ]; then 27 if [ -d "${AECHEN_IR_DATABASE_PATH}" ]; then
28 echo "AIR database found in ${AECHEN_IR_DATABASE_PATH}" 28 echo "AIR database found in ${AECHEN_IR_DATABASE_PATH}"
29 else 29 else
30 echo "AIR database not found in ${AECHEN_IR_DATABASE_PATH}" 30 echo "AIR database not found in ${AECHEN_IR_DATABASE_PATH}"
31 exit 1 31 exit 1
32 fi 32 fi
33 33
34 # Customize probing signals, test data generators and scores if needed. 34 # Customize probing signals, test data generators and scores if needed.
35 PROBING_SIGNALS=(probing_signals/*.wav) 35 CAPTURE_SIGNALS=(probing_signals/*.wav)
36 TEST_DATA_GENERATORS=( \ 36 TEST_DATA_GENERATORS=( \
37 "identity" \ 37 "identity" \
38 "white_noise" \ 38 "white_noise" \
39 "environmental_noise" \ 39 # "environmental_noise" \
40 "reverberation" \ 40 # "reverberation" \
41 ) 41 )
42 SCORES=( \ 42 SCORES=( \
43 "polqa" \ 43 # "polqa" \
44 "audio_level" \ 44 "audio_level_peak" \
45 "audio_level_mean" \
45 ) 46 )
46 OUTPUT_PATH=output 47 OUTPUT_PATH=output
47 48
48 # Generate standard APM config files. 49 # Generate standard APM config files.
49 chmod +x apm_quality_assessment_gencfgs.py 50 chmod +x apm_quality_assessment_gencfgs.py
50 ./apm_quality_assessment_gencfgs.py 51 ./apm_quality_assessment_gencfgs.py
51 52
52 # Customize APM configurations if needed. 53 # Customize APM configurations if needed.
53 APM_CONFIGS=(apm_configs/*.json) 54 APM_CONFIGS=(apm_configs/*.json)
54 55
55 # Add output path if missing. 56 # Add output path if missing.
56 if [ ! -d ${OUTPUT_PATH} ]; then 57 if [ ! -d ${OUTPUT_PATH} ]; then
57 mkdir ${OUTPUT_PATH} 58 mkdir ${OUTPUT_PATH}
58 fi 59 fi
59 60
60 # Start one process for each "probing signal"-"test data source" pair. 61 # Start one process for each "probing signal"-"test data source" pair.
61 chmod +x apm_quality_assessment.py 62 chmod +x apm_quality_assessment.py
62 for probing_signal_filepath in "${PROBING_SIGNALS[@]}" ; do 63 for capture_signal_filepath in "${CAPTURE_SIGNALS[@]}" ; do
63 probing_signal_name="$(basename $probing_signal_filepath)" 64 probing_signal_name="$(basename $capture_signal_filepath)"
64 probing_signal_name="${probing_signal_name%.*}" 65 probing_signal_name="${probing_signal_name%.*}"
65 for test_data_gen_name in "${TEST_DATA_GENERATORS[@]}" ; do 66 for test_data_gen_name in "${TEST_DATA_GENERATORS[@]}" ; do
66 LOG_FILE="${OUTPUT_PATH}/apm_qa-${probing_signal_name}-"` 67 LOG_FILE="${OUTPUT_PATH}/apm_qa-${probing_signal_name}-"`
67 `"${test_data_gen_name}.log" 68 `"${test_data_gen_name}.log"
68 echo "Starting ${probing_signal_name} ${test_data_gen_name} "` 69 echo "Starting ${probing_signal_name} ${test_data_gen_name} "`
69 `"(see ${LOG_FILE})" 70 `"(see ${LOG_FILE})"
70 ./apm_quality_assessment.py \ 71 ./apm_quality_assessment.py \
71 --polqa_path ${POLQA_PATH}\ 72 --polqa_path ${POLQA_PATH}\
72 --air_db_path ${AECHEN_IR_DATABASE_PATH}\ 73 --air_db_path ${AECHEN_IR_DATABASE_PATH}\
73 -i ${probing_signal_filepath} \ 74 -i ${capture_signal_filepath} \
74 -o ${OUTPUT_PATH} \ 75 -o ${OUTPUT_PATH} \
75 -t ${test_data_gen_name} \ 76 -t ${test_data_gen_name} \
76 -c "${APM_CONFIGS[@]}" \ 77 -c "${APM_CONFIGS[@]}" \
77 -e "${SCORES[@]}" > $LOG_FILE 2>&1 & 78 -e "${SCORES[@]}" > $LOG_FILE 2>&1 &
78 done 79 done
79 done 80 done
80 81
81 # Join. 82 # Join Python processes running apm_quality_assessment.py.
82 wait 83 wait
83 84
84 # Export results. 85 # Export results.
85 chmod +x ./apm_quality_assessment_export.py 86 chmod +x ./apm_quality_assessment_export.py
86 ./apm_quality_assessment_export.py -o ${OUTPUT_PATH} 87 ./apm_quality_assessment_export.py -o ${OUTPUT_PATH}
87 88
88 # Show results in the browser. 89 # Show results in the browser.
89 RESULTS_FILE="$(realpath ${OUTPUT_PATH}/results.html)" 90 RESULTS_FILE="$(realpath ${OUTPUT_PATH}/results.html)"
90 sensible-browser "file://${RESULTS_FILE}" > /dev/null 2>&1 & 91 sensible-browser "file://${RESULTS_FILE}" > /dev/null 2>&1 &
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698