Commit 940a1474 authored by Nafis A Abeer's avatar Nafis A Abeer
Browse files

potentially working with multiple datasets

parent cb0fbf3f
Loading
Loading
Loading
Loading
+9 −3
Original line number Diff line number Diff line
@@ -18,11 +18,17 @@ public class ObjectDetector {
     * The starting function that creates an object set, compiles informatino, and returns it
     * @throws FileNotFoundException
     */
    public static void startProcess() throws IOException, CsvValidationException {
    public static void startProcess(String dataset) throws IOException, CsvValidationException {

        // for now, we can just set paths to the directories that hold keyframes and featurepoint CSVs
        String bbox_dir_pth = "src/main/java/vslam/BoundedInfo";
        String pose_dir_path = "src/main/java/vslam/CameraPoses";

        String bbox_dir_pth = "src/main/java/vslam/tum_rgbd/BoundedInfo";
        String pose_dir_path = "src/main/java/vslam/rumrgbd/CameraPoses";

        if(dataset.equals("1")){
            bbox_dir_pth = "src/main/java/vslam/imperial_london/BoundedInfo";
            pose_dir_path = "src/main/java/vslam/imperial_london/CameraPoses";
        } 

        // get files
        File[] bbox_CSVs = getDirFiles(bbox_dir_pth);
+9 −9
Original line number Diff line number Diff line
@@ -119,18 +119,18 @@ public class BackendJava {
            return "html/index";
        }

        @RequestMapping("/runProcess")
        @ResponseBody
        public boolean runProcess() throws IOException, CsvValidationException {
            System.out.println(" ============> Starting process");
            ObjectDetector.startProcess();
            return true;
        }
        // @RequestMapping("/runProcess")
        // @ResponseBody
        // public boolean runProcess() throws IOException, CsvValidationException {
        //     System.out.println(" ============> Starting process");
        //     ObjectDetector.startProcess();
        //     return true;
        // }

        @RequestMapping("/getJSON")
        @ResponseBody
        public ResponseEntity<String> tempJson() throws CsvValidationException, IOException {
            ObjectDetector.startProcess();
        public ResponseEntity<String> tempJson(@RequestParam String dataset) throws CsvValidationException, IOException {
            ObjectDetector.startProcess(dataset);
            try {
                ObjectSet latestObjectSet = dbInteraction.retrieveLatestObjectSet();