{"id":13471557,"url":"https://github.com/deepjavalibrary/djl","last_synced_at":"2026-03-16T22:35:16.196Z","repository":{"id":36975231,"uuid":"218396611","full_name":"deepjavalibrary/djl","owner":"deepjavalibrary","description":"An Engine-Agnostic Deep Learning Framework in Java","archived":false,"fork":false,"pushed_at":"2025-05-07T20:49:13.000Z","size":48703,"stargazers_count":4453,"open_issues_count":182,"forks_count":697,"subscribers_count":109,"default_branch":"master","last_synced_at":"2025-05-09T00:54:53.673Z","etag":null,"topics":["ai","autograd","deep-learning","deep-neural-networks","djl","java","machine-learning","ml","mxnet","neural-network","onnxruntime","pytorch","tensorflow"],"latest_commit_sha":null,"homepage":"https://djl.ai","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/deepjavalibrary.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":"docs/roadmap.md","authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2019-10-29T22:38:54.000Z","updated_at":"2025-05-08T11:02:58.000Z","dependencies_parsed_at":"2023-10-12T09:55:55.666Z","dependency_job_id":"f30b5e74-6bc6-449e-bfb2-a3d6150dc01f","html_url":"https://github.com/deepjavalibrary/djl","commit_stats":null,"previous_names":["awslabs/djl"],"tags_count":36,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deepjavalibrary%2Fdjl","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deepjavalibrary%2Fdjl/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deepjavalibrary%2Fdjl/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deepjavalibrary%2Fdjl/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/deepjavalibrary","download_url":"https://codeload.github.com/deepjavalibrary/djl/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254448578,"owners_count":22072764,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ai","autograd","deep-learning","deep-neural-networks","djl","java","machine-learning","ml","mxnet","neural-network","onnxruntime","pytorch","tensorflow"],"created_at":"2024-07-31T16:00:46.640Z","updated_at":"2026-03-16T22:35:16.155Z","avatar_url":"https://github.com/deepjavalibrary.png","language":"Java","readme":"\n![DeepJavaLibrary](website/img/deepjavalibrary.png?raw=true \"Deep Java Library\")\n\n[![Release](https://img.shields.io/github/v/release/deepjavalibrary/djl.svg)](https://github.com/deepjavalibrary/djl/releases)\n[![Docs](https://img.shields.io/badge/docs-up-green)](https://docs.djl.ai/master/index.html)\n[![Continuous](https://github.com/deepjavalibrary/djl/workflows/Continuous/badge.svg)](https://github.com/deepjavalibrary/djl/actions/workflows/continuous.yml)\n[![Nightly Publish](https://github.com/deepjavalibrary/djl/workflows/Nightly%20Publish/badge.svg)](https://github.com/deepjavalibrary/djl/actions/workflows/nightly_publish.yml)\n[![CodeQL](https://github.com/deepjavalibrary/djl/actions/workflows/codeql-analysis-java.yml/badge.svg)](https://github.com/deepjavalibrary/djl/actions/workflows/codeql-analysis-java.yml)\n\n# Deep Java Library (DJL)\n\n## Overview\n\n[Deep Java Library (DJL)](https://docs.djl.ai/master/index.html) is an open-source, high-level, engine-agnostic Java framework for deep learning. DJL is designed to be easy to get started with and simple to\nuse for Java developers. DJL provides a native Java development experience and functions like any other regular Java library.\n\nYou don't have to be machine learning/deep learning expert to get started. You can use your existing Java expertise as an on-ramp to learn and use machine learning and deep learning. You can\nuse your favorite IDE to build, train, and deploy your models. DJL makes it easy to integrate these models with your\nJava applications.\n\nBecause DJL is deep learning engine agnostic, you don't have to make a choice\nbetween engines when creating your projects. You can switch engines at any\npoint. To ensure the best performance, DJL also provides automatic CPU/GPU choice based on hardware configuration.\n\nDJL's ergonomic API interface is designed to guide you with best practices to accomplish\ndeep learning tasks.\nThe following pseudocode demonstrates running inference:\n\n```java\n    // Assume user uses a pre-trained model from model zoo, they just need to load it\n    Criteria\u003cImage, Classifications\u003e criteria =\n            Criteria.builder()\n                    .optApplication(Application.CV.OBJECT_DETECTION) // find object detection model\n                    .setTypes(Image.class, Classifications.class)    // define input and output\n                    .optFilter(\"backbone\", \"resnet50\")               // choose network architecture\n                    .build();\n\n    Image img = ImageFactory.getInstance().fromUrl(\"http://...\");    // read image\n    try (ZooModel\u003cImage, Classifications\u003e model = criteria.loadModel();\n         Predictor\u003cImage, Classifications\u003e predictor = model.newPredictor()) {\n        Classifications result = predictor.predict(img);\n\n        // get the classification and probability\n        ...\n    }\n```\n\nThe following pseudocode demonstrates running training:\n\n```java\n    // Construct your neural network with built-in blocks\n    Block block = new Mlp(28 * 28, 10, new int[] {128, 64});\n\n    Model model = Model.newInstance(\"mlp\"); // Create an empty model\n    model.setBlock(block);                  // set neural network to model\n\n    // Get training and validation dataset (MNIST dataset)\n    Dataset trainingSet = new Mnist.Builder().setUsage(Usage.TRAIN) ... .build();\n    Dataset validateSet = new Mnist.Builder().setUsage(Usage.TEST) ... .build();\n\n    // Setup training configurations, such as Initializer, Optimizer, Loss ...\n    TrainingConfig config = setupTrainingConfig();\n    Trainer trainer = model.newTrainer(config);\n    /*\n     * Configure input shape based on dataset to initialize the trainer.\n     * 1st axis is batch axis, we can use 1 for initialization.\n     * MNIST is 28x28 grayscale image and pre processed into 28 * 28 NDArray.\n     */\n    trainer.initialize(new Shape(1, 28 * 28));\n    EasyTrain.fit(trainer, epoch, trainingSet, validateSet);\n\n    // Save the model\n    model.save(modelDir, \"mlp\");\n\n    // Close the resources\n    trainer.close();\n    model.close();\n```\n\n## [Getting Started](docs/quick_start.md)\n\n## Resources\n\n- [Documentation](docs/README.md#documentation)\n- [DJL's D2L Book](https://d2l.djl.ai/)\n- [JavaDoc API Reference](https://djl.ai/website/javadoc.html)\n\n## Release Notes\n\n* [0.32.0](https://github.com/deepjavalibrary/djl/releases/tag/v0.32.0) ([Code](https://github.com/deepjavalibrary/djl/tree/v0.32.0))\n* [0.31.1](https://github.com/deepjavalibrary/djl/releases/tag/v0.31.1) ([Code](https://github.com/deepjavalibrary/djl/tree/v0.31.1))\n* [0.30.0](https://github.com/deepjavalibrary/djl/releases/tag/v0.30.0) ([Code](https://github.com/deepjavalibrary/djl/tree/v0.30.0))\n* [0.29.0](https://github.com/deepjavalibrary/djl/releases/tag/v0.29.0) ([Code](https://github.com/deepjavalibrary/djl/tree/v0.29.0))\n* [0.28.0](https://github.com/deepjavalibrary/djl/releases/tag/v0.28.0) ([Code](https://github.com/deepjavalibrary/djl/tree/v0.28.0))\n* [+27 releases](https://github.com/deepjavalibrary/djl/releases)\n\nThe release of DJL 0.33.0 is planned for April 2025. \n\n## Building From Source\n\nTo build from source, begin by checking out the code.\nOnce you have checked out the code locally, you can build it as follows using Gradle:\n\n```sh\n# for Linux/macOS:\n./gradlew build\n\n# for Windows:\ngradlew build\n```\n\nTo increase build speed, you can use the following command to skip unit tests:\n\n```sh\n# for Linux/macOS:\n./gradlew build -x test\n\n# for Windows:\ngradlew build -x test\n```\n\n### Importing into eclipse\n\nto import source project into eclipse\n\n```sh\n# for Linux/macOS:\n./gradlew eclipse\n\n# for Windows:\ngradlew eclipse\n\n```\n\nin eclipse \n\nfile-\u003eimport-\u003egradle-\u003eexisting gradle project\n\n**Note:** please set your workspace text encoding setting to UTF-8\n\n## Community\n\nYou can read our guide to [community forums, following DJL, issues, discussions, and RFCs](docs/forums.md) to figure out the best way to share and find content from the DJL community.\n\nJoin our [\u003cimg src='https://cdn3.iconfinder.com/data/icons/social-media-2169/24/social_media_social_media_logo_slack-512.png' width='20px' /\u003e slack channel](http://tiny.cc/djl_slack) to get in touch with the development team, for questions and discussions.\n\nFollow our [\u003cimg src='https://cdn2.iconfinder.com/data/icons/social-media-2285/512/1_Twitter_colored_svg-512.png' width='20px' /\u003e X (formerly Twitter)](https://x.com/deepjavalibrary) to see updates about new content, features, and releases.\n\n关注我们 [\u003cimg src='https://www.iconfinder.com/icons/5060515/download/svg/512' width='20px' /\u003e 知乎专栏](https://zhuanlan.zhihu.com/c_1255493231133417472) 获取DJL最新的内容！\n\n## Useful Links\n\n* [DJL Website](https://djl.ai/)\n* [Documentation](https://docs.djl.ai/)\n* [DJL Demos](https://docs.djl.ai/master/docs/demos/index.html)\n* [Dive into Deep Learning Book Java version](https://d2l.djl.ai/)\n\n## License\n\nThis project is licensed under the [Apache-2.0 License](LICENSE).\n","funding_links":[],"categories":["Java","🔹 **WordPiece Tokenizer Implementations**","人工智能"],"sub_categories":["[Tools](#tools-1)"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdeepjavalibrary%2Fdjl","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdeepjavalibrary%2Fdjl","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdeepjavalibrary%2Fdjl/lists"}