-
Notifications
You must be signed in to change notification settings - Fork 0
/
runEval.sh
executable file
·54 lines (40 loc) · 1.42 KB
/
runEval.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
#!/bin/bash
# Run FDDB evaluation of the cascade face detector.
# Directories
# Note: Don't add trailing '/'
list_directory="fddb_evaluation_docker/FDDB-folds"
image_directory="fddb_evaluation_docker/originalPics"
results_directory="fddb_evaluation_docker/detections"
# Detector parameters
cascade="cascades/haarcascade_frontalface_default.xml"
nNeighbors="3"
scale="1.1"
# Loop through the matching files and process them
for list_file in $list_directory/FDDB-fold-??.txt; do
echo "Processing $list_file"
# Generate results filename from the list filename
results_file="${list_file#fddb_evaluation_docker/FDDB-folds/FDDB-}"
results_file="${results_file%.txt}-out.txt"
# Clear the results file if it already exists
> "$results_directory/$results_file"
if [ $? -ne 0 ]; then
echo "Error: failed to create/clear the results file: "$results_directory/$results_file
exit 1
fi
# Process the list file
./detectFaces -i=$image_directory -n=$nNeighbors -s=$scale $list_file $cascade >> "$results_directory/$results_file"
if [ $? -ne 0 ]; then
echo "Error: failed to process file: "$list_file
exit 1
fi
done
# Run the container for performance evaluation
cd fddb_evaluation_docker
export FDDB_HOME=`pwd`
docker run --rm -it -v ${FDDB_HOME}:/FDDB housebw/fddb-evaluator
if [ $? -ne 0 ]; then
echo "Error: failed to run the container"
exit 1
fi
cd ..
exit 0