Skip to content

Commit a685389

Browse files
Merge pull request #359 from Leoqh96/master
update facedetect readme & dependencies
2 parents 257e030 + 481fca7 commit a685389

File tree

4 files changed

+29
-7
lines changed

4 files changed

+29
-7
lines changed

packages/paddlejs-models/facedetect/README.md

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,18 @@ await faceDetector.init();
1616
// Result is face area information. It includes left, top, width, height, confidence
1717
const res = await faceDetector.detect(
1818
imgEle,
19-
{ shrink: 0.4, threshold: 0.6}
19+
{ shrink: 0.4, threshold: 0.6 }
2020
);
2121
```
2222

23+
# Run Demo
24+
1. Execute in the current directory
25+
``` bash
26+
npm install
27+
npm run dev
28+
```
29+
2. Visit http://0.0.0.0:8867
30+
2331
# Performance
2432
+ **multi small-sized face**
2533
<img width="500" src="https://mms-voice-fe.cdn.bcebos.com/pdmodel/face/detection/pic/small.png"/>
@@ -30,4 +38,7 @@ const res = await faceDetector.detect(
3038
# Postprocess
3139
This model has a better recognition effect for small-sized faces, and the image will be shrink before prediction, so it is necessary to transform the prediction output data.
3240
<img width="500" src="https://mms-voice-fe.cdn.bcebos.com/pdmodel/face/detection/pic/example.png"/>
33-
The red line indicates the predicted output result, and the green line indicates the converted result. dx dy fw fh are known parameters.
41+
The red line indicates the predicted output result, and the green line indicates the converted result. dx dy fw fh are known parameters.
42+
43+
# Reference
44+
[original model link](https://github.com/PaddlePaddle/PaddleHub/tree/release/v2.2/modules/image/face_detection/pyramidbox_lite_mobile)

packages/paddlejs-models/facedetect/README_cn.md

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,18 @@ await faceDetector.init();
1515
// 结果为人脸区域信息,包括:左侧 left,上部 top,区域宽 width,区域高 height,置信度 confidence
1616
const res = await faceDetector.detect(
1717
imgEle,
18-
{ shrink: 0.4, threshold: 0.6}
18+
{ shrink: 0.4, threshold: 0.6 }
1919
);
2020
```
2121

22+
# 运行 Demo
23+
1. 在当前目录下执行
24+
``` bash
25+
npm install
26+
npm run dev
27+
```
28+
2. 浏览器访问 http://0.0.0.0:8867
29+
2230
# 效果
2331
+ **多个小尺寸人脸**
2432
<img width="500" src="https://mms-voice-fe.cdn.bcebos.com/pdmodel/face/detection/pic/small.png"/>
@@ -29,4 +37,7 @@ const res = await faceDetector.detect(
2937
# 数据后处理
3038
此人脸检测模型对小尺寸人脸具有更好的识别效果,图像在预测前会进行缩小,因此需要对预测输出数据进行变换,及为**数据后处理过程**。示意如下:
3139
<img width="500" src="https://mms-voice-fe.cdn.bcebos.com/pdmodel/face/detection/pic/example.png"/>
32-
红线标识的是预测输出结果,绿线标识的是经过转换后的结果,二者变换过程所涉及到的 dx dy fw fh均为已知量。
40+
红线标识的是预测输出结果,绿线标识的是经过转换后的结果,二者变换过程所涉及到的 dx dy fw fh均为已知量。
41+
42+
# 参考
43+
[源模型链接](https://github.com/PaddlePaddle/PaddleHub/tree/release/v2.2/modules/image/face_detection/pyramidbox_lite_mobile)

packages/paddlejs-models/facedetect/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@
1010
"author": "",
1111
"license": "ISC",
1212
"dependencies": {
13-
"@paddlejs/paddlejs-backend-webgl": "^1.1.11",
14-
"@paddlejs/paddlejs-core": "^2.1.11"
13+
"@paddlejs/paddlejs-backend-webgl": "^1.1.15",
14+
"@paddlejs/paddlejs-core": "^2.1.14"
1515
},
1616
"devDependencies": {
1717
"html-webpack-plugin": "^3.2.0",

packages/paddlejs-models/facedetect/src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ const defaultFeedShape: FeedShape = {
3030
fh: 1024
3131
};
3232
const defaultModelConfig: ModelConfig = {
33-
modelPath: 'https://paddlejs.cdn.bcebos.com/models/face_detect',
33+
modelPath: 'https://paddlejs.cdn.bcebos.com/models/fuse/facedetect',
3434
mean: [0.407843137, 0.458823529, 0.482352941],
3535
std: [0.5, 0.5, 0.5]
3636
};

0 commit comments

Comments
 (0)