public class DefaultTensorFlowService extends AbstractService implements TensorFlowService
TensorFlowService.| Constructor and Description |
|---|
DefaultTensorFlowService() |
| Modifier and Type | Method and Description |
|---|---|
void |
dispose() |
TensorFlowLibraryStatus |
getStatus() |
TensorFlowVersion |
getTensorFlowVersion() |
CachedModelBundle |
loadCachedModel(Location source,
String modelName,
String... tags)
Extracts a persisted model from the given location.
|
File |
loadFile(Location source,
String modelName,
String filePath)
Extracts a file from the given location.
|
org.tensorflow.Graph |
loadGraph(Location source,
String modelName,
String graphPath)
Extracts a graph from the given location.
|
List<String> |
loadLabels(Location source,
String modelName,
String labelsPath)
Extracts labels from the given location.
|
void |
loadLibrary()
Loads the TensorFlow library.
|
org.tensorflow.SavedModelBundle |
loadModel(Location source,
String modelName,
String... tags)
Deprecated.
|
getContext, setContext, toStringgetInfo, getPriority, setInfo, setPrioritycontextclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitinitialize, registerEventHandlersgetIdentifier, logcontext, getContext, setContextcompareTo, getPriority, setPrioritygetInfo, setInfogetLocationgetVersion@Deprecated public org.tensorflow.SavedModelBundle loadModel(Location source, String modelName, String... tags) throws IOException
TensorFlowServiceloadModel in interface TensorFlowServicesource - The location of the model, which must be structured as a ZIP
archive.modelName - The name of the model by which the source should be
unpacked and cached as needed.tags - Optional list of tags passed to
SavedModelBundle.load(String, String...).SavedModelBundle object.IOException - If something goes wrong reading or unpacking the
archive.
Deprecated - use TensorFlowService.loadCachedModel(Location, String, String...) instead.public CachedModelBundle loadCachedModel(Location source, String modelName, String... tags) throws IOException
TensorFlowServiceloadCachedModel in interface TensorFlowServicesource - The location of the model, which must be structured as a ZIP
archive.modelName - The name of the model by which the source should be
unpacked and cached as needed.tags - Optional list of tags passed to
SavedModelBundle.load(String, String...).SavedModelBundle object
wrapped by a CachedModelBundle.IOException - If something goes wrong reading or unpacking the
archive.public org.tensorflow.Graph loadGraph(Location source, String modelName, String graphPath) throws IOException
TensorFlowServiceloadGraph in interface TensorFlowServicesource - The location of the graph, which must be structured as a ZIP
archive.modelName - The name of the model by which the source should be
unpacked and cached as needed.graphPath - The name of the .pb file inside the ZIP archive containing
the graph.Graph object.IOException - If something goes wrong reading or unpacking the
archive.public List<String> loadLabels(Location source, String modelName, String labelsPath) throws IOException
TensorFlowServiceloadLabels in interface TensorFlowServicesource - The location of the labels, which must be structured as a ZIP
archive.modelName - The name of the model by which the source should be
unpacked and cached as needed.labelsPath - The name of the .txt file inside the ZIP archive
containing the labels.Graph object.IOException - If something goes wrong reading or unpacking the
archive.public void loadLibrary()
loadLibrary in interface TensorFlowServicepublic TensorFlowVersion getTensorFlowVersion()
getTensorFlowVersion in interface TensorFlowServicenull if no version is loaded.public TensorFlowLibraryStatus getStatus()
getStatus in interface TensorFlowServicepublic File loadFile(Location source, String modelName, String filePath) throws IOException
TensorFlowServiceloadFile in interface TensorFlowServicesource - The location of the ZIP archive.modelName - The name of the model by which the source should be
unpacked and cached as needed.filePath - The name of the file inside the ZIP archive.File object.IOException - If something goes wrong reading or unpacking the
archive.public void dispose()
dispose in interface DisposableCopyright © 2014–2022 ImageJ. All rights reserved.