Deep Java Library 0.35.0 - aws-ai API
This document is the API specification for the AWS AI toolkit for DJL.
The aws-ai module contains classes that make it easy for DJL to access AWS services.
You can use this toolkit to load models from AWS S3 bucket directly:
// Set model zoo search path system property. The value can be
// comma delimited url string. You can add multiple s3 url.
// The S3 url should point to a folder in your s3 bucket.
// In current implementation, DJL will only download files directly
// in that folder. The archive file like .zip, .tar.gz, .tgz, .tar.z
// files will be extracted automatically. This is useful for the models
// that are created by AWS SageMaker.
// The folder name will be interpreted as artifactId and modelName.
// If your model file has a different name then the folder name, you
// need use query string to tell DJL which model you want to load.
System.setProperty("ai.djl.repository.zoo.location",
"s3://djl-misc/test/models/resnet18?model_name=resent18_v1");
Criteria<Image, Classifications> criteria =
Criteria.builder()
.optApplication(Application.CV.IMAGE_CLASSIFICATION)
.setTypes(Image.class, Classifications.class)
.optArtifactId("ai.djl.localmodelzoo:resnet18")
.optProgress(new ProgressBar())
.build();
ZooModel<Image, Classifications> model = criteria.loadModel();
Packages
Package
Description
Contains a built-in implementation of Repository class that can be used for loading models from
AWS S3 bucket directly.