Cloudservercloudzoo
CloudServerCloudZoo
This class is responsible for managing and loading models from a cloud-based AI model zoo, for inference in the cloud. It handles model discovery, fetching model information, and loading models for use. Use loadModel() to instantiate and configure a model for use. Various utility functions are available to interact with the cloud zoo.
Kind: global class
- CloudServerCloudZoo
- new CloudServerCloudZoo([zooUrl], accessToken, [dummy])
- .getModelLabels(modelName) ⇒
Promise.<Object>
- .downloadModel(modelName) ⇒
Promise.<Blob>
- .listModels() ⇒
Promise.<Object>
- .getZoos(organization) ⇒
Promise.<Object>
- .loadModel(modelName, [options]) ⇒
Promise.<CloudServerModel>
- .systemInfo() ⇒
Promise.<Object>
new CloudServerCloudZoo([zooUrl], accessToken, [dummy])
Do not call this constructor, instead use the connect
function of the dg_sdk class to create a CloudServerCloudZoo instance.
Param | Type | Default | Description |
---|---|---|---|
[zooUrl] | string |
"DEFAULT_CLOUD_URL" |
Expected format: "https:// |
accessToken | string |
The access token for the cloud zoo. | |
[dummy] | boolean |
false |
Dummy zoo instance - only for system info call |
Example (Usage:)
let zoo = dg.connect('cloud', 'https://cs.degirum.com/degirum/public', secretToken);
let model = await zoo.loadModel('someModel', { max_q_len: 5, callback: someFunction });
cloudServerCloudZoo.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
Kind: instance method of CloudServerCloudZoo
Returns: Promise.<Object>
- The model's label dictionary.
Param | Type | Description |
---|---|---|
modelName | string |
The name of the model. |
cloudServerCloudZoo.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
Kind: instance method of CloudServerCloudZoo
Returns: Promise.<Blob>
- The downloaded model as a Blob.
Param | Type | Description |
---|---|---|
modelName | string |
The name of the model to download. |
cloudServerCloudZoo.listModels() ⇒ Promise.<Object>
Lists all available models in the cloud zoo.
Kind: instance method of CloudServerCloudZoo
Returns: Promise.<Object>
- An object containing the available models and their params.
Example
cloudServerCloudZoo.getZoos(organization) ⇒ Promise.<Object>
Fetches the list of zoos for a given organization.
Kind: instance method of CloudServerCloudZoo
Returns: Promise.<Object>
- The list of zoos.
Param | Type | Description |
---|---|---|
organization | string |
The name of the organization. |
cloudServerCloudZoo.loadModel(modelName, [options]) ⇒ Promise.<CloudServerModel>
Loads a model from the cloud zoo and prepares it for inference.
Kind: instance method of CloudServerCloudZoo
Returns: Promise.<CloudServerModel>
- The loaded model instance.
Param | Type | Default | Description |
---|---|---|---|
modelName | string |
The name of the model to load. | |
[options] | Object |
{} |
Additional options for loading the model. |
[options.max_q_len] | number |
10 |
The maximum length of the internal inference queue. |
[options.callback] | function |
|
A callback function to handle inference results. |
Example
let model = await zoo.loadModel('someModel', { inputCropPercentage: 0.5, callback: someFunction } );
cloudServerCloudZoo.systemInfo() ⇒ Promise.<Object>
Fetches system information from the cloud server.
Kind: instance method of CloudServerCloudZoo
Returns: Promise.<Object>
- The system information.