Skip to content
This repository has been archived by the owner on Nov 17, 2023. It is now read-only.

Added javadocs and improved example instructions #13711

Merged
merged 1 commit into from
Dec 21, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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**:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)

}