Face_Identify

0 downloads 0 likes on ModelScope updated

Model card

人脸检测 Face Detection

创空间访问链接:https://www.modelscope.cn/studios/rwcjz615/Face_Identify

本项目使用 OpenCV YuNet 深度学习模型完成人脸检测,使用 Gradio 构建可交互 Web 页面。用户上传图片或调用摄像头后,系统会输出带检测框的图片,并返回人脸数量、坐标及置信度 JSON。默认过滤置信度低于 0.85 的结果,减少背景物体误检。

功能

  • 图片上传与摄像头输入
  • 正面人脸检测
  • 检测框可视化
  • 返回人脸数量和 bounding box 坐标
  • 支持在 ModelScope 创空间一键运行

本地运行

pip install -r requirements.txt
python app.py

启动后访问终端输出的本地地址,上传 examples/astronaut.png 或自己的图片即可测试。

关键代码

detector = cv2.FaceDetectorYN.create(
    "models/face_detection_yunet_2023mar.onnx", "", (width, height),
    confidence_threshold, 0.3, 5000
)
_, detections = detector.detect(bgr_image)

完整搭建步骤见 创空间搭建步骤说明.md。