-
Notifications
You must be signed in to change notification settings - Fork 8
/
evaluate_run.sh
executable file
·63 lines (53 loc) · 2.36 KB
/
evaluate_run.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
#!/bin/bash
METHOD=$(echo $1 | awk '{print tolower($0)}')
FEATURES=$(echo $2 | awk '{print tolower($0)}')
if [[ $METHOD != "custom" ]]; then
echo "Note: the available methods are GV, BOW, LBOW, DML, HC"
if [[ $METHOD == "gv" || $METHOD == "bow" || $METHOD == "dml" ]]; then
echo "Selected method: $1"
echo "Available features: VGG, RESNET, INCEPTION, C3D_FC, C3D_INT, I3D_FC, I3D_INT"
elif [[ $METHOD == "hc" ]]; then
echo "Selected method: $1"
echo "Available features: CNN, 3DCNN"
elif [[ $METHOD == "lbow" ]]; then
echo "Selected method: $1"
echo "Available features: VGG, RESNET, INCEPTION, C3D_INT, I3D_INT"
else
echo "Error: method does not exists. Please, select one of the available methods"
exit
fi
mkdir -p ./runs/$METHOD
if [[ $METHOD == *"bow"* ]]; then
EXT="mtx"
else
EXT="npy"
fi
if [[ $METHOD == *"hc"* ]]; then
SIMILARITY="hamming"
else
SIMILARITY="cosine"
fi
URL=http://ndd.iti.gr/features/$METHOD/$FEATURES.$EXT
FEATURE_FILE=./runs/$METHOD/$FEATURES.$EXT
RESULT_FILE=./results/${METHOD}_${FEATURES}.json
wget -c -N $URL -O $FEATURE_FILE
else
FEATURE_FILE=$2
RESULT_FILE=./results/custom_run.json
if [[ ${FEATURE_FILE: -4} != ".npy" && ${FEATURE_FILE: -4} != ".mtx" ]]; then
echo "Error: format of the provided file is not supported. Please, provide an .npy or .mtx file"
exit
fi
SIMILARITY="cosine"
fi
mkdir -p ./results
python calculate_similarities.py --feature_file $FEATURE_FILE --result_file $RESULT_FILE --similarity_metric $SIMILARITY
printf "\n\nEvaluation on DSVR task\n-----------------------\n"
EXPORT_FILE=./results/dsvr_${METHOD}_${FEATURES}.csv
python evaluation.py --result_file $RESULT_FILE --relevant_labels ND,DS --export_file $EXPORT_FILE --save_results --quiet
printf "\n\nEvaluation on CSVR task\n-----------------------\n"
EXPORT_FILE=./results/csvr_${METHOD}_${FEATURES}.csv
python evaluation.py --result_file $RESULT_FILE --relevant_labels ND,DS,CS --export_file $EXPORT_FILE --save_results --quiet
printf "\n\nEvaluation on ISVR task\n-----------------------\n"
EXPORT_FILE=./results/isvr_${METHOD}_${FEATURES}.csv
python evaluation.py --result_file $RESULT_FILE --relevant_labels ND,DS,CS,IS --export_file $EXPORT_FILE --save_results --quiet