@@ -0,0 +1,1470 @@
+package com.tom_e_white.set_game.preprocess;%0A%0Aimport boofcv.io.image.UtilImageIO;%0Aimport com.tom_e_white.set_game.model.Card;%0A%0Aimport java.io.File;%0Aimport java.io.IOException;%0Aimport java.nio.file.Files;%0Aimport java.nio.file.Paths;%0Aimport java.util.List;%0Aimport java.util.stream.Collectors;%0A%0A/**%0A * Takes a test image and a label file (ending in .txt) and creates a directory of test images with the%0A * corresponding labels.%0A */%0Apublic class CreateTestSetV2 %7B%0A    public static void main(String%5B%5D args) throws IOException %7B%0A        File testFile = new File(%22data/20170106_205743.jpg%22);%0A        CardDetector cardDetector = new CardDetector();%0A        List%3CCardImage%3E images = cardDetector.detect(testFile.getAbsolutePath(), false);%0A        List%3CCard%3E cards = Files.lines(Paths.get(testFile.getAbsolutePath().replace(%22.jpg%22, %22.txt%22)))%0A                .map(Card::new)%0A                .collect(Collectors.toList());%0A        File outDir = new File(%22data/test-v2%22);;%0A        outDir.mkdirs();%0A        for (int i = 0; i %3C images.size(); i++) %7B%0A            CardImage image = images.get(i);%0A            Card card = cards.get(i);%0A            File labelledDirectory = new File(outDir, card.getDescription().replace(%22 %22, %22-%22));%0A            labelledDirectory.mkdirs();%0A            File newFile = new File(labelledDirectory, testFile.getName().replace(%22.jpg%22, %22_%22 + (i + 1) + %22.jpg%22));%0A            UtilImageIO.saveImage(image.getImage(), newFile.getAbsolutePath());%0A        %7D%0A%0A    %7D%0A%7D%0A

Add code to generate test data in same directory structure as training data