public interface TensorFlowService extends ImageJService
Modifier and Type | Method and Description |
---|---|
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.
|
initialize, registerEventHandlers
getIdentifier, log
context, getContext, setContext
compareTo, getPriority, setPriority
getInfo, setInfo
getLocation
getVersion
dispose
@Deprecated org.tensorflow.SavedModelBundle loadModel(Location source, String modelName, String... tags) throws IOException
source
- 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 loadCachedModel(Location, String, String...)
instead.CachedModelBundle loadCachedModel(Location source, String modelName, String... tags) throws IOException
source
- 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.org.tensorflow.Graph loadGraph(Location source, String modelName, String graphPath) throws IOException
source
- 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.List<String> loadLabels(Location source, String modelName, String labelsPath) throws IOException
source
- 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.void loadLibrary()
TensorFlowVersion getTensorFlowVersion()
null
if no version is loaded.TensorFlowLibraryStatus getStatus()
File loadFile(Location source, String modelName, String filePath) throws IOException
source
- 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.Copyright © 2014–2022 ImageJ. All rights reserved.