-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdetect_coral.sh
executable file
·44 lines (35 loc) · 1.84 KB
/
detect_coral.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
#!/bin/bash
# To be able to call .sh from any directory
file_path=$( cd "$(dirname "${BASH_SOURCE[0]}")" ; pwd -P )
cd "$file_path"
# Flags to select type of weights and parameters
REAL_TEST=1
SYNTHETIC_TEST=0
SYNTHETIC_AND_REAL_TEST=0
FIELD_TEST=2
CONF_THRESHOLD=0.75
./generate_data.sh
# We select the field test we want to test
if [ $FIELD_TEST -eq 1 ];
then
valid_file=./datasets/field_tests_images/darknet_labels/field_test1_valid.txt
elif [ $FIELD_TEST -eq 2 ];
then
valid_file=./datasets/field_tests_images/darknet_labels/field_test2_valid.txt
fi
# Logs files will be saved in the output_files/log folder
# Test with pre-trained weights
if [ $SYNTHETIC_AND_REAL_TEST -eq 1 ];
then
python3 ./src/main_coraldetect.py --detect_mode true -t ${CONF_THRESHOLD} --detect_save ./output_files/coral_detection/ --valid_file $valid_file --classes ./datasets/field_tests_images/darknet_labels/sample.names --anchors training_files/cfg/tiny_yolo_anchors.txt --model ./output_files/compiled_coral/yolov3_tiny_BOTH_best_edgetpu.tflite
fi
# Test with real image weights
if [ $REAL_TEST -eq 1 ];
then
python3 ./src/main_coraldetect.py --detect_mode true -t ${CONF_THRESHOLD} --detect_save ./output_files/coral_detection/ --valid_file $valid_file --classes ./datasets/field_tests_images/darknet_labels/sample.names --anchors training_files/cfg/tiny_yolo_anchors.txt --model ./output_files/compiled_coral/yolov3_tiny_REAL_best_edgetpu.tflite
fi
# Test with synthetic image weights
if [ $SYNTHETIC_TEST -eq 1 ];
then
python3 ./src/main_coraldetect.py --detect_mode true -t ${CONF_THRESHOLD} --detect_save ./output_files/coral_detection/ --valid_file $valid_file --classes ./datasets/field_tests_images/darknet_labels/sample.names --anchors training_files/cfg/tiny_yolo_anchors.txt --model ./output_files/compiled_coral/yolov3_tiny_SYNTHETIC_best_edgetpu.tflite
fi