express-sweet 1.0.20 → 1.0.21

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,6 +1,50 @@
1
1
  # Changelog
2
2
  All notable changes to this project will be documented in this file.
3
3
 
4
+ ## [1.0.21] - 2022-05-26
5
+ ### Fixed
6
+ - Added an option to the face indexing method to retrieve details (gender, emotion, age group) of indexed faces.
7
+ ```js
8
+ const sweet = require('../dist/build.common');
9
+
10
+ // Load environment variables.
11
+ sweet.middlewares.Environment.mount();
12
+
13
+ // Rekognition Client.
14
+ const client = new sweet.services.AWSRekognitionClient({
15
+ accessKeyId: process.env.AWS_REKOGNITION_ACCESS_KEY_ID,
16
+ secretAccessKey: process.env.AWS_REKOGNITION_SECRET_ACCESS_KEY,
17
+ region: process.env.AWS_REKOGNITION_REGION
18
+ });
19
+
20
+ // Collection ID for testing.
21
+ const collectionId = 'MyCollection';
22
+
23
+ // Create a face and get the ID of the created face.
24
+ // Output: e65d66cb-e7bc-4bbf-966c-b1b49ddf29f8
25
+ const faceId = await client.indexFace(collectionId, 'img/face4.jpg');
26
+ console.log(faceId);
27
+
28
+ // Create a face and get the details of the created face.
29
+ // Output: {
30
+ // faceId: '7f2dd321-f047-44ff-8856-864637e1d286',
31
+ // ageRange: { high: 29, low: 21 },
32
+ // gender: 'female',
33
+ // emotions: {
34
+ // angry: 77.1907958984375,
35
+ // surprised: 9.944050788879395,
36
+ // fear: 7.514361381530762,
37
+ // confused: 4.780297756195068,
38
+ // sad: 2.91914963722229,
39
+ // happy: 2.5718722343444824,
40
+ // disgusted: 1.933768391609192,
41
+ // calm: 1.5354809761047363
42
+ // }
43
+ // }
44
+ const faceDetails = await client.indexFace(collectionId, 'img/face5.jpg', {returnDetails: true});
45
+ console.log(faceDetails);
46
+ ```
47
+
4
48
  ## [1.0.20] - 2022-05-25
5
49
  ### Fixed
6
50
  - Added an option to get details (emotion, gender, age group) to the face detection method.
@@ -282,4 +326,5 @@ All notable changes to this project will be documented in this file.
282
326
  [1.0.17]: https://github.com/takuya-motoshima/express-sweet/compare/v1.0.16...v1.0.17
283
327
  [1.0.18]: https://github.com/takuya-motoshima/express-sweet/compare/v1.0.17...v1.0.18
284
328
  [1.0.19]: https://github.com/takuya-motoshima/express-sweet/compare/v1.0.18...v1.0.19
285
- [1.0.20]: https://github.com/takuya-motoshima/express-sweet/compare/v1.0.19...v1.0.20
329
+ [1.0.20]: https://github.com/takuya-motoshima/express-sweet/compare/v1.0.19...v1.0.20
330
+ [1.0.20]: https://github.com/takuya-motoshima/express-sweet/compare/v1.0.20...v1.0.21