Arquivos
up_emotions_audio/classifiers/boaw_models/run_val.sh
T
2016-11-30 19:07:19 +01:00

33 linhas
1.5 KiB
Bash
Arquivo Executável
Original Anotar Histórico

Este arquivo contém caracteres Unicode invisíveis
Este arquivo contém caracteres Unicode invisíveis que são indistinguíveis para humanos, mas que podem ser processados de forma diferente por um computador. Se você acha que isso é intencional, pode ignorar esse aviso com segurança. Use o botão Escapar para revelá-los
#!/bin/bash
# Arousal and valence prediction using bag-of-audio-words
wavfile=$1 #'/media/sag/DATA/workPassau/Projects/MixedEmotions/Databases/Youtube_data_package/data/Audio/video1(00h00m27s-00h01m01s).wav'
interval=0.04 # hop size
#./SMILExtract -C "mfcc_energy.conf" -logfile "smile.log" -I $wavfile -instname $wavfile -csvoutput "LLD.csv" -l 1
#./SMILExtract -C "mfcc_energy.conf" -logfile "smile.log" -I $wavfile -instname $wavfile -csvoutput "LLDval.csv" -l 1
#java -jar openWord.jar -i LLDval.csv -o boaw.libsvm -a 20 -size 1000 -t 10.0 $interval -b bookValence &>/dev/null
#./predict boaw.libsvm modelValence.svr valence.txt &>/dev/null
NEW_UUID='LLD'$(date | md5sum | awk '{ print substr( $0, 1, 10 ) }')'a'
./SMILExtract -C "mfcc_energy.conf" -logfile "smile.log" -I $wavfile -instname $wavfile -csvoutput ${NEW_UUID}.csv -l 1
java -jar openXBOW.jar -i ${NEW_UUID}.csv -attributes nt1111111111111 -o boaw.libsvm -a 10 -norm 1 -b book &>/dev/null
./predict boaw.libsvm modelValence.svr ${NEW_UUID}valence.txt &>/dev/null
#cat valence.txt | awk '{ sum += $1; sum2+=$1*$1; n++ } END { if (n > 0) print sum/n , 1-((sum2/n)-(sum/n*sum/n))^.5; }' > Vres.txt
input=${NEW_UUID}valence.txt
i=1
while read mean
do
# if [[ $std == *"nan"* ]]
# then
# std=1;
# fi
a=`awk "BEGIN{printf \"%.3f\",$mean}"`
printf '{ "PROCESSOR":"OpenSMILE","ORIGIN":"boaw","TYPE":"regression","COMPONENT":"maxboaw2","VIDX":'$i',"VALUE":'$a',"PROB":[{"CONFIDENCE":1}]}\n'
done < "$input"
rm ${NEW_UUID}valence.txt ${NEW_UUID}.csv