口罩检测(20201130)
https://github.com/didi/maskdetection
team, the mask detection technology is based on DFS face detection algorithm and the face attributes recognition algorithm DiDi employs on its platform. The model has overcome several difficulties like complex lighting changes in a day, face pose variety, face scales, etc. It uses weighted loss function and data augmentation methods to deal with different mask types and uneven mask data during the day and the night.
The system can identify non-mask drivers using their uploaded images with 99.5 per cent accuracy, and achieves 98 per cent accuracy during DiDi’s spot inspection with in-vehicle cameras. The model was trained on a dataset of 200,000 faces to ensure its robustness.
This quick detection system can be widely used in travel scenes, with mobile phone photos, surveillance images etc., and is able to work round the clock.
Requirements
- google/protobuf
- openblas or atlas
- opencv
- cuda/cudnn(if GPU is used)
- Caffe
Installation
- Clone the repository. We'll call the directory that you cloned as MASK_ROOT.
git clone git@github.com:didi/maskdetection.git
- Build Caffe,see:http://caffe.berkeleyvision.org
Usage
In this part, we assume you are in the directory $MASK_ROOT/
- Install requirements (remember the install path to configure CMakeLists.txt)
- Configure CMakeLists.txt、 test/CMakeLists.txt、 lib/CMakeLists.txt
- Compile
mkdir build
cd build
cmake ..
make
- After compilation, executable files will be generated in directory: build/bin
- Detect the face bounding box, and then expand the bounding box to a certain proportion to get a detected face.
- Run executable files with the detected face to judge if the face is wearing mask.
Tips:
- The detected face bounding box is expanded to reduce the effect of detection errors.
- Each side of the original face bounding box is expanded by 40% for mask detection. The proportion may be adjusted to the actual scenario/context(e.g., reduced to fit the actual scene in case of a dense crowd).
Model
- Our model is pretrained by public ResNet50-caffemodel.
- Trained by our collected private data.
- Introduce attention mechanism.
License
maskdetection is licensed under the terms of the Apache license. See LICENSEfor more information.
Note
DiDi's mask-recognition service is designed to better protect users from public health risks. An attention-learning mechanism is built in the technology to focus on recognizing the existence of a mask while weakening the recognition of other face areas. The service is subject to various sources of error including brightness, posture or partial image capture. We will continue to improve on the accuracy of the technology. Thank you for your support.
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 开发者必知的日志记录最佳实践
· SQL Server 2025 AI相关能力初探
· Linux系列:如何用 C#调用 C方法造成内存泄露
· AI与.NET技术实操系列(二):开始使用ML.NET
· 记一次.NET内存居高不下排查解决与启示
· 阿里最新开源QwQ-32B,效果媲美deepseek-r1满血版,部署成本又又又降低了!
· 开源Multi-agent AI智能体框架aevatar.ai,欢迎大家贡献代码
· Manus重磅发布:全球首款通用AI代理技术深度解析与实战指南
· 被坑几百块钱后,我竟然真的恢复了删除的微信聊天记录!
· 没有Manus邀请码?试试免邀请码的MGX或者开源的OpenManus吧
2018-11-30 mnist lenet caffe 测试