(url)
| 37 | * @return An instance of `tf.Model` with model topology and weights loaded. |
| 38 | */ |
| 39 | export async function loadHostedPretrainedModel(url) { |
| 40 | ui.status('Loading pretrained model from ' + url); |
| 41 | try { |
| 42 | const model = await tf.loadLayersModel(url); |
| 43 | ui.status('Done loading pretrained model.'); |
| 44 | return model; |
| 45 | } catch (err) { |
| 46 | console.error(err); |
| 47 | ui.status('Loading pretrained model failed.'); |
| 48 | } |
| 49 | } |
| 50 | |
| 51 | // The URL-like path that identifies the client-side location where downloaded |
| 52 | // or locally trained models can be stored. |
nothing calls this directly
no outgoing calls
no test coverage detected