OLD | NEW |
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 13 matching lines...) Expand all Loading... |
24 # Default location. | 24 # Default location. |
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, noise sources and scores if needed. | 34 # Customize probing signals, test data generators and scores if needed. |
35 PROBING_SIGNALS=(probing_signals/*.wav) | 35 PROBING_SIGNALS=(probing_signals/*.wav) |
36 NOISE_SOURCES=( \ | 36 TEST_DATA_GENERATORS=( \ |
37 "identity" \ | 37 "identity" \ |
38 "white" \ | 38 "white_noise" \ |
39 "environmental" \ | 39 "environmental_noise" \ |
40 "echo" \ | 40 "reverberation" \ |
41 ) | 41 ) |
42 SCORES=( \ | 42 SCORES=( \ |
43 "polqa" \ | 43 "polqa" \ |
44 "audio_level" \ | 44 "audio_level" \ |
45 ) | 45 ) |
46 OUTPUT_PATH=output | 46 OUTPUT_PATH=output |
47 | 47 |
48 # Generate standard APM config files. | 48 # Generate standard APM config files. |
49 chmod +x apm_quality_assessment_gencfgs.py | 49 chmod +x apm_quality_assessment_gencfgs.py |
50 ./apm_quality_assessment_gencfgs.py | 50 ./apm_quality_assessment_gencfgs.py |
51 | 51 |
52 # Customize APM configurations if needed. | 52 # Customize APM configurations if needed. |
53 APM_CONFIGS=(apm_configs/*.json) | 53 APM_CONFIGS=(apm_configs/*.json) |
54 | 54 |
55 # Add output path if missing. | 55 # Add output path if missing. |
56 if [ ! -d ${OUTPUT_PATH} ]; then | 56 if [ ! -d ${OUTPUT_PATH} ]; then |
57 mkdir ${OUTPUT_PATH} | 57 mkdir ${OUTPUT_PATH} |
58 fi | 58 fi |
59 | 59 |
60 # Start one process for each "probing signal"-"noise source" pair. | 60 # Start one process for each "probing signal"-"test data source" pair. |
61 chmod +x apm_quality_assessment.py | 61 chmod +x apm_quality_assessment.py |
62 for probing_signal_filepath in "${PROBING_SIGNALS[@]}" ; do | 62 for probing_signal_filepath in "${PROBING_SIGNALS[@]}" ; do |
63 probing_signal_name="$(basename $probing_signal_filepath)" | 63 probing_signal_name="$(basename $probing_signal_filepath)" |
64 probing_signal_name="${probing_signal_name%.*}" | 64 probing_signal_name="${probing_signal_name%.*}" |
65 for noise_source_name in "${NOISE_SOURCES[@]}" ; do | 65 for test_data_gen_name in "${TEST_DATA_GENERATORS[@]}" ; do |
66 LOG_FILE="${OUTPUT_PATH}/apm_qa-${probing_signal_name}-"` | 66 LOG_FILE="${OUTPUT_PATH}/apm_qa-${probing_signal_name}-"` |
67 `"${noise_source_name}.log" | 67 `"${test_data_gen_name}.log" |
68 echo "Starting ${probing_signal_name} ${noise_source_name} "` | 68 echo "Starting ${probing_signal_name} ${test_data_gen_name} "` |
69 `"(see ${LOG_FILE})" | 69 `"(see ${LOG_FILE})" |
70 ./apm_quality_assessment.py \ | 70 ./apm_quality_assessment.py \ |
71 --polqa_path ${POLQA_PATH}\ | 71 --polqa_path ${POLQA_PATH}\ |
72 --air_db_path ${AECHEN_IR_DATABASE_PATH}\ | 72 --air_db_path ${AECHEN_IR_DATABASE_PATH}\ |
73 -i ${probing_signal_filepath} \ | 73 -i ${probing_signal_filepath} \ |
74 -o ${OUTPUT_PATH} \ | 74 -o ${OUTPUT_PATH} \ |
75 -n ${noise_source_name} \ | 75 -t ${test_data_gen_name} \ |
76 -c "${APM_CONFIGS[@]}" \ | 76 -c "${APM_CONFIGS[@]}" \ |
77 -e "${SCORES[@]}" > $LOG_FILE 2>&1 & | 77 -e "${SCORES[@]}" > $LOG_FILE 2>&1 & |
78 done | 78 done |
79 done | 79 done |
80 | 80 |
81 # Join. | 81 # Join. |
82 wait | 82 wait |
83 | 83 |
84 # Export results. | 84 # Export results. |
85 chmod +x ./apm_quality_assessment_export.py | 85 chmod +x ./apm_quality_assessment_export.py |
86 ./apm_quality_assessment_export.py -o ${OUTPUT_PATH} | 86 ./apm_quality_assessment_export.py -o ${OUTPUT_PATH} |
87 | 87 |
88 # Show results in the browser. | 88 # Show results in the browser. |
89 RESULTS_FILE="$(realpath ${OUTPUT_PATH}/results.html)" | 89 RESULTS_FILE="$(realpath ${OUTPUT_PATH}/results.html)" |
90 sensible-browser "file://${RESULTS_FILE}" > /dev/null 2>&1 & | 90 sensible-browser "file://${RESULTS_FILE}" > /dev/null 2>&1 & |
OLD | NEW |