Skip to content

Instantly share code, notes, and snippets.

@roywei
Created May 21, 2020 21:56
Show Gist options
  • Save roywei/7bde8570d0b1efe8dead7d3e68815787 to your computer and use it in GitHub Desktop.
Save roywei/7bde8570d0b1efe8dead7d3e68815787 to your computer and use it in GitHub Desktop.
Criteria<BufferedImage, Classifications> criteria =
Criteria.builder()
.setTypes(BufferedImage.class, Classifications.class)
.optTranslator(new MyTranslator())
.build();
try (ZooModel<BufferedImage, Classifications> model = ModelZoo.loadModel(criteria)) {
try (Predictor<BufferedImage, Classifications> predictor = model.newPredictor()) {
Classifications result = predictor.predict(image);
logger.info("Diagnose:" + result.toString());
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment