https://github.com/awslabs/djl#getting-started
// Assume user uses a pre-trained model from model zoo, they just need to load it
Map<String, String> criteria = new HashMap<>();
criteria.put("layers", "18");
criteria.put("flavor", "v1");
// Load pre-trained model from model zoo
try (Model<BufferedImage, Classifications> model = MxModelZoo.RESNET.loadModel(criteria)) {
try (Predictor<BufferedImage, Classifications> predictor = model.newPredictor()) {
BufferedImage img = readImage(); // read image
Classifications result = predictor.predict(img);
// get the classification and probability
...
}
}