Repository: deepjavalibrary/djl
Pull request #1716 (2022-06-14 17:49:53)

Change DJL repo names from aws-samples


Patch:
diff --git a/docs/development/troubleshooting.md b/docs/development/troubleshooting.md
index c884bed9b..453f09669 100644
--- a/docs/development/troubleshooting.md
+++ b/docs/development/troubleshooting.md
@@ -232,7 +232,7 @@ No X11 DISPLAY variable was set, but this program performed an operation which r
 java.awt.HeadlessException:
 ```
 
-Follow the [steps here](https://github.com/aws-samples/d2l-java/blob/master/documentation/troubleshoot.md) to resolve it.
+Follow the [steps here](https://github.com/deepjavalibrary/d2l-java/blob/master/documentation/troubleshoot.md) to resolve it.
 
 
 ## 10. JVM crash
diff --git a/docs/interactive_tool.md b/docs/interactive_tool.md
index 683b56d05..ed102fedc 100644
--- a/docs/interactive_tool.md
+++ b/docs/interactive_tool.md
@@ -5,18 +5,18 @@ Without additional setup, you can easily run the tool kits online and export the
 
 ## [Interactive JShell](https://djl.ai/website/demo.html#jshell)
 
-![terminal](https://raw.githubusercontent.com/aws-samples/djl-demo/master/web-demo/interactive-console/img/terminal.gif)
+![terminal](https://raw.githubusercontent.com/deepjavalibrary/djl-demo/master/web-demo/interactive-console/img/terminal.gif)
 
 Interactive JShell is a modified version of [JShell](https://docs.oracle.com/javase/9/jshell/introduction-jshell.htm#JSHEL-GUID-630F27C8-1195-4989-9F6B-2C51D46F52C8) equipped with DJL features.
 You can use the existing Java features as well as DJL classes.
 To test out some functions in DJL, use this JShell to try methods defined in the [Javadoc](https://javadoc.io/doc/ai.djl/api/latest/ai/djl/ndarray/NDArray.html).
 We created useful operators to use in your deep learning applications.
-For more information about this JShell, see the [Interactive JShell and Block Runner for DJL](https://github.com/aws-samples/djl-demo/tree/master/web-demo/interactive-console#jshell) demo.
+For more information about this JShell, see the [Interactive JShell and Block Runner for DJL](https://github.com/deepjavalibrary/djl-demo/tree/master/web-demo/interactive-console#jshell) demo.
 
 
 ## [Block Runner](https://djl.ai/website/demo.html#block-runner)
 
-![block runner](https://raw.githubusercontent.com/aws-samples/djl-demo/master/web-demo/interactive-console/img/blockrunner.gif)
+![block runner](https://raw.githubusercontent.com/deepjavalibrary/djl-demo/master/web-demo/interactive-console/img/blockrunner.gif)
 
 Block Runner is designed to be simple. 
 It allows you to run Java code line by line without worrying about the class structures. As shown in the gif, you can simply craft some code and click the “Run” button to run it online. 
diff --git a/examples/README.md b/examples/README.md
index 9c5b293e1..b5c7a7c7e 100644
--- a/examples/README.md
+++ b/examples/README.md
@@ -1,7 +1,7 @@
 # Examples
 
 This module contains examples to demonstrate use of the Deep Java Library (DJL).
-You can find more examples from our [djl-demo github repo](https://github.com/aws-samples/djl-demo).
+You can find more examples from our [djl-demo github repo](https://github.com/deepjavalibrary/djl-demo).
 
 The following examples are included for training:
 
@@ -34,7 +34,7 @@ You may be able to find more translator examples in our engine specific model zo
 [PyTorch](https://github.com/deepjavalibrary/djl/tree/master/engines/pytorch/pytorch-model-zoo),
 and [TensorFlow](https://github.com/deepjavalibrary/djl/tree/master/engines/tensorflow/tensorflow-model-zoo).
 
-More examples and demos of applications featuring DJL are located in our [demo repository](https://github.com/aws-samples/djl-demo).
+More examples and demos of applications featuring DJL are located in our [demo repository](https://github.com/deepjavalibrary/djl-demo).
 
 ## Prerequisites
 
diff --git a/website/demo.html b/website/demo.html
index 2eb4b3d6f..ab93b7fa6 100644
--- a/website/demo.html
+++ b/website/demo.html
@@ -72,7 +72,7 @@
                     <h5 class="header col s12 light">Experience Java to solve your DL problem in a simple way.</h5>
                 </div>
                 <div class="row center">
-                    <a href="https://github.com/aws-samples/djl-demo"
+                    <a href="https://github.com/deepjavalibrary/djl-demo"
                     class="btn-large waves-effect waves-light light-blue accent-2">Checkout our Demos</a>
                     <a href="https://docs.djl.ai/docs/demos/index.html"
                     class="btn-large waves-effect waves-light light-blue accent-2">Documentation</a>
@@ -197,7 +197,7 @@
                         <h5 class="header col s12 light">Want to know more?</h5>
                     </div>
                     <div class="row center">
-                        <a href="https://github.com/aws-samples/djl-demo"
+                        <a href="https://github.com/deepjavalibrary/djl-demo"
                         class="btn-large waves-effect waves-light light-blue accent-2 pulse">Checkout our demo repository</a>
                     </div>
                     <div class="row center">


Test patch:
diff --git a/android/core/src/androidTest/java/ai/djl/android/core/ModelLoadingTest.java b/android/core/src/androidTest/java/ai/djl/android/core/ModelLoadingTest.java
new file mode 100644
index 000000000..1ae1b73a9
--- /dev/null
+++ b/android/core/src/androidTest/java/ai/djl/android/core/ModelLoadingTest.java
@@ -0,0 +1,55 @@
+/*
+ * Copyright 2022 Amazon.com, Inc. or its affiliates. All Rights Reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance
+ * with the License. A copy of the License is located at
+ *
+ * http://aws.amazon.com/apache2.0/
+ *
+ * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES
+ * OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions
+ * and limitations under the License.
+ */
+package ai.djl.android.core;
+
+import org.junit.Assert;
+import org.junit.Test;
+
+import java.io.IOException;
+
+import ai.djl.ModelException;
+import ai.djl.inference.Predictor;
+import ai.djl.modality.Classifications;
+import ai.djl.modality.cv.Image;
+import ai.djl.modality.cv.ImageFactory;
+import ai.djl.modality.cv.transform.ToTensor;
+import ai.djl.modality.cv.translator.ImageClassificationTranslator;
+import ai.djl.repository.zoo.Criteria;
+import ai.djl.repository.zoo.ModelZoo;
+import ai.djl.repository.zoo.ZooModel;
+import ai.djl.translate.TranslateException;
+
+/* Integration test to check if model and inference runs fine */
+public class ModelLoadingTest {
+
+    @Test
+    public void testModelLoading() throws IOException, ModelException, TranslateException {
+        ImageClassificationTranslator translator = ImageClassificationTranslator.builder()
+                .addTransform(new ToTensor())
+                .optFlag(Image.Flag.GRAYSCALE)
+                .optApplySoftmax(true)
+                .build();
+        Criteria<Image, Classifications> criteria =
+                Criteria.builder()
+                        .setTypes(Image.class, Classifications.class)
+                        .optModelUrls("https://djl-ai.s3.amazonaws.com/resources/demo/pytorch/doodle_mobilenet.zip")
+                        .optTranslator(translator)
+                        .build();
+        Image image = ImageFactory.getInstance().fromUrl("https://resources.djl.ai/images/0.png");
+        try (ZooModel<Image, Classifications> model = ModelZoo.loadModel(criteria);
+             Predictor<Image, Classifications> predictor = model.newPredictor()) {
+            Classifications result = predictor.predict(image);
+            Assert.assertEquals("dog", result.best().getClassName());
+        }
+    }
+}