-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy patharafix.sh
63 lines (52 loc) · 1.14 KB
/
arafix.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
config_name="default.txt"
book_name=$1
start_page="None"
end_page="None"
if [ $# -eq 1 ]; then
first_arg="None"
second_arg="None"
third_arg="None"
fi
if [ $# -eq 2 ]; then
first_arg=$2
second_arg="None"
third_arg="None"
fi
if [ $# -eq 3 ]; then
first_arg=$2
second_arg=$3
third_arg="None"
fi
if [ $# -eq 4 ]; then
first_arg=$2
second_arg=$3
third_arg=$4
fi
cd code
echo ""
echo "~~~RUNNING ARAFIX FOR BOOK: ${book_name}~~~"
if [ $first_arg = "image_to_text" ] || [ $second_arg = "image_to_text" ] || [ $third_arg = "image_to_text" ]
then
python image_to_text.py \
-config "${config_name}" \
-bookname "${book_name}" \
-startpage "${start_page}" \
-endpage "${end_page}"
fi
if [ $first_arg = "predict" ] || [ $second_arg = "predict" ] || [ $third_arg = "predict" ]
then
python predict.py \
-config "${config_name}" \
-bookname "${book_name}" \
-startpage "${start_page}" \
-endpage "${end_page}"
fi
if [ $first_arg = "evaluate" ] || [ $second_arg = "evaluate" ] || [ $third_arg = "evaluate" ]
then
python evaluate.py \
-config "${config_name}" \
-bookname "${book_name}" \
-startpage "${start_page}" \
-endpage "${end_page}"
fi