Last change
on this file since 33340 was 33340, checked in by cpb16, 5 years ago |
transferred backup of low res images. Classifiers work as expected. Updated javaAccuracyCalculator, now calculates overall rating correctly. Created gen-50-XX-ValidIDList.txt for the 10% high-res downloads. Done by selecting first 50 of each gen-500-XX-Valid.... .txt. Downloading high-res images after this backup
|
-
Property svn:executable
set to
*
|
File size:
1.7 KB
|
Line | |
---|
1 | #!/bin/bash
|
---|
2 |
|
---|
3 | if [ $# != 4 ] ; then
|
---|
4 | echo "Usage: ./testClassifier.sh folder/file_name classifier_type output_filename type(-a:all -test:100 -single:1)" 1>&2
|
---|
5 | exit 1
|
---|
6 | fi
|
---|
7 |
|
---|
8 | folder_name=$1
|
---|
9 | classifier_type=$2
|
---|
10 | output=$3
|
---|
11 | i=0
|
---|
12 | j=0
|
---|
13 | case "$4" in
|
---|
14 | -all)
|
---|
15 | #Runs javaImageClassifier on ALL images
|
---|
16 | for file_name in $folder_name/*/*.png; do
|
---|
17 | echo $file_name
|
---|
18 | echo $output
|
---|
19 | echo $i
|
---|
20 | echo ""
|
---|
21 | java -cp /Scratch/cpb16/opencv-3.4.2/build/bin/opencv-342.jar:. -Djava.library.path=/Scratch/cpb16/opencv-3.4.2/build/lib/ javaImageClassifier $file_name $classifier_type $output
|
---|
22 | i=$[$i+1]
|
---|
23 | done
|
---|
24 | ;;
|
---|
25 |
|
---|
26 | -test)
|
---|
27 | #Runs javaImageClassifier on 100 images of each
|
---|
28 | for file_name in $folder_name/SheetMusic/*.png; do
|
---|
29 | if [ $i -lt 10 ] ; then
|
---|
30 | echo $file_name
|
---|
31 | echo $output
|
---|
32 | echo $i
|
---|
33 | echo ""
|
---|
34 | java -cp /Scratch/cpb16/opencv-3.4.2/build/bin/opencv-342.jar:. -Djava.library.path=/Scratch/cpb16/opencv-3.4.2/build/lib/ javaImageClassifier $file_name $classifier_type $output
|
---|
35 | i=$[$i+1]
|
---|
36 | fi
|
---|
37 | done
|
---|
38 | for file_name in $folder_name/NotSheetMusic/*.png; do
|
---|
39 | if [ $j -lt 10 ] ; then
|
---|
40 | echo $file_name
|
---|
41 | echo $output
|
---|
42 | echo $j
|
---|
43 | echo ""
|
---|
44 | java -cp /Scratch/cpb16/opencv-3.4.2/build/bin/opencv-342.jar:. -Djava.library.path=/Scratch/cpb16/opencv-3.4.2/build/lib/ javaImageClassifier $file_name $classifier_type $output
|
---|
45 | j=$[$j+1]
|
---|
46 | fi
|
---|
47 | done
|
---|
48 | ;;
|
---|
49 | -single)
|
---|
50 | #Runs javaImagesClassifier on ONE image
|
---|
51 | javac -cp /Scratch/cpb16/opencv-3.4.2/build/bin/opencv-342.jar javaImageClassifier.java;
|
---|
52 | echo $file_name
|
---|
53 | echo $output
|
---|
54 | echo $classifier_type
|
---|
55 | java -cp /Scratch/cpb16/opencv-3.4.2/build/bin/opencv-342.jar:. -Djava.library.path=/Scratch/cpb16/opencv-3.4.2/build/lib/ javaImageClassifier $file_name $classifier_type $output
|
---|
56 |
|
---|
57 |
|
---|
58 | esac
|
---|
Note:
See
TracBrowser
for help on using the repository browser.