public abstract class BaseLabels extends Object implements Labels
Modifier | Constructor and Description |
---|---|
protected |
BaseLabels()
Override
getLabels() when using this constructor. |
protected |
BaseLabels(String textResource)
No need to override anything with this constructor.
|
Modifier and Type | Method and Description |
---|---|
List<List<ClassPrediction>> |
decodePredictions(INDArray predictions,
int n)
Given predictions from the trained model this method will return a list
of the top n matches and the respective probabilities.
|
String |
getLabel(int n)
Returns the description of the nth class from the classes of a dataset.
|
protected ArrayList<String> |
getLabels()
Override to return labels when not calling
BaseLabels(String) . |
protected ArrayList<String> |
getLabels(String textResource)
Returns labels based on the text file resource.
|
protected File |
getResourceFile()
Download the resource at getURL() to the local resource directory, and return the local copy as a File
|
protected abstract URL |
getURL() |
protected abstract String |
resourceMD5() |
protected abstract String |
resourceName() |
protected BaseLabels() throws IOException
getLabels()
when using this constructor.IOException
protected BaseLabels(String textResource) throws IOException
textResource
- name of a resource containing labels as a list in a text file.IOException
protected ArrayList<String> getLabels() throws IOException
BaseLabels(String)
.IOException
protected ArrayList<String> getLabels(String textResource) throws IOException
IOException
public String getLabel(int n)
Labels
public List<List<ClassPrediction>> decodePredictions(INDArray predictions, int n)
Labels
decodePredictions
in interface Labels
predictions
- rawprotected abstract URL getURL()
protected abstract String resourceName()
protected abstract String resourceMD5()
protected File getResourceFile()
Copyright © 2018. All rights reserved.