DJL Demo: The Official Example Collection for Deep Java Library
Demo applications showcasing DJL
At a glance
- What is it?
- DJL Demo is the official repository of runnable examples for Deep Java Library, a framework-agnostic Java API for deep learning. It covers inference, training, Android, AWS services, and big data integrations across more than twenty sub-projects, each with its own README and build configuration.
- Who is it for?
- Java engineers who want to see Deep Java Library working in a real context before adopting it should start with DJL Demo. The repository covers more deployment targets than most ML framework example collections: a single Gradle project contains examples for Android PyTorch, AWS Lambda, Apache Spark, Apache Flink, GraalVM native compilation, and Quarkus, in addition to the standard inference and training patterns.
- Can I use it commercially?
- Yes. Apache-2.0 is a permissive licence: you can use, modify and sell software built on it, as long as you keep its copyright and licence notices.
- Is it still maintained?
- Yes. The repository last received commits 172 days ago.
- What is it written in?
- Mainly Jupyter Notebook, according to GitHub's language statistics.
Answers come from the project's GitHub data, last synced on September 29, 2026, and from our analysis. They are not legal advice.
Editorial analysis
What DJL Demo Is and Who It Is For
Deep Java Library is a framework-agnostic Java API for deep learning. It supports PyTorch, TensorFlow, MXNet, and ONNX Runtime as interchangeable backends and exposes a unified interface for loading models, running inference, and training. A developer who wants to run a PyTorch model from a Java application without writing Python, or who wants to use deep learning inside an existing Spark or Flink pipeline, is the intended DJL user.
DJL Demo is the official collection of example applications that ship alongside DJL. Its purpose is to show DJL working in concrete, runnable scenarios. The examples span inference use cases (URL classification, pneumonia detection, live object detection), training (footwear classification), Android applications, AWS service integrations, and big data pipeline examples. Each example is a self-contained sub-project with its own README, dependencies, and build configuration. The repository does not provide a single installable library; it is a reference collection for engineers who learn by reading and running code.
Repository Organization: Six Categories of Examples
The repository groups examples into six rough categories.
Inference examples demonstrate how to load a pre-trained model and run predictions. The Malicious URL Detector uses a Character Level CNN to classify URLs. The Pneumonia Detection example loads a Keras model through the TensorFlow engine and classifies chest X-ray images. The Live Object Detection example connects to a web camera and runs detection in real time. A Python pre/post processing example shows how to run Python code inside a DJL inference pipeline.
Training examples show how to define and train models using DJL's training API. The footwear classification example trains a model from scratch. The visualization example uses a Vue.js web interface to display metrics like loss and accuracy during training.
Android examples live under android/pytorch_android/ and android/onnxruntime_android/. They cover face detection, Doodle Draw recognition using a PyTorch model, style transfer using CycleGAN, semantic segmentation, French-to-English neural machine translation, speech recognition, and ONNX-based object detection.
AWS examples under aws/ include integrations with Kinesis Video Streams, serverless model serving via AWS Lambda, model serving on Elastic Beanstalk, and inference using AWS Inferentia hardware.
Big data examples cover Spark image classification, Apache Beam click-through rate prediction, Apache Flink sentiment analysis, and an Apache Camel image classification component.
Other examples include running multiple deep learning frameworks in a single JVM, GraalVM native compilation of DJL applications, and Quarkus model serving.
Getting Started: Clone and Navigate
The entire collection is a single Gradle project, so cloning the repository gives access to all examples at once:
git clone https://github.com/deepjavalibrary/djl-demo.gitEach sub-project has its own directory under the repository root. The top-level gradlew script provides the Gradle wrapper. Individual examples can be built or run using Gradle tasks from within their directory:
./gradlew runThe build.gradle.kts and settings.gradle.kts at the root configure the overall project. The README for each sub-project documents the prerequisites: some require specific hardware (the Inferentia example needs an AWS Inferentia instance), some require an Android SDK and device, and the web demos run in a browser through the interactive console at https://demo.djl.ai.
The jupyter/ directory contains Jupyter Notebook versions of several examples for engineers who prefer that format. The demo website at https://demo.djl.ai hosts interactive versions of the web-based demos without requiring a local build.
Representative Demos in Depth
Three examples illustrate the range of what DJL can do.
The Malicious URL Detector in malicious-url-detector/ runs a trained Character Level CNN model on a URL string and returns a classification. It demonstrates how to use DJL's translator interface to convert a raw string input into a tensor and back. This example runs without GPU hardware.
The Live Object Detection demo in live-object-detection/ reads frames from a webcam and runs an object detection model on each frame, drawing bounding boxes around detected objects. It demonstrates the DJL Criteria API for loading a model from the model zoo and the ZooModel interface for running inference in a loop.
The Apache Spark image classification demo in apache-spark/spark3.0/image/ shows how to embed DJL inference inside a Spark job. Rather than exporting the model and calling Python from a Spark UDF, the example loads the DJL model directly inside the Spark executor using DJL's Spark integration. This is the pattern most relevant to Java-native data engineering teams who want to score images at scale without leaving the JVM.
The GraalVM demo in graalvm/ shows how to compile a DJL inference application into a native executable, which removes the JVM startup time and reduces the memory footprint of the deployment.
Limitations and Where This Collection Falls Short
The demo repository tracks DJL releases but has its own cadence. The last push was on 2026-04-11 and there are no GitHub releases on this repository. If DJL adds a new model zoo entry, a new backend, or a new API after that date, the demo collection will not reflect it until the repository is updated.
The Android examples require an Android development environment with the correct SDK version. The README for each Android demo documents the requirements, but setting up Android development is a separate prerequisite that the repo assumes rather than providing.
Tensorflow.js and PyTorch.js serve a similar set of use cases in the JavaScript ecosystem: they allow running trained models directly in the browser or in a Node.js server. DJL's primary trade-off compared to those libraries is that it runs in the JVM, which is an advantage for teams with existing Java infrastructure but a disadvantage for teams deploying to web clients. DJL does ship a browser-based interactive console at demo.djl.ai, but browser execution in DJL is a demonstration feature, not a production deployment target.
Maintenance and License
The last push to this repository was on 2026-04-11. The repository is not archived. A GitHub Actions nightly workflow runs against the examples to catch breakage from dependency updates, as visible from the .github/ directory. The repository carries an Apache-2.0 license, which permits use in commercial projects. Deep Java Library itself is maintained by AWS. The demo repository homepage at https://demo.djl.ai provides a browsable interface to the web-based examples. The CODE_OF_CONDUCT.md and CONTRIBUTING.md files document how to contribute new examples to the collection.
Editorial conclusion
Java engineers who want to see Deep Java Library working in a real context before adopting it should start with DJL Demo. The repository covers more deployment targets than most ML framework example collections: a single Gradle project contains examples for Android PyTorch, AWS Lambda, Apache Spark, Apache Flink, GraalVM native compilation, and Quarkus, in addition to the standard inference and training patterns. The last push was on 2026-04-11, and there are no releases on the demo repository itself, so the examples may lag behind the latest DJL API if DJL releases new features after that date. Each sub-project links to its own README; read that README first to check the required DJL version and any system-specific prerequisites before running.
Frequently asked questions
What can DJL be used for?
Deep Java Library supports inference and training in Java across multiple backends including PyTorch, TensorFlow, and ONNX Runtime. The demo collection shows it in use for image classification, object detection, NLP, speech recognition, and model serving on AWS Lambda, Spark, Flink, and Android.
Is DJL suitable for beginners?
The demo repository targets engineers who already know Java and want a practical starting point. The README for each sub-project describes its prerequisites, and some demos require backend-specific setup such as an Android SDK or AWS account. The interactive console at demo.djl.ai is the lowest-friction entry point.
Is DJL open source?
Yes. Both the Deep Java Library framework and this demo repository are released under the Apache-2.0 license, which permits use in commercial projects with attribution.
Official sources
Add this badge to your README
If you maintain this project, the badge below links readers to this analysis and shows its maintenance status from the daily GitHub snapshot. Paste the markdown into your README; add ?metric=license or ?metric=stars to the image URL for a different field.
[](https://hysenlabs.com/projects/deepjavalibrary-djl-demo)