Skip to content
This repository was archived by the owner on May 5, 2023. It is now read-only.
Closed
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
2 changes: 1 addition & 1 deletion lib/services/cognitiveServicesFace/LICENSE.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License (MIT)

Copyright (c) 2018 Microsoft
Copyright (c) 2019 Microsoft

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
8 changes: 4 additions & 4 deletions lib/services/cognitiveServicesFace/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ 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 - FaceClient

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

Expand All @@ -19,7 +20,7 @@ npm install azure-cognitiveservices-face

### How to use

#### Authentication, client creation and list personGroupPerson as an example.
#### Authentication, client creation, and list personGroupPerson as an example.

```javascript
const msRest = require("ms-rest");
Expand All @@ -31,17 +32,16 @@ const client = new FaceClient(creds, subscriptionId);
const personGroupId = "testpersonGroupId";
const start = "teststart";
const top = 1;

client.personGroupPerson.list(personGroupId, start, top).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)


![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-node%2Flib%2Fservices%2FcognitiveServicesFace%2FREADME.png)
1 change: 1 addition & 0 deletions lib/services/cognitiveServicesFace/lib/faceClient.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ export default class FaceClient extends ServiceClient {
largePersonGroupPerson: operations.LargePersonGroupPerson;
largePersonGroupOperations: operations.LargePersonGroupOperations;
largeFaceListOperations: operations.LargeFaceListOperations;
snapshotOperations: operations.SnapshotOperations;
}

export { FaceClient, models as FaceModels };
1 change: 1 addition & 0 deletions lib/services/cognitiveServicesFace/lib/faceClient.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ class FaceClient extends ServiceClient {
this.largePersonGroupPerson = new operations.LargePersonGroupPerson(this);
this.largePersonGroupOperations = new operations.LargePersonGroupOperations(this);
this.largeFaceListOperations = new operations.LargeFaceListOperations(this);
this.snapshotOperations = new operations.SnapshotOperations(this);
this.models = models;
msRest.addSerializationMixin(this);
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
/*
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for
* license information.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is
* regenerated.
*/

'use strict';

/**
* Request body for applying snapshot operation.
*
*/
class ApplySnapshotRequest {
/**
* Create a ApplySnapshotRequest.
* @property {string} objectId User specified target object id to be created
* from the snapshot.
* @property {string} [mode] Snapshot applying mode. Currently only CreateNew
* is supported, which means the apply operation will fail if target
* subscription already contains an object of same type and using the same
* objectId. Users can specify the "objectId" in request body to avoid such
* conflicts. Possible values include: 'CreateNew'. Default value:
* 'CreateNew' .
*/
constructor() {
}

/**
* Defines the metadata of ApplySnapshotRequest
*
* @returns {object} metadata of ApplySnapshotRequest
*
*/
mapper() {
return {
required: false,
serializedName: 'ApplySnapshotRequest',
type: {
name: 'Composite',
className: 'ApplySnapshotRequest',
modelProperties: {
objectId: {
required: true,
serializedName: 'objectId',
constraints: {
MaxLength: 64,
Pattern: /^[a-z0-9-_]+$/
},
type: {
name: 'String'
}
},
mode: {
required: false,
nullable: false,
serializedName: 'mode',
defaultValue: 'CreateNew',
type: {
name: 'Enum',
allowedValues: [ 'CreateNew' ]
}
}
}
}
};
}
}

module.exports = ApplySnapshotRequest;
13 changes: 12 additions & 1 deletion lib/services/cognitiveServicesFace/lib/models/detectedFace.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ class DetectedFace {
/**
* Create a DetectedFace.
* @property {uuid} [faceId]
* @property {string} [recognitionModel] Possible values include:
* 'recognition_01', 'recognition_02'. Default value: 'recognition_01' .
* @property {object} faceRectangle
* @property {number} [faceRectangle.width] The width of the rectangle, in
* pixels.
Expand Down Expand Up @@ -166,7 +168,7 @@ class DetectedFace {
* @property {object} [faceAttributes]
* @property {number} [faceAttributes.age] Age in years
* @property {string} [faceAttributes.gender] Possible gender of the face.
* Possible values include: 'male', 'female', 'genderless'
* Possible values include: 'male', 'female'
* @property {number} [faceAttributes.smile] Smile intensity, a number
* between [0,1]
* @property {object} [faceAttributes.facialHair] Properties describing
Expand Down Expand Up @@ -265,6 +267,15 @@ class DetectedFace {
name: 'String'
}
},
recognitionModel: {
required: false,
nullable: false,
serializedName: 'recognitionModel',
defaultValue: 'recognition_01',
type: {
name: 'String'
}
},
faceRectangle: {
required: true,
serializedName: 'faceRectangle',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class FaceAttributes {
* Create a FaceAttributes.
* @property {number} [age] Age in years
* @property {string} [gender] Possible gender of the face. Possible values
* include: 'male', 'female', 'genderless'
* include: 'male', 'female'
* @property {number} [smile] Smile intensity, a number between [0,1]
* @property {object} [facialHair] Properties describing facial hair
* attributes.
Expand Down Expand Up @@ -117,7 +117,7 @@ class FaceAttributes {
serializedName: 'gender',
type: {
name: 'Enum',
allowedValues: [ 'male', 'female', 'genderless' ]
allowedValues: [ 'male', 'female' ]
}
},
smile: {
Expand Down
15 changes: 12 additions & 3 deletions lib/services/cognitiveServicesFace/lib/models/faceList.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ const models = require('./index');
/**
* Face list object.
*
* @extends models['NameAndUserDataContract']
* @extends models['MetaDataContract']
*/
class FaceList extends models['NameAndUserDataContract'] {
class FaceList extends models['MetaDataContract'] {
/**
* Create a FaceList.
* @property {string} faceListId FaceListId of the target face list.
Expand Down Expand Up @@ -61,12 +61,21 @@ class FaceList extends models['NameAndUserDataContract'] {
name: 'String'
}
},
recognitionModel: {
required: false,
nullable: false,
serializedName: 'recognitionModel',
defaultValue: 'recognition_01',
type: {
name: 'String'
}
},
faceListId: {
required: true,
serializedName: 'faceListId',
constraints: {
MaxLength: 64,
Pattern: '^[a-z0-9-_]+$'
Pattern: /^[a-z0-9-_]+$/
},
type: {
name: 'String'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class FindSimilarRequest {
* candidate face list, created in Face List - Create a Face List. Face list
* contains a set of persistedFaceIds which are persisted and will never
* expire. Parameter faceListId, largeFaceListId and faceIds should not be
* provided at the same time
* provided at the same time.
* @property {string} [largeFaceListId] An existing user-specified unique
* candidate large face list, created in LargeFaceList - Create. Large face
* list contains a set of persistedFaceIds which are persisted and will never
Expand Down Expand Up @@ -70,7 +70,7 @@ class FindSimilarRequest {
serializedName: 'faceListId',
constraints: {
MaxLength: 64,
Pattern: '^[a-z0-9-_]+$'
Pattern: /^[a-z0-9-_]+$/
},
type: {
name: 'String'
Expand All @@ -81,7 +81,7 @@ class FindSimilarRequest {
serializedName: 'largeFaceListId',
constraints: {
MaxLength: 64,
Pattern: '^[a-z0-9-_]+$'
Pattern: /^[a-z0-9-_]+$/
},
type: {
name: 'String'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ class IdentifyRequest {
serializedName: 'personGroupId',
constraints: {
MaxLength: 64,
Pattern: '^[a-z0-9-_]+$'
Pattern: /^[a-z0-9-_]+$/
},
type: {
name: 'String'
Expand All @@ -84,7 +84,7 @@ class IdentifyRequest {
serializedName: 'largePersonGroupId',
constraints: {
MaxLength: 64,
Pattern: '^[a-z0-9-_]+$'
Pattern: /^[a-z0-9-_]+$/
},
type: {
name: 'String'
Expand Down
Loading