mirror of
https://github.com/PaddlePaddle/FastDeploy.git
synced 2025-10-06 00:57:33 +08:00
[Doc] add readme for js packages (#421)
* add contributor * add package readme * refine ocr readme * refine ocr readme
This commit is contained in:
@@ -0,0 +1,38 @@
|
||||
[中文版](./README_cn.md)
|
||||
|
||||
# Facedetect
|
||||
|
||||
Facedetect is used for face detection in image. It provides a simple interface. At the same time, you can use your own model.
|
||||
|
||||
<img src="https://img.shields.io/npm/v/@paddle-js-models/facedetect?color=success" alt="version"> <img src="https://img.shields.io/bundlephobia/min/@paddle-js-models/facedetect" alt="size"> <img src="https://img.shields.io/npm/dm/@paddle-js-models/facedetect?color=orange" alt="downloads"> <img src="https://img.shields.io/npm/dt/@paddle-js-models/facedetect" alt="downloads">
|
||||
|
||||
# Usage
|
||||
|
||||
```js
|
||||
import { FaceDetector } from '@paddle-js-models/facedetect';
|
||||
|
||||
const faceDetector = new FaceDetector();
|
||||
await faceDetector.init();
|
||||
// Required parameter:imgEle(HTMLImageElement)
|
||||
// Optional parameter: shrink, threshold
|
||||
// Result is face area information. It includes left, top, width, height, confidence
|
||||
const res = await faceDetector.detect(
|
||||
imgEle,
|
||||
{ shrink: 0.4, threshold: 0.6 }
|
||||
);
|
||||
```
|
||||
|
||||
# Performance
|
||||
+ **multi small-sized face**
|
||||
<img width="500" src="https://mms-voice-fe.cdn.bcebos.com/pdmodel/face/detection/pic/small.png"/>
|
||||
|
||||
+ **single big-sized face**
|
||||
<img width="500" src="https://mms-voice-fe.cdn.bcebos.com/pdmodel/face/detection/pic/big.png"/>
|
||||
|
||||
# Postprocess
|
||||
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.
|
||||
<img width="500" src="https://mms-voice-fe.cdn.bcebos.com/pdmodel/face/detection/pic/example.png"/>
|
||||
The red line indicates the predicted output result, and the green line indicates the converted result. dx dy fw fh are known parameters.
|
||||
|
||||
# Reference
|
||||
[original model link](https://github.com/PaddlePaddle/PaddleHub/tree/release/v2.2/modules/image/face_detection/pyramidbox_lite_mobile)
|
@@ -0,0 +1,37 @@
|
||||
[English](./README.md)
|
||||
|
||||
# Facedetect
|
||||
|
||||
Facedetect 实现图像中的人脸检测,提供的接口简单,支持用户传入模型。
|
||||
|
||||
<img src="https://img.shields.io/npm/v/@paddle-js-models/facedetect?color=success" alt="version"> <img src="https://img.shields.io/bundlephobia/min/@paddle-js-models/facedetect" alt="size"> <img src="https://img.shields.io/npm/dm/@paddle-js-models/facedetect?color=orange" alt="downloads"> <img src="https://img.shields.io/npm/dt/@paddle-js-models/facedetect" alt="downloads">
|
||||
|
||||
# 使用
|
||||
|
||||
```js
|
||||
import { FaceDetector } from '@paddle-js-models/facedetect';
|
||||
|
||||
const faceDetector = new FaceDetector();
|
||||
await faceDetector.init();
|
||||
// 使用时必传图像元素(HTMLImageElement),支持指定图片缩小比例(shrink)、置信阈值(threshold)
|
||||
// 结果为人脸区域信息,包括:左侧 left,上部 top,区域宽 width,区域高 height,置信度 confidence
|
||||
const res = await faceDetector.detect(
|
||||
imgEle,
|
||||
{ shrink: 0.4, threshold: 0.6 }
|
||||
);
|
||||
```
|
||||
|
||||
# 效果
|
||||
+ **多个小尺寸人脸**
|
||||
<img width="500" src="https://mms-voice-fe.cdn.bcebos.com/pdmodel/face/detection/pic/small.png"/>
|
||||
|
||||
+ **单个大尺寸人脸**
|
||||
<img width="500" src="https://mms-voice-fe.cdn.bcebos.com/pdmodel/face/detection/pic/big.png"/>
|
||||
|
||||
# 数据后处理
|
||||
此人脸检测模型对小尺寸人脸具有更好的识别效果,图像在预测前会进行缩小,因此需要对预测输出数据进行变换,及为**数据后处理过程**。示意如下:
|
||||
<img width="500" src="https://mms-voice-fe.cdn.bcebos.com/pdmodel/face/detection/pic/example.png"/>
|
||||
红线标识的是预测输出结果,绿线标识的是经过转换后的结果,二者变换过程所涉及到的 dx dy fw fh均为已知量。
|
||||
|
||||
# 参考
|
||||
[源模型链接](https://github.com/PaddlePaddle/PaddleHub/tree/release/v2.2/modules/image/face_detection/pyramidbox_lite_mobile)
|
Reference in New Issue
Block a user