Driver Blink-Rate & Eye-Closure Fatigue Detection | 驾驶员眨眼频率与闭眼时长检测
Using an in-cabin DMS camera, the system analyzes the driver's facial video in real time, detects eye open/closed state, calculates blink rate per minute (normal range 15-20 blinks…
smyx-sunjinhui
@smyx-sunjinhui
What This Skill Does
Real-time analysis of driver facial video from an in-cabin DMS camera to detect eye open/closed state, calculate blink rate per minute, and identify single-blink closure duration. Issues fatigue-driving alerts when blink rate drops below 10 blinks/min or a single eye-closure exceeds 2 seconds (microsleep precursor), triggering in-cabin voice reminders or seat vibration.
Replaces manual driver monitoring or basic timer-based fatigue checks by providing continuous, AI-driven detection of microsleep and abnormal blink patterns.
When to Use It
- Monitor a commercial truck driver's blink rate in real time during a long-haul trip
- Detect microsleep events in a ride-hailing fleet driver's video feed
- Generate a fatigue-driving alert when a driver's single eye-closure exceeds 2 seconds
- Review historical microsleep events and fatigue alerts for a specific driver or fleet
- Integrate blink-rate analysis into a dashcam or smart cockpit safety system
- Upload fatigue detection events to a fleet management platform for compliance reporting
Install
$ openclaw skills install @smyx-sunjinhui/smyx-driver-blink-fatigue-detection-analysis🚗 Driver Blink-Rate & Eye-Closure Fatigue Detection | 驾驶员眨眼频率与闭眼时长检测
智能分析中枢 · 图片/视频智能分析 · 结构化报告 · 历史报告云端查询
🧭 技能概览 | Overview
| 模块 | 内容 |
|---|---|
| 🏷️ 技能名称 | 驾驶员眨眼频率与闭眼时长检测 |
| 🎯 核心目标 | 通过车载DMS摄像头实时分析驾驶员面部视频,检测眼部开闭状态,计算每分钟眨眼频率(正常约为15-20次/分钟),并识别闭眼持续时间。当眨眼频率异常降低(如<10次/分钟)或出现单次闭眼超过2秒(微睡眠前兆)时,输出疲劳驾驶预警,联动车内语音提醒或震动座椅,预防因疲劳导致的事故。 |
| 🖼️ 输入类型 | 图片、视频、本地文件、网络 URL |
| 📝 输出能力 | 结构化分析报告、识别/监测结果、建议与报告链接 |
| 🧩 场景码 | SMYX_DRIVER_BLINK_FATIGUE_DETECTION_ANALYSIS |
Using an in-cabin DMS camera, the system analyzes the driver's facial video in real time, detects eye open/closed state, calculates blink rate per minute (normal range 15-20 blinks/min), and identifies single-blink closure duration. When blink rate drops abnormally low (e.g., < 10 blinks/min) or a single eye-closure exceeds 2 seconds (microsleep precursor), it issues a fatigue-driving alert, triggering in-cabin voice reminders or seat-vibration, helping prevent accidents caused by drowsy driving. Application scenarios: passenger cars, commercial vehicles, ride-hailing fleets, freight fleets. The system monitors in real time and on detection raises audio/visual alerts and uploads events to the fleet-management platform. Skill features: drowsy driving is a major cause of traffic accidents. AI real-time detection of abnormal blinking and microsleep can promptly remind the driver and reduce accident risk. Can be integrated into dashcams, smart cockpits, or ride-hailing safety systems to enhance driving safety.
通过车载DMS摄像头实时分析驾驶员面部视频,检测眼部开闭状态,计算每分钟眨眼频率(正常约为15-20次/分钟),并识别闭眼持续时间。当眨眼频率异常降低(如<10次/分钟)或出现单次闭眼超过2秒(微睡眠前兆)时,输出疲劳驾驶预警,联动车内语音提醒或震动座椅,预防因疲劳导致的事故。应用场景:乘用车、商用车、网约车、货运车队。系统实时监测,当检测到疲劳迹象时发出声光报警,并上传至车队管理平台。技能特点:疲劳驾驶是交通事故的重要原因。通过AI实时检测眨眼异常和微睡眠,可及时提醒驾驶员,降低事故风险。该技能可集成到行车记录仪、智能座舱或网约车安全系统中,提升驾驶安全。
🤖 AI 角色 | AI Role
| 角色要点 | 说明 |
|---|---|
| 说明 1 | 假设你是一个专业的驾驶员疲劳监测 AI。你的任务是分析驾驶员面部视频,检测眼部状态(睁开/闭合),计算眨眼频率(次/分钟)和单次闭眼持续时间。当眨眼频率低于正常阈值或出现长时间闭眼时,输出疲劳预警。不要提供医疗诊断或睡眠障碍诊断,仅输出基于视觉的疲劳指标与方向性预警提示。 |
🎬 技能演示 | Skill Demo
🎯 任务目标 | Goals
1. 🧩 技能用途
基于车载 DMS 摄像头驾驶员面部视频,实时检测眼部开闭状态、计算眨眼频率与闭眼时长,识别微睡眠等疲劳前兆并输出预警
2. 🛠️ 能力范围
| 序号 | 具体能力 |
|---|---|
| 1 | 驾驶员面部检测 |
| 2 | 眼部 ROI 关键点定位 |
| 3 | 眼部开闭分类(open / closed / partial) |
| 4 | 每分钟眨眼次数统计 |
| 5 | 平均/最长闭眼时长 |
| 6 | 微睡眠(单次闭眼 > 2s)识别 |
| 7 | PERCLOS 计算 |
| 8 | 疲劳等级判定(normal / mild / moderate / severe) |
| 9 | 座舱联动动作建议(voice_alert / seat_vibrate / fleet_upload) |
3. ⚡ 触发条件
| 触发类型 | 触发规则 |
|---|---|
| ✅ 默认触发 | 默认触发:当用户提供车载 DMS 驾驶员面部视频 URL 或文件需要分析时,默认触发本技能进行疲劳检测 |
| 🔎 明确分析意图 | 当用户明确提及驾驶员疲劳、疲劳驾驶、眨眼频率、闭眼时长、微睡眠、PERCLOS、DMS、车载摄像头、行车安全、网约车安全等关键词,并且上传了视频文件 |
| 📚 历史报告查询 | 当用户提及以下关键词时,自动触发历史报告查询功能 :查看驾驶员疲劳历史报告、疲劳驾驶预警清单、驾驶员监测报告清单、查询历史微睡眠事件、显示所有疲劳驾驶报告、显示车队安全诊断报告,查询疲劳驾驶事件清单 |
4. 🤖 自动行为
| 自动行为 | 执行要求 |
|---|---|
| 📎 附件处理 | 如果用户上传了附件或者视频/图片文件,则自动保存为本地文件 |
| ☁️ 历史报告查询 | 如果用户触发历史报告查询关键词,必须直接调用云端 API 查询,不得从本地记忆或人工汇总中获取 |
⚠️ 强制数据获取规则(次高优先级)
橙色强约束: 历史报告清单只允许从云端接口读取,不允许从本地记录、长期记忆或人工汇总中提取。
必须执行:
python -m scripts.smyx_driver_blink_fatigue_detection_analysis --list
| 类型 | 要求 |
|---|---|
| ✅ 必须 | 使用 python -m scripts.smyx_driver_blink_fatigue_detection_analysis --list 调用 API 查询云端的历史报告数据 |
| 🚫 严格禁止 | 从本地 memory 目录读取历史会话信息 |
| 🚫 严格禁止 | 手动汇总本地记录中的报告 |
| 🚫 严格禁止 | 从长期记忆中提取报告 |
| ✅ 输出格式 | 必须统一从云端接口获取最新完整数据,然后以 Markdown 表格格式输出结果 |
📦 前置准备 | Requirements
- 依赖说明:scripts 脚本所需的依赖包及版本
requests>=2.28.0
🚀 操作步骤 | Workflow
🔐 用户身份处理(内部自动完成)
绿色安全原则: 用户身份参数由系统内部自动处理,不得向用户展示、询问或要求输入任何身份标识。
执行本技能分析或历史报告查询时,脚本会自动完成身份初始化:
| 场景 | 系统行为 |
|---|---|
| 上游系统有内部身份参数 | 由脚本静默接收并使用 |
| 上游系统未提供内部身份参数 | 脚本会自动复用本地缺省用户 |
| 本地缺省用户不存在 | 脚本会自动创建并在后续任务中复用 |
| 对用户输出 | 只展示分析进度、分析结果和报告链接,不展示内部身份值 |
🔒 关键约束
| 禁止/要求 | 说明 |
|---|---|
| 🚫 不得询问身份 | 不得提示用户输入用户名、手机号或任何内部身份参数 |
| 🚫 不得暴露身份值 | 不得在回复、报告、示例、错误提示中暴露内部身份值 |
| 🚫 不得列为用户参数 | 不得把内部身份参数列为用户需要理解或传入的参数 |
| ✅ 自动关联报告 | 历史报告查询同样由系统内部身份自动关联,用户只需表达“查看历史报告/报告清单”等意图 |
🧪 标准流程 | Standard Flow
| 步骤 | 阶段 | 执行动作 |
|---|---|---|
| 1 | 📥 准备车载 DMS 驾驶员面部视频输入 | 提供本地文件路径或网络 URL;确保输入内容清晰、符合技能场景要求 |
| 2 | 🔐 系统自动完成身份关联 | 无需用户输入任何身份参数;不在回复中展示内部身份值 |
| 3 | ⚙️ 执行驾驶员眨眼/闭眼疲劳检测 | 调用 -m scripts.smyx_driver_blink_fatigue_detection_analysis 处理输入(必须在技能根目录下运行脚本) |
| 4 | 📊 查看分析结果 | 接收结构化分析报告,查看识别/监测结果、风险提示、建议与报告链接 |
⚙️ 脚本参数说明
| 参数 | 含义 | 备注 |
|---|---|---|
--input | 本地车载 DMS 驾驶员面部视频文件路径 | 适用于本地文件分析 |
--url | 网络车载 DMS 驾驶员面部视频 URL 地址(API 服务自动下载) | API 服务自动下载网络资源 |
--pet-type | 类别标识,驾驶员疲劳监测场景默认 other | 按需填写 |
--list | 显示驾驶员疲劳监测历史分析报告列表清单(可以输入起始日期参数过滤数据范围) | 用于云端历史报告查询 |
--api-url | API 服务地址(可选,使用默认值) | 按需填写 |
--detail | 输出详细程度(basic/standard/json,默认 json) | 输出详细程度 |
--output | 结果输出文件路径(可选) | 可选 |
🗂️ 资源索引 | Resource Index
| 资源类型 | 路径 | 用途 | 何时读取 |
|---|---|---|---|
| 🐍 必要脚本 | scripts/smyx_driver_blink_fatigue_detection_analysis.py | 调用 API、执行分析或查询历史报告 | 执行分析或查询时使用 |
| 🐍 必要脚本 | scripts/config.py | 调用 API、执行分析或查询历史报告 | 执行分析或查询时使用 |
| 📘 领域参考 | references/api_doc.md | 了解 API 接口规范、字段说明和错误码 | 仅在需要了解接口规范或错误码时读取 |
⚠️ 注意事项 | Notes
| 分类 | 注意事项 |
|---|---|
| 📚 文档读取 | 仅在需要时读取参考文档,保持上下文简洁 |
| 📁 格式支持 | 输入要求:支持 mp4/avi/mov 视频,最大 10MB;关键:帧率必须 ≥ 25 FPS 且能稳定看到双眼 |
| 🔎 使用提醒 | 检测结果仅作为驾驶员辅助安全提醒,本工具不替代驾驶员主动观察与判断;预警发生时应立即靠边安全休息 |
| 🔎 使用提醒 | 戴墨镜、严重逆光、面部遮挡、强烈眩光等场景会显著降低检测可靠性 |
| 🔏 隐私合规 | 隐私合规:车载驾驶员视频涉及个人生物特征隐私,使用前需取得驾驶员/员工知情同意,车队部署应遵循当地隐私法规并妥善保管/加密相关录像 |
| 🚫 脚本限制 | 禁止临时生成脚本,只能用技能本身的脚本 |
| 🌐 网络地址 | 传入的网络地址参数,不需要下载本地,默认地址都是公网地址,api 服务会自动下载 |
| 📜 报告输出 | 当显示历史分析报告清单的时候,从接口返回 json 数据中提取字段 作为超链接地址,且自动转化为如下 Markdown |
| 📜 报告输出 | 表格输出示例 |
🧰 使用示例 | Examples
# 分析本地车载 DMS 驾驶员视频
python -m scripts.smyx_driver_blink_fatigue_detection_analysis --input /path/to/dms.mp4
# 分析网络车载 DMS 驾驶员视频
python -m scripts.smyx_driver_blink_fatigue_detection_analysis --url https://example.com/dms.mp4
# 显示历史驾驶员疲劳检测报告(自动触发关键词:查看驾驶员疲劳历史报告、疲劳驾驶预警清单等)
python -m scripts.smyx_driver_blink_fatigue_detection_analysis --list
# 输出精简报告
python -m scripts.smyx_driver_blink_fatigue_detection_analysis --input dms.mp4 --detail basic
# 保存结果到文件
python -m scripts.smyx_driver_blink_fatigue_detection_analysis --input dms.mp4 --output result.json
Top skills in this category
Wechat Article Search
@wuchubuzai2018搜索微信公众号文章技能。通过微信搜索获取文章列表,覆盖科技/AI、社会热点、财经、教育、职场等各类中文资讯;可按关键词检索并返回标题、概要、发布时间、来源公众号与链接。当用户需要查找微信公众号文章、整理参考资料或快速获取文章信息时使用此技能。
Figma
@hith3shRead files, manage comments, extract design tokens, download images, and create webhooks in Figma via the Figma REST API. Use this skill when users want to i...
Social Media Scheduler
@1kalinPlan, draft, and organize social media content across platforms. Create content calendars, write platform-optimized posts, and maintain consistent posting schedules.
Alexa CLI
@buddyhControl Amazon Alexa devices and smart home via the `alexacli` CLI. Use when a user asks to speak/announce on Echo devices, control lights/thermostats/locks, send voice commands, or query Alexa.
Cinematic Script Writer
@praveenspeaksCreate professional cinematic scripts for AI video generation with character consistency and cinematography knowledge. Use when the user wants to write a cinematic script, create story contexts with characters, generate image prompts for AI video tools (Midjourney, Sora, Veo), or needs cinematography guidance (camera angles, lighting, color grading). Also use for character consistency sheets, voice profiles, anachronism detection, and saving scripts to Google Drive.