Skip to content
This repository was archived by the owner on May 5, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 44 additions & 0 deletions lib/services/customVision/training/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
---
uid: azure-cognitiveservices-customvision-training
summary: *content

---
**This SDK will be deprecated next year and will be replaced by a new TypeScript-based isomorphic SDK (found at https://github.com/Azure/azure-sdk-for-js) which works on Node.js and browsers.**
## Microsoft Azure SDK for Node.js - TrainingAPIClient

This project provides a Node.js package for accessing Azure. Right now it supports:
- **Node.js version 6.x.x or higher**

### Features


### How to Install

```bash
npm install azure-cognitiveservices-customvision-training
```

### How to use

#### Authentication, client creation, and getDomains as an example.

```javascript
const msRest = require("ms-rest");
const TrainingAPIClient = require("azure-cognitiveservices-customvision-training");
const token = "<access_token>";
const creds = new msRest.TokenCredentials(token);
const subscriptionId = "<Subscription_Id>";
const client = new TrainingAPIClient(creds, subscriptionId);

client.getDomains().then((result) => {
console.log("The result is:");
console.log(result);
}).catch((err) => {
console.log('An error occurred:');
console.dir(err, {depth: null, colors: true});
});
```

### Related projects

- [Microsoft Azure SDK for Node.js](https://github.com/Azure/azure-sdk-for-node)
12 changes: 8 additions & 4 deletions lib/services/customVision/training/lib/models/boundingBox.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@
class BoundingBox {
/**
* Create a BoundingBox.
* @member {number} [left]
* @member {number} [top]
* @member {number} [width]
* @member {number} [height]
* @property {number} [left]
* @property {number} [top]
* @property {number} [width]
* @property {number} [height]
*/
constructor() {
}
Expand All @@ -40,27 +40,31 @@ class BoundingBox {
modelProperties: {
left: {
required: false,
nullable: false,
serializedName: 'left',
type: {
name: 'Number'
}
},
top: {
required: false,
nullable: false,
serializedName: 'top',
type: {
name: 'Number'
}
},
width: {
required: false,
nullable: false,
serializedName: 'width',
type: {
name: 'Number'
}
},
height: {
required: false,
nullable: false,
serializedName: 'height',
type: {
name: 'Number'
Expand Down
15 changes: 10 additions & 5 deletions lib/services/customVision/training/lib/models/domain.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@
class Domain {
/**
* Create a Domain.
* @member {uuid} [id]
* @member {string} [name]
* @member {string} [type] Possible values include: 'Classification',
* @property {uuid} [id]
* @property {string} [name]
* @property {string} [type] Possible values include: 'Classification',
* 'ObjectDetection'
* @member {boolean} [exportable]
* @member {boolean} [enabled]
* @property {boolean} [exportable]
* @property {boolean} [enabled]
*/
constructor() {
}
Expand All @@ -42,6 +42,7 @@ class Domain {
modelProperties: {
id: {
required: false,
nullable: false,
readOnly: true,
serializedName: 'id',
type: {
Expand All @@ -50,6 +51,7 @@ class Domain {
},
name: {
required: false,
nullable: true,
readOnly: true,
serializedName: 'name',
type: {
Expand All @@ -58,6 +60,7 @@ class Domain {
},
type: {
required: false,
nullable: false,
readOnly: true,
serializedName: 'type',
type: {
Expand All @@ -66,6 +69,7 @@ class Domain {
},
exportable: {
required: false,
nullable: false,
readOnly: true,
serializedName: 'exportable',
type: {
Expand All @@ -74,6 +78,7 @@ class Domain {
},
enabled: {
required: false,
nullable: false,
readOnly: true,
serializedName: 'enabled',
type: {
Expand Down
22 changes: 15 additions & 7 deletions lib/services/customVision/training/lib/models/exportModel.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,16 @@
class ExportModel {
/**
* Create a ExportModel.
* @member {string} [platform] Possible values include: 'CoreML',
* 'TensorFlow', 'DockerFile', 'ONNX'
* @member {string} [status] Possible values include: 'Exporting', 'Failed',
* 'Done'
* @member {string} [downloadUri]
* @member {string} [flavor] Possible values include: 'Linux', 'Windows'
* @member {boolean} [newerVersionAvailable]
* @property {string} [platform] Platform of the export. Possible values
* include: 'CoreML', 'TensorFlow', 'DockerFile', 'ONNX'
* @property {string} [status] Status of the export. Possible values include:
* 'Exporting', 'Failed', 'Done'
* @property {string} [downloadUri] URI used to download the model.
* @property {string} [flavor] Flavor of the export. Possible values include:
* 'Linux', 'Windows', 'ONNX10', 'ONNX12'
* @property {boolean} [newerVersionAvailable] Indicates an updated version
* of the export package is available and should be re-exported for the
* latest changes.
*/
constructor() {
}
Expand All @@ -43,6 +46,7 @@ class ExportModel {
modelProperties: {
platform: {
required: false,
nullable: false,
readOnly: true,
serializedName: 'platform',
type: {
Expand All @@ -51,6 +55,7 @@ class ExportModel {
},
status: {
required: false,
nullable: false,
readOnly: true,
serializedName: 'status',
type: {
Expand All @@ -59,6 +64,7 @@ class ExportModel {
},
downloadUri: {
required: false,
nullable: true,
readOnly: true,
serializedName: 'downloadUri',
type: {
Expand All @@ -67,6 +73,7 @@ class ExportModel {
},
flavor: {
required: false,
nullable: true,
readOnly: true,
serializedName: 'flavor',
type: {
Expand All @@ -75,6 +82,7 @@ class ExportModel {
},
newerVersionAvailable: {
required: false,
nullable: false,
readOnly: true,
serializedName: 'newerVersionAvailable',
type: {
Expand Down
45 changes: 32 additions & 13 deletions lib/services/customVision/training/lib/models/image.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,23 +10,25 @@

'use strict';

const models = require('./index');

/**
* Image model to be sent as JSON
* Image model to be sent as JSON.
*
*/
class Image {
/**
* Create a Image.
* @member {uuid} [id]
* @member {date} [created]
* @member {number} [width]
* @member {number} [height]
* @member {string} [imageUri]
* @member {string} [thumbnailUri]
* @member {array} [tags]
* @member {array} [regions]
* @property {uuid} [id] Id of the image.
* @property {date} [created] Date the image was created.
* @property {number} [width] Width of the image.
* @property {number} [height] Height of the image.
* @property {string} [resizedImageUri] The URI to the (resized) image used
* for training.
* @property {string} [thumbnailUri] The URI to the thumbnail of the original
* image.
* @property {string} [originalImageUri] The URI to the original uploaded
* image.
* @property {array} [tags] Tags associated with this image.
* @property {array} [regions] Regions associated with this image.
*/
constructor() {
}
Expand All @@ -47,6 +49,7 @@ class Image {
modelProperties: {
id: {
required: false,
nullable: false,
readOnly: true,
serializedName: 'id',
type: {
Expand All @@ -55,6 +58,7 @@ class Image {
},
created: {
required: false,
nullable: false,
readOnly: true,
serializedName: 'created',
type: {
Expand All @@ -63,6 +67,7 @@ class Image {
},
width: {
required: false,
nullable: false,
readOnly: true,
serializedName: 'width',
type: {
Expand All @@ -71,30 +76,43 @@ class Image {
},
height: {
required: false,
nullable: false,
readOnly: true,
serializedName: 'height',
type: {
name: 'Number'
}
},
imageUri: {
resizedImageUri: {
required: false,
nullable: true,
readOnly: true,
serializedName: 'imageUri',
serializedName: 'resizedImageUri',
type: {
name: 'String'
}
},
thumbnailUri: {
required: false,
nullable: true,
readOnly: true,
serializedName: 'thumbnailUri',
type: {
name: 'String'
}
},
originalImageUri: {
required: false,
nullable: true,
readOnly: true,
serializedName: 'originalImageUri',
type: {
name: 'String'
}
},
tags: {
required: false,
nullable: true,
readOnly: true,
serializedName: 'tags',
type: {
Expand All @@ -111,6 +129,7 @@ class Image {
},
regions: {
required: false,
nullable: true,
readOnly: true,
serializedName: 'regions',
type: {
Expand Down
37 changes: 21 additions & 16 deletions lib/services/customVision/training/lib/models/imageCreateResult.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,28 +10,31 @@

'use strict';

const models = require('./index');

/**
* Class representing a ImageCreateResult.
*/
class ImageCreateResult {
/**
* Create a ImageCreateResult.
* @member {string} [sourceUrl]
* @member {string} [status] Possible values include: 'OK', 'OKDuplicate',
* 'ErrorSource', 'ErrorImageFormat', 'ErrorImageSize', 'ErrorStorage',
* 'ErrorLimitExceed', 'ErrorTagLimitExceed', 'ErrorRegionLimitExceed',
* 'ErrorUnknown'
* @member {object} [image]
* @member {uuid} [image.id]
* @member {date} [image.created]
* @member {number} [image.width]
* @member {number} [image.height]
* @member {string} [image.imageUri]
* @member {string} [image.thumbnailUri]
* @member {array} [image.tags]
* @member {array} [image.regions]
* @property {string} [sourceUrl] Source URL of the image.
* @property {string} [status] Status of the image creation. Possible values
* include: 'OK', 'OKDuplicate', 'ErrorSource', 'ErrorImageFormat',
* 'ErrorImageSize', 'ErrorStorage', 'ErrorLimitExceed',
* 'ErrorTagLimitExceed', 'ErrorRegionLimitExceed', 'ErrorUnknown',
* 'ErrorNegativeAndRegularTagOnSameImage'
* @property {object} [image] The image.
* @property {uuid} [image.id] Id of the image.
* @property {date} [image.created] Date the image was created.
* @property {number} [image.width] Width of the image.
* @property {number} [image.height] Height of the image.
* @property {string} [image.resizedImageUri] The URI to the (resized) image
* used for training.
* @property {string} [image.thumbnailUri] The URI to the thumbnail of the
* original image.
* @property {string} [image.originalImageUri] The URI to the original
* uploaded image.
* @property {array} [image.tags] Tags associated with this image.
* @property {array} [image.regions] Regions associated with this image.
*/
constructor() {
}
Expand All @@ -52,6 +55,7 @@ class ImageCreateResult {
modelProperties: {
sourceUrl: {
required: false,
nullable: true,
readOnly: true,
serializedName: 'sourceUrl',
type: {
Expand All @@ -60,6 +64,7 @@ class ImageCreateResult {
},
status: {
required: false,
nullable: false,
readOnly: true,
serializedName: 'status',
type: {
Expand Down
Loading