Model class Stay organized with collections Save and categorize content based on your preferences.
A Firebase ML Model output object.
Signature:
exportdeclareclassModelProperties
| Property | Modifiers | Type | Description |
|---|---|---|---|
| createTime | string | The timestamp of the model's creation. | |
| displayName | string | The model's name. This is the name you use from your app to load the model. | |
| etag | string | The ETag identifier of the current version of the model. This value changes whenever you update any of the model's properties. | |
| locked | boolean | True if the model is locked by a server-side operation. You can't make changes to a locked model. SeeModel.waitForUnlocked(). | |
| modelHash | string | undefined | The hash of the model'stflite file. This value changes only when you upload a new TensorFlow Lite model. | |
| modelId | string | The ID of the model. | |
| published | boolean | True if the model is published. | |
| tags | string[] | The model's tags, which can be used to group or filter models in list operations. | |
| tfliteModel | TFLiteModel | undefined | Metadata about the model's TensorFlow Lite model file. | |
| updateTime | string | The timestamp of the model's most recent update. | |
| validationError | string | undefined | Error message when model validation fails. |
Methods
| Method | Modifiers | Description |
|---|---|---|
| toJSON() | Return the model as a JSON object. | |
| waitForUnlocked(maxTimeMillis) | Wait for the model to be unlocked. |
Model.createTime
The timestamp of the model's creation.
Signature:
getcreateTime():string;Model.displayName
The model's name. This is the name you use from your app to load the model.
Signature:
getdisplayName():string;Model.etag
The ETag identifier of the current version of the model. This value changes whenever you update any of the model's properties.
Signature:
getetag():string;Model.locked
True if the model is locked by a server-side operation. You can't make changes to a locked model. SeeModel.waitForUnlocked().
Signature:
getlocked():boolean;Model.modelHash
The hash of the model'stflite file. This value changes only when you upload a new TensorFlow Lite model.
Signature:
getmodelHash():string|undefined;Model.modelId
The ID of the model.
Signature:
getmodelId():string;Model.published
True if the model is published.
Signature:
getpublished():boolean;Model.tags
The model's tags, which can be used to group or filter models in list operations.
Signature:
gettags():string[];Model.tfliteModel
Metadata about the model's TensorFlow Lite model file.
Signature:
gettfliteModel():TFLiteModel|undefined;Model.updateTime
The timestamp of the model's most recent update.
Signature:
getupdateTime():string;Model.validationError
Error message when model validation fails.
Signature:
getvalidationError():string|undefined;Model.toJSON()
Return the model as a JSON object.
Signature:
toJSON():{[key:string]:any;};Returns:
{ [key: string]: any; }
Model.waitForUnlocked()
Wait for the model to be unlocked.
Signature:
waitForUnlocked(maxTimeMillis?:number):Promise<void>;Parameters
| Parameter | Type | Description |
|---|---|---|
| maxTimeMillis | number | The maximum time in milliseconds to wait. If not specified, a default maximum of 2 minutes is used. |
Returns:
Promise<void>
A promise that resolves when the model is unlocked or the maximum wait time has passed.
Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2022-07-29 UTC.