Constructor
new CloudServerCloudZoo(zooUrlopt, accessToken, dummyopt)
Do not call this constructor, instead use the `connect` function of the dg_sdk class to create a CloudServerCloudZoo instance.
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
zooUrl |
string |
<optional> |
DEFAULT_CLOUD_URL | Expected format: "https:// |
accessToken |
string | The access token for the cloud zoo. | ||
dummy |
boolean |
<optional> |
false | Dummy zoo instance - only for system info call |
- Source:
Example
let zoo = dg.connect('cloud', 'https://cs.degirum.com/degirum/public', secretToken);
let model = await zoo.loadModel('someModel', { max_q_len: 5, callback: someFunction });
Methods
(async) downloadModel(modelName) → {Promise.<Blob>}
Downloads a model from the cloud zoo.
fetches from https://cs.degirum.com/zoo/v1/public/models/degirum/public/example_model
Parameters:
Name | Type | Description |
---|---|---|
modelName |
string | The name of the model to download. |
- Source:
Returns:
The downloaded model as a Blob.
- Type
- Promise.<Blob>
(async) getModelLabels(modelName) → {Promise.<Object>}
Fetches the labels for a specific model from the cloud zoo.
queries https://cs.degirum.com/zoo/v1/public/models/degirum/public/example_model/dictionary
Parameters:
Name | Type | Description |
---|---|---|
modelName |
string | The name of the model. |
- Source:
Returns:
The model's label dictionary.
- Type
- Promise.<Object>
(async) getZoos(organization) → {Promise.<Object>}
Fetches the list of zoos for a given organization.
Parameters:
Name | Type | Description |
---|---|---|
organization |
string | The name of the organization. |
- Source:
Returns:
The list of zoos.
- Type
- Promise.<Object>
(async) listModels() → {Promise.<Object>}
Lists all available models in the cloud zoo.
- Source:
Returns:
An object containing the available models and their params.
- Type
- Promise.<Object>
Example
let models = await zoo.listModels();
let modelNames = Object.keys(models);
(async) loadModel(modelName, optionsopt) → {Promise.<CloudServerModel>}
Loads a model from the cloud zoo and prepares it for inference.
Parameters:
Name | Type | Attributes | Default | Description | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
modelName |
string | The name of the model to load. | |||||||||||||||||
options |
Object |
<optional> |
{} | Additional options for loading the model.
Properties
|
- Source:
Returns:
The loaded model instance.
- Type
- Promise.<CloudServerModel>
Example
let model = await zoo.loadModel('someModel', { inputCropPercentage: 0.5, callback: someFunction } );
(async) systemInfo() → {Promise.<Object>}
Fetches system information from the cloud server.
- Source:
Returns:
The system information.
- Type
- Promise.<Object>