Skip to content

Instantly share code, notes, and snippets.

@roywei
Last active June 12, 2020 00:52
Show Gist options
  • Save roywei/8a262786f585ba019db2c7d47c76a169 to your computer and use it in GitHub Desktop.
Save roywei/8a262786f585ba019db2c7d47c76a169 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);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment