Class ImageNetLabels
- java.lang.Object
-
- org.deeplearning4j.zoo.util.BaseLabels
-
- org.deeplearning4j.zoo.util.imagenet.ImageNetLabels
-
- All Implemented Interfaces:
Labels
public class ImageNetLabels extends BaseLabels
-
-
Field Summary
-
Fields inherited from class org.deeplearning4j.zoo.util.BaseLabels
labels
-
-
Constructor Summary
Constructors Constructor Description ImageNetLabels()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringdecodePredictions(INDArray predictions)Given predictions from the trained model this method will return a string listing the top five matches and the respective probabilitiesStringgetLabel(int n)Returns the description of tne nth class in the 1000 classes of ImageNet.protected ArrayList<String>getLabels()Override to return labels when not callingBaseLabels(String).protected URLgetURL()protected StringresourceMD5()protected StringresourceName()-
Methods inherited from class org.deeplearning4j.zoo.util.BaseLabels
decodePredictions, getLabels, getResourceFile
-
-
-
-
Constructor Detail
-
ImageNetLabels
public ImageNetLabels() throws IOException- Throws:
IOException
-
-
Method Detail
-
getLabels
protected ArrayList<String> getLabels() throws IOException
Description copied from class:BaseLabelsOverride to return labels when not callingBaseLabels(String).- Overrides:
getLabelsin classBaseLabels- Throws:
IOException
-
getLabel
public String getLabel(int n)
Returns the description of tne nth class in the 1000 classes of ImageNet.- Specified by:
getLabelin interfaceLabels- Overrides:
getLabelin classBaseLabels- Parameters:
n-- Returns:
-
getURL
protected URL getURL()
- Specified by:
getURLin classBaseLabels- Returns:
- URL of the resource to download
-
resourceName
protected String resourceName()
- Specified by:
resourceNamein classBaseLabels- Returns:
- Name of the resource (used for inferring local storage parent directory)
-
resourceMD5
protected String resourceMD5()
- Specified by:
resourceMD5in classBaseLabels- Returns:
- MD5 of the resource at getURL()
-
-