Using the camera built into a smart desk lamp or a tabletop camera, the system analyzes video of the child's study area in real time, detecting behavioral indicators such as face orientation (whether it deviates from the book/screen), eye gaze direction, and fidgeting hand actions (playing with a pen, touching the face, fiddling with objects), and computes a per-minute focus score (0-100) while recording distraction periods. The skill helps parents and teachers understand the child's learning state and optimize study habits. Application scenarios: smart study lamps, home study rooms, classrooms. The system monitors in real time, generates focus reports, and pushes alerts when focus stays persistently low. Skill features: improve learning efficiency. | 通过智能台灯内置摄像头或桌面摄像头,实时分析儿童学习区域的视频,检测面部朝向(是否偏离书本/屏幕)、眼部注视方向、手部小动作(玩笔、摸脸、摆弄物品)等行为指标,计算每分钟专注得分(0-100分),并记录走神时段。该技能可帮助家长和教师了解儿童学习状态,优化学习习惯。应用场景:智能学习台灯、家庭书房、教室。系统实时监测,生成专注度报告,当专注度持续偏低时推送提醒。技能特点:提升学习效率。
设计与多媒体
Child Drowsiness / Fatigue Detection | 儿童打瞌睡/疲劳检测
试用Using a fixed camera in the classroom or above the home desk, the system analyzes the child's (student's) facial video in real time, detecting eye closure ratio (PERCLOS — the proportion of time eyes are closed more than 80% within a unit time), head-nodding frequency (rapid downward nod followed by lift), and changes in eye-region glossiness, and computes a comprehensive fatigue index (0-100). | 通过教室或家庭书桌的固定摄像头,实时分析儿童(学生)的面部视频,检测眼部闭合比例(PERCLOS,单位时间内眼睛闭合超过80%的时间占比)、点头动作频率(头部快速下点后抬起)以及眼部区域的光泽度变化,综合计算疲劳指数(0-100)。该技能可帮助教师或家长及时发现儿童困倦状态,调整学习安排或提醒休息。
它能做什么
Using a fixed camera in the classroom or above the home desk, the system analyzes the child's (student's) facial video in real time, detecting eye closure ratio (PERCLOS — the proportion of time eyes are closed more than 80% within a unit time), head-nodding frequency (rapid downward nod followed by lift), and changes in eye-region glossiness, and computes a comprehensive fatigue index (0-100). | 通过教室或家庭书桌的固定摄像头,实时分析儿童(学生)的面部视频,检测眼部闭合比例(PERCLOS,单位时间内眼睛闭合超过80%的时间占比)、点头动作频率(头部快速下点后抬起)以及眼部区域的光泽度变化,综合计算疲劳指数(0-100)。该技能可帮助教师或家长及时发现儿童困倦状态,调整学习安排或提醒休息。
技能文档
😴 Child Drowsiness / Fatigue Detection | 儿童打瞌睡/疲劳检测
智能分析中枢 · 图片/视频智能分析 · 结构化报告 · 历史报告云端查询
🧭 技能概览 | Overview
| 模块 | 内容 |
|---|---|
| 🏷️ 技能名称 | 儿童打瞌睡/疲劳检测 |
| 🎯 核心目标 | 通过教室或家庭书桌的固定摄像头,实时分析儿童(学生)的面部视频,检测眼部闭合比例(PERCLOS,单位时间内眼睛闭合超过80%的时间占比)、点头动作频率(头部快速下点后抬起)以及眼部区域的光泽度变化,综合计算疲劳指数(0-100)。该技能可帮助教师或家长及时发现儿童困倦状态,调整学习安排或提醒休息。 |
| 🖼️ 输入类型 | 图片、视频、本地文件、网络 URL |
| 📝 输出能力 | 结构化分析报告、识别/监测结果、建议与报告链接 |
| 🧩 场景码 | SMYX_CHILD_DROWSINESS_FATIGUE_DETECTION_ANALYSIS |
Using a fixed camera in the classroom or above the home desk, the system analyzes the child's (student's) facial video in real time, detecting eye closure ratio (PERCLOS — the proportion of time eyes are closed more than 80% within a unit time), head-nodding frequency (rapid downward nod followed by lift), and changes in eye-region glossiness, and computes a comprehensive fatigue index (0-100). The skill helps teachers or parents detect drowsiness in time and adjust learning schedules or remind the child to rest. Application scenarios: classrooms, home desks, online classes. The system monitors in real time and, when the fatigue index exceeds a threshold, pushes reminders or triggers voice prompts (e.g., 'kid, time to take a break'). Skill features: safeguarding sleep health.
通过教室或家庭书桌的固定摄像头,实时分析儿童(学生)的面部视频,检测眼部闭合比例(PERCLOS,单位时间内眼睛闭合超过80%的时间占比)、点头动作频率(头部快速下点后抬起)以及眼部区域的光泽度变化,综合计算疲劳指数(0-100)。该技能可帮助教师或家长及时发现儿童困倦状态,调整学习安排或提醒休息。应用场景:教室、家庭书桌、在线课堂。系统实时监测,当疲劳指数超过阈值时,推送提醒或触发语音提示(如'小朋友,休息一下吧')。技能特点:保障睡眠健康。
🤖 AI 角色 | AI Role
| 角色要点 | 说明 |
|---|---|
| 说明 1 | 假设你是一个专业的儿童学习疲劳监测 AI。你的任务是分析儿童面部视频,检测眼部闭合状态和头部点头动作,计算疲劳指数。不要提供医疗诊断或睡眠障碍诊断,仅输出基于视觉的疲劳评估结果与方向性休息提醒。 |
🎬 技能演示 | Skill Demo
🎯 任务目标 | Goals
1. 🧩 技能用途
基于教室/家庭书桌摄像头视频,量化儿童眼部闭合(PERCLOS)+ 点头动作 + 眼部光泽度变化,输出 0-100 疲劳指数与等级判定
2. 🛠️ 能力范围
| 序号 | 具体能力 |
|---|---|
| 1 | 儿童面部检测 |
| 2 | 眼部状态识别(闭合 / 半闭 / 睁开) |
| 3 | PERCLOS 计算 |
| 4 | 连续闭眼时长 |
| 5 | 眨眼频次 |
| 6 | 点头次数与角度 |
| 7 | 眼部光泽度变化 |
| 8 | 疲劳综合得分(0-100) |
| 9 | 疲劳等级(alert / mild_fatigue / moderate_fatigue / drowsy) |
| 10 | 打瞌睡事件列表 |
| 11 | 语音提醒文本生成 |
3. ⚡ 触发条件
| 触发类型 | 触发规则 |
|---|---|
| ✅ 默认触发 | 默认触发:当用户提供儿童面部学习区域视频 URL 或文件需要分析时,默认触发本技能进行打瞌睡/疲劳检测 |
| 🔎 明确分析意图 | 当用户明确提及打瞌睡、疲劳、困倦、PERCLOS、点头、眨眼、上课走神、写作业犯困、智能台灯疲劳提醒等关键词,并且上传了视频文件 |
| 📚 历史报告查询 | 当用户提及以下关键词时,自动触发历史报告查询功能 :查看儿童疲劳历史报告、打瞌睡报告清单、疲劳指数报告清单、查询历史疲劳记录、显示所有儿童疲劳检测报告、显示儿童睡眠健康诊断报告,查询疲劳提醒清单 |
4. 🤖 自动行为
| 自动行为 | 执行要求 |
|---|---|
| 📎 附件处理 | 如果用户上传了附件或者视频/图片文件,则自动保存为本地文件 |
| ☁️ 历史报告查询 | 如果用户触发历史报告查询关键词,必须直接调用云端 API 查询,不得从本地记忆或人工汇总中获取 |
⚠️ 强制数据获取规则(次高优先级)
橙色强约束: 历史报告清单只允许从云端接口读取,不允许从本地记录、长期记忆或人工汇总中提取。
必须执行:
python -m scripts.smyx_child_drowsiness_fatigue_detection_analysis --list
| 类型 | 要求 |
|---|---|
| ✅ 必须 | 使用 python -m scripts.smyx_child_drowsiness_fatigue_detection_analysis --list 调用 API 查询云端的历史报告数据 |
| 🚫 严格禁止 | 从本地 memory 目录读取历史会话信息 |
| 🚫 严格禁止 | 手动汇总本地记录中的报告 |
| 🚫 严格禁止 | 从长期记忆中提取报告 |
| ✅ 输出格式 | 必须统一从云端接口获取最新完整数据,然后以 Markdown 表格格式输出结果 |
📦 前置准备 | Requirements
- 依赖说明:scripts 脚本所需的依赖包及版本
requests>=2.28.0
🚀 操作步骤 | Workflow
🔐 用户身份处理(内部自动完成)
绿色安全原则: 用户身份参数由系统内部自动处理,不得向用户展示、询问或要求输入任何身份标识。
执行本技能分析或历史报告查询时,脚本会自动完成身份初始化:
| 场景 | 系统行为 |
|---|---|
| 上游系统有内部身份参数 | 由脚本静默接收并使用 |
| 上游系统未提供内部身份参数 | 脚本会自动复用本地缺省用户 |
| 本地缺省用户不存在 | 脚本会自动创建并在后续任务中复用 |
| 对用户输出 | 只展示分析进度、分析结果和报告链接,不展示内部身份值 |
🔒 关键约束
| 禁止/要求 | 说明 |
|---|---|
| 🚫 不得询问身份 | 不得提示用户输入用户名、手机号或任何内部身份参数 |
| 🚫 不得暴露身份值 | 不得在回复、报告、示例、错误提示中暴露内部身份值 |
| 🚫 不得列为用户参数 | 不得把内部身份参数列为用户需要理解或传入的参数 |
| ✅ 自动关联报告 | 历史报告查询同样由系统内部身份自动关联,用户只需表达“查看历史报告/报告清单”等意图 |
🧪 标准流程 | Standard Flow
| 步骤 | 阶段 | 执行动作 |
|---|---|---|
| 1 | 📥 准备儿童面部学习区域视频输入 | 提供本地文件路径或网络 URL;确保输入内容清晰、符合技能场景要求 |
| 2 | 🔐 系统自动完成身份关联 | 无需用户输入任何身份参数;不在回复中展示内部身份值 |
| 3 | ⚙️ 执行儿童打瞌睡/疲劳检测 | 调用 -m scripts.smyx_child_drowsiness_fatigue_detection_analysis 处理输入(必须在技能根目录下运行脚本) |
| 4 | 📊 查看分析结果 | 接收结构化分析报告,查看识别/监测结果、风险提示、建议与报告链接 |
⚙️ 脚本参数说明
| 参数 | 含义 | 备注 |
|---|---|---|
--input | 本地儿童面部学习区域视频文件路径 | 适用于本地文件分析 |
--url | 网络儿童面部学习区域视频 URL 地址(API 服务自动下载) | API 服务自动下载网络资源 |
--pet-type | 类别标识,儿童学习疲劳监测场景默认 other | 按需填写 |
--list | 显示儿童打瞌睡/疲劳历史检测报告列表清单(可以输入起始日期参数过滤数据范围) | 用于云端历史报告查询 |
--api-url | API 服务地址(可选,使用默认值) | 按需填写 |
--detail | 输出详细程度(basic/standard/json,默认 json) | 输出详细程度 |
--output | 结果输出文件路径(可选) | 可选 |
🗂️ 资源索引 | Resource Index
| 资源类型 | 路径 | 用途 | 何时读取 |
|---|---|---|---|
| 🐍 必要脚本 | scripts/smyx_child_drowsiness_fatigue_detection_analysis.py | 调用 API、执行分析或查询历史报告 | 执行分析或查询时使用 |
| 🐍 必要脚本 | scripts/config.py | 调用 API、执行分析或查询历史报告 | 执行分析或查询时使用 |
| 📘 领域参考 | references/api_doc.md | 了解 API 接口规范、字段说明和错误码 | 仅在需要了解接口规范或错误码时读取 |
⚠️ 注意事项 | Notes
| 分类 | 注意事项 |
|---|---|
| 📚 文档读取 | 仅在需要时读取参考文档,保持上下文简洁 |
| 📁 格式支持 | 输入要求:支持 mp4/avi/mov 视频,最大 10MB;建议正对面部、≥ 15 FPS |
| 🧑⚖️ 结果性质 | 检测结果仅作为学习/课堂辅助参考,本工具不替代家长/教师的实际观察与教育判断,疑似长期严重困倦请就医 |
| 🔏 隐私合规 | 隐私合规:儿童学习场景视频涉及未成年人隐私,使用前需取得监护人知情同意,并妥善保管/加密相关录像 |
| 🚫 脚本限制 | 禁止临时生成脚本,只能用技能本身的脚本 |
| 🌐 网络地址 | 传入的网络地址参数,不需要下载本地,默认地址都是公网地址,api 服务会自动下载 |
| 📜 报告输出 | 当显示历史分析报告清单的时候,从接口返回 json 数据中提取字段 作为超链接地址,且自动转化为如下 Markdown |
| 📜 报告输出 | 表格输出示例 |
🧰 使用示例 | Examples
# 分析本地儿童学习面部视频
python -m scripts.smyx_child_drowsiness_fatigue_detection_analysis --input /path/to/class.mp4
# 分析网络儿童学习面部视频
python -m scripts.smyx_child_drowsiness_fatigue_detection_analysis --url https://example.com/class.mp4
# 显示历史儿童疲劳检测报告(自动触发关键词:查看儿童疲劳历史报告、打瞌睡报告清单等)
python -m scripts.smyx_child_drowsiness_fatigue_detection_analysis --list
# 输出精简报告
python -m scripts.smyx_child_drowsiness_fatigue_detection_analysis --input class.mp4 --detail basic
# 保存结果到文件
python -m scripts.smyx_child_drowsiness_fatigue_detection_analysis --input class.mp4 --output result.json
相关技能
Using a fixed camera in the child's bedroom (infrared night vision), the system continuously captures video and audio at night to analyze the child's sleep behavior. It detects rollover frequency (rollovers per minute), cries (recognizing specific cry-sound features), and sleep talk (speech during sleep), and generates a sleep-quality report. When rollovers occur too often (e.g., > 3 per hour), strong crying is detected, or sleep talk is observed, the system pushes 'possible nightmare' or 'restless sleep' alerts to the parents. Application scenarios: child bedrooms, infant rooms. The system relays night-time monitoring to help parents understand the child's sleep quality and provide timely comfort. Skill features: improve sleep. | 通过儿童床或卧室的固定摄像头(红外夜视),在夜间连续采集视频及音频,分析儿童的睡眠行为。检测翻身次数(每分钟翻身频率)、哭声(识别特定的哭声音频特征)以及梦话(检测睡眠中的语音),生成睡眠质量报告。当翻身过于频繁(如>3次/小时)、出现强烈哭声或梦话时,推送给父母'可能做噩梦'或'睡眠不安'的预警。应用场景:儿童卧室、婴儿房。系统夜间接力监测,帮助家长了解儿童睡眠质量,及时安抚。技能特点:改善睡眠。
Using a fixed camera at the home entrance or kindergarten gate, the system analyzes pre-school videos and detects crying facial expressions (frowning, open-mouth crying, tearing), physical clinging actions (grabbing parent's clothes, hugging parent's leg, pulling door frame), and resistance behaviors (stepping back, lying on the ground), then comprehensively evaluates the separation-anxiety level (mild / moderate / severe). | 通过家庭或幼儿园门口固定摄像头,分析儿童上学前的视频,检测哭闹面部表情(皱眉、张嘴哭泣、流泪)、肢体抓拽动作(抓住家长衣服、抱住家长腿、拉扯门框)以及抗拒行为(后退、躺地)等,综合评估分离焦虑等级(轻度/中度/重度)。该技能可辅助家长和教师了解儿童情绪状态,及时进行安抚或心理疏导。
Using a smart mirror or fixed camera, the system analyzes high-resolution adult facial images or short videos to detect physiological features such as under-eye bag area (puffiness/shadow under the lower eyelid), dark-circle grayscale (darkness around the eyes), mouth-corner drop angle (angle between corner of mouth and horizontal), and glabellar frown lines (vertical lines between the brows), and computes a comprehensive. | 通过智能镜子或固定摄像头,分析成人面部的高清图像或视频,检测眼袋面积(下眼睑区域的浮肿或阴影面积)、黑眼圈灰度(眼眶区域的暗沉程度)、嘴角下垂角度(口角与水平线的夹角)以及皱眉纹(眉间川字纹)等生理特征,综合计算疲劳/压力指数(0-100分)。该技能可用于职场健康管理、个人状态监测,辅助了解自身精力水平。
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. | 通过车载DMS摄像头实时分析驾驶员面部视频,检测眼部开闭状态,计算每分钟眨眼频率(正常约为15-20次/分钟),并识别闭眼持续时间。当眨眼频率异常降低(如<10次/分钟)或出现单次闭眼超过2秒(微睡眠前兆)时,输出疲劳驾驶预警,联动车内语音提醒或震动座椅,预防因疲劳导致的事故。
Through a fixed camera in a smart-home living room, the system analyzes office worker behavior in the first 30 minutes after coming home, detecting slumped sitting / reclining (relaxed posture, back-to-sofa angle > 120°), facial fatigue features (visible eye bags, downturned mouth corners, frequent blinking), and sighing frequency (rapid chest/abdomen rise-fall with audible exhale). | 通过智能家居客厅的固定摄像头,分析上班族回家后30分钟内的行为,检测瘫坐/斜躺(姿态放松、背部与沙发夹角>120°)、面部疲惫特征(眼袋明显、嘴角下垂、频繁眨眼)、叹气频次(胸腹快速起伏伴呼气声)。当疲劳指数超过阈值时,通过智能音箱主动播报关怀语音(如'辛苦了,喝杯水休息一下'),并播放舒缓音乐。