@Test public void testValidConfig() { Map config = new LinkedHashMap<>(); YoloProcessor ypImageSaver = new YoloProcessor(); List<Number> anchorList = Arrays.asList(1, 1, 1, 1, 1, 1, 1, 1, 1, 1); config.put("pbFile", PB_FILE); config.put("metaFile", META_FILE); try { ypImageSaver.setupImageProcessing(config, SOURCE_NAME, MODEL_DIRECTORY, testAuthToken, testVantiqServer); } catch (Exception e) { fail("Should not fail with meta file but no label file: " + e.getClass().getName() + "::" + e.getMessage()); } config.put("anchors", anchorList); try { ypImageSaver.setupImageProcessing(config, SOURCE_NAME, MODEL_DIRECTORY, testAuthToken, testVantiqServer); } catch (Exception e) { fail("Should not fail with meta file and anchors: " + e.getClass().getName() + "::" + e.getMessage()); } config.remove("metaFile"); config.remove("anchors"); config.put("labelFile", LABEL_FILE); try { ypImageSaver.setupImageProcessing(config, SOURCE_NAME, MODEL_DIRECTORY, testAuthToken, testVantiqServer); } catch (Exception e) { fail("Should not fail with label file but no meta file: " + e.getClass().getName() + "::" + e.getMessage()); } config.put("anchors", anchorList); try { ypImageSaver.setupImageProcessing(config, SOURCE_NAME, MODEL_DIRECTORY, testAuthToken, testVantiqServer); } catch (Exception e) { fail("Should not fail with label file and anchors: " + e.getClass().getName() + "::" + e.getMessage()); } config.put("metaFile", META_FILE); try { ypImageSaver.setupImageProcessing(config, SOURCE_NAME, MODEL_DIRECTORY, testAuthToken, testVantiqServer); } catch (Exception e) { fail("Should not fail with label and meta file, and anchors: " + e.getClass().getName() + "::" + e.getMessage()); } }
@Override public void setupImageProcessing(Map<String, ?> neuralNetConfig, String sourceName, String modelDirectory, String authToken, String server) throws Exception { setup(neuralNetConfig, sourceName, modelDirectory, authToken, server); try { objectDetector = new ObjectDetector(threshold, pbFile, labelsFile, metaFile, anchorArray, imageUtil, outputDir, labelImage, saveRate, vantiq, sourceName); } catch (Exception e) { throw new Exception(this.getClass().getCanonicalName() + ".yoloBackendSetupError: " + "Failed to create new ObjectDetector", e); } }
YoloProcessor extends NeuralNetUtils implements NeuralNetInterface2 { @Override public void setupImageProcessing(Map<String, ?> neuralNetConfig, String sourceName, String modelDirectory, String authToken, String server) throws Exception { setup(neuralNetConfig, sourceName, modelDirectory, authToken, server); try { objectDetector = new ObjectDetector(threshold, pbFile, labelsFile, metaFile, anchorArray, imageUtil, outputDir, labelImage, saveRate, vantiq, sourceName); } catch (Exception e) { throw new Exception(this.getClass().getCanonicalName() + ".yoloBackendSetupError: " + "Failed to create new ObjectDetector", e); } } }
YoloProcessor extends NeuralNetUtils implements NeuralNetInterface2 { @Override public void setupImageProcessing(Map<String, ?> neuralNetConfig, String sourceName, String modelDirectory, String authToken, String server) throws Exception { setup(neuralNetConfig, sourceName, modelDirectory, authToken, server); try { objectDetector = new ObjectDetector(threshold, pbFile, labelsFile, metaFile, anchorArray, imageUtil, outputDir, labelImage, saveRate, vantiq, sourceName); } catch (Exception e) { throw new Exception(this.getClass().getCanonicalName() + ".yoloBackendSetupError: " + "Failed to create new ObjectDetector", e); } }  }
YoloProcessor extends NeuralNetUtils implements NeuralNetInterface2 { @Override public void setupImageProcessing(Map<String, ?> neuralNetConfig, String sourceName, String modelDirectory, String authToken, String server) throws Exception { setup(neuralNetConfig, sourceName, modelDirectory, authToken, server); try { objectDetector = new ObjectDetector(threshold, pbFile, labelsFile, metaFile, anchorArray, imageUtil, outputDir, labelImage, saveRate, vantiq, sourceName); } catch (Exception e) { throw new Exception(this.getClass().getCanonicalName() + ".yoloBackendSetupError: " + "Failed to create new ObjectDetector", e); } }  @Override void setupImageProcessing(Map<String, ?> neuralNetConfig, String sourceName, String modelDirectory, String authToken, String server); @Override NeuralNetResults processImage(byte[] image); @Override NeuralNetResults processImage(byte[] image,  Map<String, ?> request); @Override NeuralNetResults processImage(Map<String, ?> processingParams, byte[] image); @Override NeuralNetResults processImage(Map<String, ?> processingParams, byte[] image, Map<String, ?> request); @Override void close(); }
YoloProcessor extends NeuralNetUtils implements NeuralNetInterface2 { @Override public void setupImageProcessing(Map<String, ?> neuralNetConfig, String sourceName, String modelDirectory, String authToken, String server) throws Exception { setup(neuralNetConfig, sourceName, modelDirectory, authToken, server); try { objectDetector = new ObjectDetector(threshold, pbFile, labelsFile, metaFile, anchorArray, imageUtil, outputDir, labelImage, saveRate, vantiq, sourceName); } catch (Exception e) { throw new Exception(this.getClass().getCanonicalName() + ".yoloBackendSetupError: " + "Failed to create new ObjectDetector", e); } }  @Override void setupImageProcessing(Map<String, ?> neuralNetConfig, String sourceName, String modelDirectory, String authToken, String server); @Override NeuralNetResults processImage(byte[] image); @Override NeuralNetResults processImage(byte[] image,  Map<String, ?> request); @Override NeuralNetResults processImage(Map<String, ?> processingParams, byte[] image); @Override NeuralNetResults processImage(Map<String, ?> processingParams, byte[] image, Map<String, ?> request); @Override void close();  }