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 String
decodePredictions(INDArray predictions)
Given predictions from the trained model this method will return a string listing the top five matches and the respective probabilitiesString
getLabel(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 URL
getURL()
protected String
resourceMD5()
protected String
resourceName()
-
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:BaseLabels
Override to return labels when not callingBaseLabels(String)
.- Overrides:
getLabels
in classBaseLabels
- Throws:
IOException
-
getLabel
public String getLabel(int n)
Returns the description of tne nth class in the 1000 classes of ImageNet.- Specified by:
getLabel
in interfaceLabels
- Overrides:
getLabel
in classBaseLabels
- Parameters:
n
-- Returns:
-
getURL
protected URL getURL()
- Specified by:
getURL
in classBaseLabels
- Returns:
- URL of the resource to download
-
resourceName
protected String resourceName()
- Specified by:
resourceName
in classBaseLabels
- Returns:
- Name of the resource (used for inferring local storage parent directory)
-
resourceMD5
protected String resourceMD5()
- Specified by:
resourceMD5
in classBaseLabels
- Returns:
- MD5 of the resource at getURL()
-
-