Manages remote models.
Before using a remote model, download it with RemoteModelManager.
This class is thread safe.
| Task<Void> | |
| Task<Void> |
download(RemoteModel
remoteModel, DownloadConditions
downloadConditions)
Initiates the download of
remoteModel if the download hasn't
begun.
|
| <T extends RemoteModel> Task<Set<T>> |
getDownloadedModels(Class<T>
modelType)
Returns the set of all currently downloaded models of the given
modelType.
|
| synchronized static RemoteModelManager |
getInstance()
Gets the
RemoteModelManager
instance.
|
| Task<Boolean> |
isModelDownloaded(RemoteModel
remoteModel)
Returns whether the given
remoteModel is currently downloaded.
|
Deletes the given remoteModel from disk. Does nothing if the model is
not downloaded.
Initiates the download of remoteModel if the download hasn't begun.
If the model's download is already in progress, the current download task will be returned.
If the model is already downloaded to the device, and there is no update, the task will immediately succeed.
If the model is already downloaded to the device, and there is update, a download for the updated version will be attempted.
If the model downloaded failed, the returned Task will
contain a MlKitException.
Downloads for each type of model may encounter different MlKitException.ErrorCodes.
Please check detailed documentation of each RemoteModel class for possible
MlKitException.ErrorCodes.
remoteModel downloadReturns the set of all currently downloaded models of the given
modelType.
Gets the RemoteModelManager
instance.
Returns whether the given remoteModel is currently downloaded.