1 | #!/bin/bash
|
---|
2 | #****************************************************************************************************
|
---|
3 | #Type --help for detail on shortcuts
|
---|
4 | #Have Makefile have some useful 'quick commands'
|
---|
5 |
|
---|
6 | #if [ $# != 1 ] ; then
|
---|
7 | # echo "Usage: ./EndToEndSystem task" 1>&2
|
---|
8 | # exit 1
|
---|
9 | #fi
|
---|
10 | #Using scripts that have different amount of arguments
|
---|
11 | type=$1
|
---|
12 |
|
---|
13 | #****************************************************************************************************
|
---|
14 | #Test/Dev Scripts
|
---|
15 | #****************************************************************************************************
|
---|
16 |
|
---|
17 |
|
---|
18 |
|
---|
19 |
|
---|
20 | #****************************************************************************************************
|
---|
21 | #Utility Scripts
|
---|
22 | #****************************************************************************************************
|
---|
23 | if [ $type == "page_num_test" ] ; then
|
---|
24 | page_num=5
|
---|
25 | if [ $page_num != 1 ] ; then
|
---|
26 | let a=$page_num/2
|
---|
27 | new_page_num=$a
|
---|
28 | else
|
---|
29 | new_page_num=$page_num
|
---|
30 | fi
|
---|
31 | echo $new_page_num
|
---|
32 | exit 1
|
---|
33 | fi
|
---|
34 | #****************************************************************************************************
|
---|
35 | #Classifier Scripts [HIGHRES BY DEFUALT]
|
---|
36 | #****************************************************************************************************
|
---|
37 | if [ $type == "morph" ] ; then
|
---|
38 | if [ $# != 2 ] ; then
|
---|
39 | echo "Usage:./EndToEndSystem cluster <ResultSubDirectory> "
|
---|
40 | exit 1
|
---|
41 | fi
|
---|
42 | location=$2
|
---|
43 |
|
---|
44 | #Compile
|
---|
45 | echo "Compiling java programs..."
|
---|
46 | cd image-identification-terminal
|
---|
47 | javac javaAccuracyCalculator.java
|
---|
48 | javac -cp /Scratch/cpb16/opencv-3.4.2/build/bin/opencv-342.jar javaClassifierComparison.java;
|
---|
49 | #Classifiers
|
---|
50 | echo "Successfuly Compiled, running classifer now..."
|
---|
51 | ./runClassifer.sh /Scratch/cpb16/is-sheet-music-encore/hires-download-images/MU morphology log-EndToEnd/$location/log-morph-MU.txt -allNew
|
---|
52 | ./runClassifer.sh /Scratch/cpb16/is-sheet-music-encore/hires-download-images/BK morphology log-EndToEnd/$location/log-morph-BK.txt -allNew
|
---|
53 | ./runClassifer.sh /Scratch/cpb16/is-sheet-music-encore/hires-download-images/MP morphology log-EndToEnd/$location/log-morph-MP.txt -allNew
|
---|
54 | ./runClassifer.sh /Scratch/cpb16/is-sheet-music-encore/hires-download-images/SE morphology log-EndToEnd/$location/log-morph-SE.txt -allNew
|
---|
55 | #Results
|
---|
56 | echo "Successfuly Classified, writing results now..."
|
---|
57 | mkdir log-EndToEnd/$location/
|
---|
58 | echo $'\n***********************************************\n' >> log-EndToEnd/$location/results.txt
|
---|
59 | date >> log-EndToEnd/$location/results.txt
|
---|
60 | echo >> log-EndToEnd/$location/results.txt
|
---|
61 | #echo "" >> log-EndToEnd/$location/results.txt
|
---|
62 | cat configClassifierComparison.properties >> log-EndToEnd/$location/results.txt
|
---|
63 | java javaAccuracyCalculator log-EndToEnd/$location/log-morph-MU.txt morph-MU log-EndToEnd/$location/results.txt
|
---|
64 | java javaAccuracyCalculator log-EndToEnd/$location/log-morph-BK.txt morph-BK log-EndToEnd/$location/results.txt
|
---|
65 | java javaAccuracyCalculator log-EndToEnd/$location/log-morph-MP.txt morph-MP log-EndToEnd/$location/results.txt
|
---|
66 | java javaAccuracyCalculator log-EndToEnd/$location/log-morph-SE.txt morph-SE log-EndToEnd/$location/results.txt
|
---|
67 | .././calculateCorpusAccuracy.sh
|
---|
68 | less log-EndToEnd/$location/results.txt
|
---|
69 | exit 1
|
---|
70 | fi
|
---|
71 |
|
---|
72 | if [ $type == "cluster" ] ; then
|
---|
73 |
|
---|
74 | if [ $# != 2 ] ; then
|
---|
75 | echo "Usage:./EndToEndSystem cluster <ResultSubDirectory>"
|
---|
76 | exit 1
|
---|
77 | fi
|
---|
78 | location=$2
|
---|
79 | #Compile
|
---|
80 | echo "Compiling java programs..."
|
---|
81 | cd image-identification-terminal
|
---|
82 | javac javaAccuracyCalculator.java
|
---|
83 | javac -cp /Scratch/cpb16/opencv-3.4.2/build/bin/opencv-342.jar javaClassifierComparison.java;
|
---|
84 | #Classifiers
|
---|
85 | echo "Successfuly Compiled, running classifer now..."
|
---|
86 | #./runClassifer.sh /Scratch/cpb16/is-sheet-music-encore/hires-download-images/MU cluster log-EndToEnd/$location/log-cluster-MU.txt -allNew
|
---|
87 | #./runClassifer.sh /Scratch/cpb16/is-sheet-music-encore/hires-download-images/BK cluster log-EndToEnd/$location/log-cluster-BK.txt -allNew
|
---|
88 | #./runClassifer.sh /Scratch/cpb16/is-sheet-music-encore/hires-download-images/MP cluster log-EndToEnd/$location/log-cluster-MP.txt -allNew
|
---|
89 | #./runClassifer.sh /Scratch/cpb16/is-sheet-music-encore/hires-download-images/SE cluster log-EndToEnd/$location/log-cluster-SE.txt -allNew
|
---|
90 | #Results
|
---|
91 | echo "Successfuly Classified, writing results now..."
|
---|
92 | mkdir log-EndToEnd/$location/
|
---|
93 | echo $'\n***********************************************\n' >> log-EndToEnd/$location/results.txt
|
---|
94 | date >> log-EndToEnd/$location/results.txt
|
---|
95 | echo >> log-EndToEnd/$location/results.txt
|
---|
96 | #echo "" >> log-EndToEnd/$location/results.txt
|
---|
97 | cat configClassifierComparison.properties >> log-EndToEnd/$location/results.txt
|
---|
98 | #java javaAccuracyCalculator log-EndToEnd/$location/log-cluster-MU.txt cluster-MU log-EndToEnd/$location/results.txt
|
---|
99 | #java javaAccuracyCalculator log-EndToEnd/$location/log-cluster-BK.txt cluster-BK log-EndToEnd/$location/results.txt
|
---|
100 | #java javaAccuracyCalculator log-EndToEnd/$location/log-cluster-MP.txt cluster-MP log-EndToEnd/$location/results.txt
|
---|
101 | #java javaAccuracyCalculator log-EndToEnd/$location/log-cluster-SE.txt cluster-SE log-EndToEnd/$location/results.txt
|
---|
102 | .././calculateCorpusAccuracy.sh
|
---|
103 | less log-EndToEnd/$location/results.txt
|
---|
104 | exit 1
|
---|
105 | fi
|
---|
106 |
|
---|
107 |
|
---|
108 | #****************************************************************************************************
|
---|
109 | #Downloader Scripts
|
---|
110 | #****************************************************************************************************
|
---|
111 |
|
---|
112 | #****************************************************************************************************
|
---|
113 | #End of the line
|
---|
114 | echo "unknown command, please try again, or type './EndToEndSystem --help'"
|
---|
115 | exit 1
|
---|