Opencv人脸追踪-----Github上代码复现

研究YOLO有些日子,有两个硬伤:

一、训练需要太多图片。手动去搞有些傻,人脸识别是如何一张照片就可以运作的?

二、YOLO在树莓上运行,最多三四帧,而且大大牺牲了识别的精度。

刷视频时看到跟踪速度非常快,又是简单硬件实现的案例:

256ab4b279214e419e7f53fde344423a.jpg

得到线索上Twwiter上继续扒。相对于YOLOv5的追踪效果,好了太多倍。说明在识别物体后,追踪不能再用YOLO,效率太低。

https://x.com/YaBoyFathoM/status/1725382399771414986?s=20

在下方回复里,作者贴出来了其将项目放到了Github地址如下:rizkydermawan1992 (Rizky Dermawan) · GitHub

网友回复摘录:

一、The real challenge of course is using a background where you don't stand out easily. Urban, or night, or other kinds of background diffusion. Also, distance to target. Following something that's 1 - 2 pixels.

二、Much better demo: put a laser pointer on it. Bonus points: ensure it avoids all eyeballs.作者回复:True. Actuators are cringe and the display accuracy definitely doesn't match the capability of that gimbal device thingy.

This won't stay true for long. Birds can fly through dense bushes at 20mph. hardware and software integration is unfathomably effective in the limit.

作者代码复现:人脸识别、人脸追踪

作者的代码清晰放在Github上。下载下来,安装好对应的依赖,不需要改动任何东西运行即可复现,难度很小。我这里用的是笔记本电脑+外置摄像头。

仅在安装dediaipe时有小插曲,也很容易搜索原因修复,如下。

#出错:ERROR: Could not install packages due to an OSError: [WinError 5] 拒绝访问。: #'C:\\ProgramData\\Anaconda3\\envs\\laser_mosquito\\Lib\\site-packages\\cv2\\cv2.pyd'
pip install mediapipe -i https://pypi.tuna.tsinghua.edu.cn/simple/ 

#修改(加入--user)后运行正确
pip install --user  mediapipe -i https://pypi.tuna.tsinghua.edu.cn/simple/

一、facedetection.py

二、facetracking.py

先需要稍稍把代码里涉及到硬件com口和伺服电机控制的的16~19行,22行,32~46行,64~68行注释掉,然后在运行。就可以实现原作者视频里的tracking效果了。真人人脸和照片都能识别。

facedetection vs facetracking两者对比:

facedetection.pyfacetracking.py
识别速度极快极快
识别距离3m及以上1.5m以内
识别框矩形绿色框红色瞄准星
识别范围真实人脸真实人脸&手机人脸图片
其他可同时识别两个以上人脸有locked,对目标人脸进行锁定

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值