You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mxnet.apache.org by aa...@apache.org on 2018/12/21 22:46:15 UTC

[incubator-mxnet] branch master updated: Added javadocs and improved example instructions (#13711)

This is an automated email from the ASF dual-hosted git repository.

aaronmarkham pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-mxnet.git


The following commit(s) were added to refs/heads/master by this push:
     new b018019  Added javadocs and improved example instructions (#13711)
b018019 is described below

commit b0180190152863b06ffd024203cdc1a0e3df32bc
Author: Andrew Ayres <an...@gmail.com>
AuthorDate: Fri Dec 21 14:45:54 2018 -0800

    Added javadocs and improved example instructions (#13711)
---
 .../javaapi/infer/objectdetector/README.md         |  8 ++---
 .../mxnet/infer/javaapi/ObjectDetectorOutput.scala | 37 ++++++++++++++++++++++
 2 files changed, 41 insertions(+), 4 deletions(-)

diff --git a/scala-package/examples/src/main/java/org/apache/mxnetexamples/javaapi/infer/objectdetector/README.md b/scala-package/examples/src/main/java/org/apache/mxnetexamples/javaapi/infer/objectdetector/README.md
index 681253f..5574102 100644
--- a/scala-package/examples/src/main/java/org/apache/mxnetexamples/javaapi/infer/objectdetector/README.md
+++ b/scala-package/examples/src/main/java/org/apache/mxnetexamples/javaapi/infer/objectdetector/README.md
@@ -17,8 +17,8 @@ The model is trained on the [Pascal VOC 2012 dataset](http://host.robots.ox.ac.u
 
 ## Prerequisites
 
-1. MXNet
-2. MXNet Scala Package
+1. [Build MXNet](http://mxnet.incubator.apache.org/install/scala_setup.html)
+2. [Build MXNet Scala/Java Package](http://mxnet.incubator.apache.org/install/scala_setup.html)
 3. [IntelliJ IDE (or alternative IDE) project setup](http://mxnet.incubator.apache.org/tutorials/java/mxnet_java_on_intellij.html) with the MXNet Scala/Java Package
 4. wget
 
@@ -64,10 +64,10 @@ The followings is the parameters defined for this example, you can find more inf
 ## How to Run Inference
 After the previous steps, you should be able to run the code using the following script that will pass all of the required parameters to the Infer API.
 
-From the `scala-package/examples/scripts/inferexample/objectdetector/` folder run:
+From the `scala-package/examples/scripts/infer/objectdetector/` folder run:
 
 ```bash
-./run_ssd_example.sh ../models/resnet50_ssd/resnet50_ssd/resnet50_ssd_model ../images/dog.jpg ../images
+./run_ssd_example.sh ../models/resnet50_ssd/resnet50_ssd_model ../images/dog.jpg ../images
 ```
 
 **Notes**:
diff --git a/scala-package/infer/src/main/scala/org/apache/mxnet/infer/javaapi/ObjectDetectorOutput.scala b/scala-package/infer/src/main/scala/org/apache/mxnet/infer/javaapi/ObjectDetectorOutput.scala
index 13369c8..5a6ac75 100644
--- a/scala-package/infer/src/main/scala/org/apache/mxnet/infer/javaapi/ObjectDetectorOutput.scala
+++ b/scala-package/infer/src/main/scala/org/apache/mxnet/infer/javaapi/ObjectDetectorOutput.scala
@@ -17,18 +17,55 @@
 
 package org.apache.mxnet.infer.javaapi
 
+/**
+  * The ObjectDetectorOutput class is a simple POJO helper class that is used to simplify
+  * the interactions with ObjectDetector predict results. The class stores the bounding box
+  * coordinates, name of preicted class, and the probability.
+  */
+
+
 class ObjectDetectorOutput (className: String, args: Array[Float]){
 
+  /**
+    * Gets the predicted class's name.
+    *
+    * @return       String representing the name of the predicted class
+    */
   def getClassName: String = className
 
+  /**
+    * Gets the probability of the predicted class.
+    *
+    * @return       Float representing the probability of predicted class
+    */
   def getProbability: Float = args(0)
 
+  /**
+    * Gets the minimum X coordinate for the bounding box containing the predicted object.
+    *
+    * @return       Float of the min X coordinate for the object bounding box
+    */
   def getXMin: Float = args(1)
 
+  /**
+    * Gets the maximum X coordinate for the bounding box containing the predicted object.
+    *
+    * @return       Float of the max X coordinate for the object bounding box
+    */
   def getXMax: Float = args(2)
 
+  /**
+    * Gets the minimum Y coordinate for the bounding box containing the predicted object.
+    *
+    * @return       Float of the min Y coordinate for the object bounding box
+    */
   def getYMin: Float = args(3)
 
+  /**
+    * Gets the maximum Y coordinate for the bounding box containing the predicted object.
+    *
+    * @return       Float of the max Y coordinate for the object bounding box
+    */
   def getYMax: Float = args(4)
 
 }