This module contains example projects to demonstrate how developers can use the djl.ai API.
There are three examples in this project:
You need to have JDK 8 (or later) and IntelliJ installed on your system. Read here for more detail.
You should also be familiar with the djl.ai API documentation: Javadoc
This example project supports building with both gradle and maven. To build, use the following:
cd examples
./gradlew build
cd examples
mvn package
With the gradle application
plugin you can execute example code directly.
You can find more detail in each example's detail document.
Here is an example that executes classification:
cd examples
./gradlew run
- Open IntelliJ and click
Import Project
. - Select the
examples
directory in the djl.ai project source folder, and click "Open". - Choose
Import project form existing model
, you can select eitherGradle
orMaven
- Use the default configuration and click
OK
. - Select an example to continue.
djl.ai is engine agnostic, so you can choose different engine providers. We currently provide MXNet engine implementation.
With MXNet, you can choose different flavors of the native MXNet library.
In this example, we use mxnet-native-mkl
for OSX platform. You might need to
change it for your platform in pom.xml or build.gradle.
Available MXNet versions are as follows:
Version |
---|
mxnet-mkl |
mxnet-cu101mkl |