From 85cdf659de8483bf8e64ee4e9bc9159285aa86f4 Mon Sep 17 00:00:00 2001 From: Aziz Zayed Date: Thu, 20 May 2021 15:01:45 -0700 Subject: [PATCH 1/2] Added auto softmax metadata for action_recognition --- .../ai/djl/mxnet/action_recognition/metadata.json | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/mxnet/mxnet-model-zoo/src/test/resources/mlrepo/model/cv/action_recognition/ai/djl/mxnet/action_recognition/metadata.json b/mxnet/mxnet-model-zoo/src/test/resources/mlrepo/model/cv/action_recognition/ai/djl/mxnet/action_recognition/metadata.json index 3d3e5918bc7..03f067724b0 100644 --- a/mxnet/mxnet-model-zoo/src/test/resources/mlrepo/model/cv/action_recognition/ai/djl/mxnet/action_recognition/metadata.json +++ b/mxnet/mxnet-model-zoo/src/test/resources/mlrepo/model/cv/action_recognition/ai/djl/mxnet/action_recognition/metadata.json @@ -27,7 +27,8 @@ "height": 224, "resize": true, "normalize": true, - "synsetFileName": "classes.txt" + "synsetFileName": "classes.txt", + "applySoftmax": true }, "files": { "classes": { @@ -60,7 +61,8 @@ "height": 299, "resize": true, "normalize": true, - "synsetFileName": "classes.txt" + "synsetFileName": "classes.txt", + "applySoftmax": true }, "files": { "classes": { From b530a118bb4650aa7cc63caf80bcea6b3ac2f61a Mon Sep 17 00:00:00 2001 From: Aziz Zayed Date: Mon, 7 Jun 2021 19:05:35 -0700 Subject: [PATCH 2/2] Update PyTorch Docs --- jupyter/load_pytorch_model.ipynb | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/jupyter/load_pytorch_model.ipynb b/jupyter/load_pytorch_model.ipynb index a21550611b8..6f16e2cd3cc 100644 --- a/jupyter/load_pytorch_model.ipynb +++ b/jupyter/load_pytorch_model.ipynb @@ -42,6 +42,7 @@ "metadata": {}, "outputs": [], "source": [ + "import java.nio.file.*;\n", "import java.awt.image.*;\n", "import ai.djl.*;\n", "import ai.djl.inference.*;\n", @@ -151,14 +152,9 @@ "metadata": {}, "outputs": [], "source": [ - "// Search for models in the build/pytorch_models folder\n", - "System.setProperty(\"ai.djl.repository.zoo.location\", \"build/pytorch_models/resnet18\");\n", - "\n", "Criteria criteria = Criteria.builder()\n", " .setTypes(Image.class, Classifications.class)\n", - " // only search the model in local directory\n", - " // \"ai.djl.localmodelzoo:{name of the model}\"\n", - " .optArtifactId(\"ai.djl.localmodelzoo:resnet18\")\n", + " .optModelPath(Paths.get(\"build/pytorch_models/resnet18\"))\n", " .optTranslator(translator)\n", " .optProgress(new ProgressBar()).build();\n", "\n", @@ -230,7 +226,7 @@ "mimetype": "text/x-java-source", "name": "Java", "pygments_lexer": "java", - "version": "12.0.2+10" + "version": "11.0.11+9-LTS" }, "pycharm": { "stem_cell": {