pip install numpy opencv-python
注意:代码是基于python3开发
##启动服务
cd /path/to/face_detection/
# python3相关版本即可
python3.8 src/index.py
URL: localhost:8080
URI:/face_detection
method: GET
参数 | 解释 |
---|---|
image | 图片地址 |
参数 | 解释 |
---|---|
status | 0成功, -1`失败 |
data | 人脸在原始图片上的坐标位置 |
http://localhost:8080/face_detection?image=https://pic3.zhimg.com/v2-35306ff8000cc2ad945bb8c04b3a5e0e_1440w.jpg?source=172ae18b
{
"status": 0,
"data": [
[
53,
51,
403,
403
]
]
}
//请求:
http://localhost:8080/face_detection?image=http://localhost:8080/image/not_found.jpg
//返回:
{"status":-1,"data":"HTTP Error 404: Not Found"}