You can build AI

Java Developer? Run Image Classification on AWS Lambda using DJL

Photo by Marvin Meyer on Unsplash

Why Java?

Why AWS Lambda?

Why Deep Learning?

Why Deep Learning on Lambda using Java?

Enough talking, let’s build

Installing Lambda Example

git clone https://github.com/aws-samples/djl-demo.git
cd djl-demo/aws/lambda-model-serving/
./gradlew deploy

Triggering the Lambda Function

Kitten Image to Classify
> aws lambda invoke --function-name DJL-Lambda --payload '{“inputImageUrl”:”https://djl-ai.s3.amazonaws.com/resources/images/kitten.jpg"}' build/output.json{
"StatusCode": 200,
"ExecutedVersion": "$LATEST"
}
> cat build/output.json[
{
"className": "n02123045 tabby, tabby cat",
"probability": 0.48384541273117065
},
{
"className": "n02123159 tiger cat",
"probability": 0.20599405467510223
},
...
]

Lambda Performance Monitoring

DJL Lambda Performance Monitoring
DJL Lambda Invocation Statistics

What’s Next?

Installing Java 11

sudo yum install java-11-amazon-corretto-headless

Installing Java Kernel for Jupyter

git clone https://github.com/frankfliu/IJava.git
cd IJava/
./gradlew installKernel
java — list-modules | grep “jdk.jshell”

Summary and a look ahead

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
ML-Guy

ML-Guy

Guy Ernest is the co-founder and CTO of @aiOla, a promising AI startup that closes the loop between knowledge, people & systems, making sure nothing is lost.