express-sweet 1.0.19 → 1.0.20
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 +62 -1
- package/dist/build.common.js +2 -2
- package/dist/build.esm.js +3 -3
- package/docs/index.html +260 -52
- package/package.json +2 -2
- package/types/database/Model.d.ts +1 -1
- package/types/interfaces/BoundingBox.d.ts +1 -1
- package/types/interfaces/FaceDetailsEmotions.d.ts +40 -0
- package/types/services/AWSRekognitionClient.d.ts +9 -241
package/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,65 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
All notable changes to this project will be documented in this file.
|
|
3
3
|
|
|
4
|
+
## [1.0.20] - 2022-05-25
|
|
5
|
+
### Fixed
|
|
6
|
+
- Added an option to get details (emotion, gender, age group) to the face detection method.
|
|
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
|
+
(async () => {
|
|
21
|
+
// Detects bounding boxes on faces.
|
|
22
|
+
// Output: [
|
|
23
|
+
// {
|
|
24
|
+
// width: 0.3099822998046875,
|
|
25
|
+
// height: 0.661512017250061,
|
|
26
|
+
// left: 0.5449195504188538,
|
|
27
|
+
// top: 0.11531734466552734
|
|
28
|
+
// }
|
|
29
|
+
// ]
|
|
30
|
+
let res = await client.detectFaces('img/face.jpg');
|
|
31
|
+
console.log(res);
|
|
32
|
+
|
|
33
|
+
// Detect facial details.
|
|
34
|
+
// Output: [
|
|
35
|
+
// {
|
|
36
|
+
// boundingBox: {
|
|
37
|
+
// width: 0.3099822998046875,
|
|
38
|
+
// height: 0.661512017250061,
|
|
39
|
+
// left: 0.5449195504188538,
|
|
40
|
+
// top: 0.11531734466552734
|
|
41
|
+
// },
|
|
42
|
+
// ageRange: { high: 14, low: 6 },
|
|
43
|
+
// gender: 'female',
|
|
44
|
+
// emotions: {
|
|
45
|
+
// happy: 99.78905487060547,
|
|
46
|
+
// surprised: 6.306276321411133,
|
|
47
|
+
// fear: 5.880091190338135,
|
|
48
|
+
// sad: 2.152125835418701,
|
|
49
|
+
// confused: 0.023256277665495872,
|
|
50
|
+
// angry: 0.018351631239056587,
|
|
51
|
+
// calm: 0.015775982290506363,
|
|
52
|
+
// disgusted: 0.013914424926042557
|
|
53
|
+
// }
|
|
54
|
+
// }
|
|
55
|
+
// ]
|
|
56
|
+
const minConfidence = 90;
|
|
57
|
+
const withDetails = true;
|
|
58
|
+
res = await client.detectFaces('img/face.jpg', minConfidence, withDetails);
|
|
59
|
+
console.log(res);
|
|
60
|
+
})();
|
|
61
|
+
```
|
|
62
|
+
|
|
4
63
|
## [1.0.19] - 2022-05-20
|
|
5
64
|
### Fixed
|
|
6
65
|
- Add date format helper to view.
|
|
@@ -221,4 +280,6 @@ All notable changes to this project will be documented in this file.
|
|
|
221
280
|
[1.0.15]: https://github.com/takuya-motoshima/express-sweet/compare/v1.0.14...v1.0.15
|
|
222
281
|
[1.0.16]: https://github.com/takuya-motoshima/express-sweet/compare/v1.0.15...v1.0.16
|
|
223
282
|
[1.0.17]: https://github.com/takuya-motoshima/express-sweet/compare/v1.0.16...v1.0.17
|
|
224
|
-
[1.0.18]: https://github.com/takuya-motoshima/express-sweet/compare/v1.0.17...v1.0.18
|
|
283
|
+
[1.0.18]: https://github.com/takuya-motoshima/express-sweet/compare/v1.0.17...v1.0.18
|
|
284
|
+
[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
|