package main; import java.io.IOException; import java.io.LineNumberReader; import java.io.PrintStream; import java.util.ArrayList; import preprocessing.Parser; public class Debug { public static void main(String[] args) { String path = args[0]; String file = args[1]; double threshold = Double.parseDouble(args[2]); ArrayList class_list = new ArrayList (); ArrayList score_list = new ArrayList (); ArrayList image_list = new ArrayList (); Get_Curve (path, file, class_list, score_list, image_list); Get_Performance (threshold, class_list, score_list, image_list); } public static void Get_Curve ( String path, String file, ArrayList class_list, ArrayList score_list, ArrayList image_list ) { Parser parser = new Parser(); LineNumberReader scores = parser.Open_File (path + file); String[] s = null; do { s = parser.getTokens (scores, "\n"); if (s == null) { break; } String[] S = s[0].split(" "); score_list.add(Double.parseDouble(S[0])); class_list.add(Integer.parseInt(S[2])); image_list.add(S[3]); } while (s != null); try { scores.close(); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } } public static void Get_Performance ( double threshold, ArrayList class_list, ArrayList score_list, ArrayList image_list) { /*Evaluating the object training over the train list*/ int size = score_list.size(); for (int index = 0 ; index < size; index++) { double v = score_list.get(index); int sclass = class_list.get(index); if ( (sclass == 1) && (v < threshold) ) { //System.out.printf("%d %f %s\n", sclass, v, image_list.get(index)); System.out.printf("cp %s ./errors/\n", image_list.get(index)); } else if ( (sclass == -1) && (v >= threshold) ) { //System.out.printf("%d %f %s\n", sclass, v, image_list.get(index)); System.out.printf("cp %s ./errors/\n", image_list.get(index)); } } } }