Driver Facial Flushing / Sweat Abnormality Detection | 驾驶员面部潮红/出汗异常检测

Prompts

Using an in-cabin DMS camera, the system analyzes the driver's facial video in real time, detecting skin color variation (flush index, derived from red-channel ratio in RGB or skin-color models) and sweat-droplet / reflective area (via image texture and reflection features). When the flush index rises significantly (possibly indicating elevated blood pressure, fever or strong emotion) or the sweating area exceeds the threshold (possibly indicating heat stress, hypoglycemia or cardiac issues), it outputs a health-risk reminder and suggests the driver to rest or seek medical help. The skill aims to help drivers stay aware of their physical state and avoid accidents caused by sudden illness. Application scenarios: passenger cars, commercial vehicles, ride-hailing fleets, freight fleets. Real-time monitoring; when flushing or heavy sweating is detected, it voice-prompts 'please pay attention to your physical state, rest is recommended' or pushes the event to the fleet-management platform. Skill features: sudden illness of drivers (e.g., heart attack, heatstroke, hypoglycemia) often leads to vehicle loss of control and major accidents. AI real-time monitoring of facial flushing and abnormal sweating provides an early reminder for drivers to take a break or seek help, reducing accident risk. Can serve as a value-add feature on DMS systems, especially suitable for commercial and ride-hailing fleets. | 通过车载DMS摄像头实时分析驾驶员面部视频,检测面部肤色变化(潮红指数,通过RGB色空间中的红色分量比例或肤色模型)以及汗珠/反光面积(通过图像纹理和反射特征)。当潮红指数显著升高(可能提示血压升高、发热或情绪激动)或出汗区域面积超过阈值(可能提示热应激、低血糖或心脏问题)时,输出健康风险提醒,建议驾驶员停车休息或就医。该技能旨在辅助驾驶员关注自身健康,避免因突发疾病引发事故。应用场景:乘用车、商用车、网约车、货运车队。系统实时监测,当检测到面部潮红或大量出汗时,通过语音提示'请注意身体状态,建议休息'或推送至车队管理平台。技能特点:驾驶员突发疾病(如心梗、中暑、低血糖)往往会导致车辆失控,引发重大事故。通过AI实时监测面部潮红和出汗异常,可早期提醒驾驶员关注自身状态,采取休息或求助措施,降低事故风险。该技能可作为DMS系统的增值功能,提升车辆主动安全水平,尤其适合营运车辆和网约车平台。

Install

openclaw skills install smyx-driver-flushing-sweat-detection-analysis

Driver Facial Flushing / Sweat Abnormality Detection | 驾驶员面部潮红/出汗异常检测

Using an in-cabin DMS camera, the system analyzes the driver's facial video in real time, detecting skin color variation (flush index, derived from red-channel ratio in RGB or skin-color models) and sweat-droplet / reflective area (via image texture and reflection features). When the flush index rises significantly (possibly indicating elevated blood pressure, fever or strong emotion) or the sweating area exceeds the threshold (possibly indicating heat stress, hypoglycemia or cardiac issues), it outputs a health-risk reminder and suggests the driver to rest or seek medical help. The skill aims to help drivers stay aware of their physical state and avoid accidents caused by sudden illness. Application scenarios: passenger cars, commercial vehicles, ride-hailing fleets, freight fleets. Real-time monitoring; when flushing or heavy sweating is detected, it voice-prompts 'please pay attention to your physical state, rest is recommended' or pushes the event to the fleet-management platform. Skill features: sudden illness of drivers (e.g., heart attack, heatstroke, hypoglycemia) often leads to vehicle loss of control and major accidents. AI real-time monitoring of facial flushing and abnormal sweating provides an early reminder for drivers to take a break or seek help, reducing accident risk. Can serve as a value-add feature on DMS systems, especially suitable for commercial and ride-hailing fleets.

通过车载DMS摄像头实时分析驾驶员面部视频,检测面部肤色变化(潮红指数,通过RGB色空间中的红色分量比例或肤色模型)以及汗珠/反光面积(通过图像纹理和反射特征)。当潮红指数显著升高(可能提示血压升高、发热或情绪激动)或出汗区域面积超过阈值(可能提示热应激、低血糖或心脏问题)时,输出健康风险提醒,建议驾驶员停车休息或就医。该技能旨在辅助驾驶员关注自身健康,避免因突发疾病引发事故。应用场景:乘用车、商用车、网约车、货运车队。系统实时监测,当检测到面部潮红或大量出汗时,通过语音提示'请注意身体状态,建议休息'或推送至车队管理平台。技能特点:驾驶员突发疾病(如心梗、中暑、低血糖)往往会导致车辆失控,引发重大事故。通过AI实时监测面部潮红和出汗异常,可早期提醒驾驶员关注自身状态,采取休息或求助措施,降低事故风险。该技能可作为DMS系统的增值功能,提升车辆主动安全水平,尤其适合营运车辆和网约车平台。

🎯 AI 角色

假设你是一个专业的驾驶员健康监测 AI。你的任务是分析驾驶员面部视频,检测面部潮红指数(肤色中红色分量的变化)和出汗区域(汗珠或皮肤反光面积)。当潮红指数超过阈值或出汗面积超过预设比例时,输出健康风险提醒。不要提供医疗诊断或具体临床判断,仅输出基于视觉的异常现象提示。

任务目标

  • 本 Skill 用于:基于车载 DMS 摄像头驾驶员面部视频,实时检测面部潮红指数与出汗反光面积,按阈值输出健康风险提醒
  • 能力包含:驾驶员面部检测、面部 ROI 分区(额头/双颊/鼻翼)、潮红指数计算(RGB 红色分量比 / 肤色模型偏移)、潮红面积比、汗珠/反光面积比、皮肤纹理粗糙度、基线值与变化幅度、异常等级判定、座舱联动动作建议(voice_alert / fleet_upload / event_record)
  • 触发条件:
    1. 默认触发:当用户提供车载 DMS 驾驶员面部视频 URL 或文件需要分析时,默认触发本技能进行潮红/出汗异常检测
    2. 当用户明确提及驾驶员健康、面部潮红、出汗异常、突发疾病、心梗预警、中暑预警、低血糖、DMS 健康监测、营运车辆健康等关键词,并且上传了视频文件
    3. 当用户提及以下关键词时,自动触发历史报告查询功能 :查看驾驶员健康历史报告、潮红预警清单、出汗异常报告清单、查询历史驾驶员健康事件、显示所有驾驶员健康报告、显示车队健康诊断报告,查询驾驶员健康事件清单
  • 自动行为:
    1. 如果用户上传了附件或者视频文件,则自动保存为本地文件
    2. ⚠️ 强制数据获取规则(次高优先级):如果用户触发任何历史报告查询关键词(如"查看所有驾驶员健康报告"、" 显示所有潮红/出汗预警报告"、" 查看历史报告"等),必须
      • 直接使用 python -m scripts.smyx_driver_flushing_sweat_detection_analysis --list --open-id 参数调用 API 查询云端的历史报告数据
      • 严格禁止:从本地 memory 目录读取历史会话信息、严格禁止手动汇总本地记录中的报告、严格禁止从长期记忆中提取报告
      • 必须统一从云端接口获取最新完整数据,然后以 Markdown 表格格式输出结果

前置准备

  • 依赖说明:scripts 脚本所需的依赖包及版本
    requests>=2.28.0
    

操作步骤

🔒 open-id 获取流程控制(强制执行,防止遗漏)

在执行驾驶员面部潮红/出汗异常检测前,必须按以下优先级顺序获取 open-id:

第 1 步:【最高优先级】检查技能所在目录的配置文件(优先)
        路径:skills/smyx_common/scripts/config.yaml(相对于技能根目录)
        完整路径示例:${OPENCLAW_WORKSPACE}/skills/{当前技能目录}/skills/smyx_common/scripts/config.yaml
        → 如果文件存在且配置了 api-key 字段,则读取 api-key 作为 open-id
        ↓ (未找到/未配置/api-key 为空)
第 2 步:检查 workspace 公共目录的配置文件
        路径:${OPENCLAW_WORKSPACE}/skills/smyx_common/scripts/config.yaml
        → 如果文件存在且配置了 api-key 字段,则读取 api-key 作为 open-id
        ↓ (未找到/未配置)
第 3 步:检查用户是否在消息中明确提供了 open-id
        ↓ (未提供)
第 4 步:❗ 必须暂停执行,明确提示用户提供用户名或手机号作为 open-id

⚠️ 关键约束:

  • 禁止自行假设,自行推导,自行生成 open-id 值(如 openclaw-control-ui、default、userC113、user123 等)
  • 禁止跳过 open-id 验证直接调用 API
  • 必须在获取到有效 open-id 后才能继续执行分析
  • 如果用户拒绝提供 open-id,说明用途(用于保存和查询历史报告记录),并询问是否继续

  • 标准流程:
    1. 准备车载 DMS 驾驶员面部视频输入
      • 提供本地车载 DMS 视频路径或网络 URL
      • 摄像头建议:DMS 摄像头(优先使用彩色 RGB 通道,纯红外通道无法识别潮红)、安装在方向盘上方/A 柱/仪表台上方,正对驾驶员面部
      • 视频帧率 ≥ 15 FPS、分辨率 ≥ 480p、白平衡尽量稳定
      • 避免强逆光、有色车窗严重影响 RGB;戴口罩会显著降低潮红/出汗面积识别可靠性
      • 可选附带:驾驶员姓名/工号、车队 ID、车型、行车段(高温天气/夜间长途)、阈值覆盖
    2. 获取 open-id(强制执行)
      • 按上述流程控制获取 open-id
      • 如无法获取,必须提示用户提供用户名或手机号
    3. 执行驾驶员面部潮红/出汗异常检测
      • 调用 -m scripts.smyx_driver_flushing_sweat_detection_analysis 处理输入(必须在技能根目录下运行脚本
      • 参数说明:
        • --input: 本地车载 DMS 驾驶员面部视频文件路径
        • --url: 网络车载 DMS 驾驶员面部视频 URL 地址(API 服务自动下载)
        • --pet-type: 类别标识,驾驶员健康监测场景默认 other
        • --open-id: 当前用户的 open-id(必填,按上述流程获取)
        • --list: 显示驾驶员面部潮红/出汗异常历史分析报告列表清单(可以输入起始日期参数过滤数据范围)
        • --api-key: API 访问密钥(可选)
        • --api-url: API 服务地址(可选,使用默认值)
        • --detail: 输出详细程度(basic/standard/json,默认 json)
        • --output: 结果输出文件路径(可选)
    4. 查看分析结果
      • 接收结构化的驾驶员面部潮红/出汗异常检测报告
      • 包含:是否检测到驾驶员(driver_detected)、面部是否可见(face_visible)、潮红相关指标(flush_metrics:flush_index / flush_area_ratio / flush_index_delta)、出汗相关指标(sweat_metrics:sweat_glare_area_ratio / skin_texture_score)、预警类型(warning_type:facial_flushing / excessive_sweating / combined_flush_sweat)、预警提示文本(如"驾驶员面部潮红指数上升 0.32 且额头出汗反光面积 22%,请注意身体状态,建议就近停车休息")、建议座舱联动动作(recommend_action:voice_alert / fleet_upload / event_record)
      • 重要提示:仅输出基于视觉的面部潮红/出汗异常现象提示,不提供血压、心脏病、中暑、低血糖等具体医学诊断;如有不适请及时就医并由专业人员评估

资源索引

注意事项

  • 仅在需要时读取参考文档,保持上下文简洁
  • 输入要求:支持 mp4/avi/mov 视频,最大 10MB;关键:必须有彩色 RGB 通道,纯红外通道无法识别潮红
  • API 密钥可选,如果通过参数传入则必须确保调用鉴权成功,否则忽略鉴权
  • 检测结果仅作为驾驶员辅助健康提醒,本工具不替代体温计、血压计、血糖仪、心电图等医疗设备,更不替代医生诊断
  • 受光照、车窗有色膜、肤色个体差异影响较大,建议结合基线值与持续时间综合判定
  • 隐私合规:车载驾驶员视频涉及个人生物特征隐私,使用前需取得驾驶员/员工知情同意,车队部署应遵循当地隐私法规并妥善保管/加密相关录像
  • 禁止临时生成脚本,只能用技能本身的脚本
  • 传入的网络地址参数,不需要下载本地,默认地址都是公网地址,api 服务会自动下载
  • 当显示历史分析报告清单的时候,从接口返回 json 数据中提取字段 reportImageUrl 作为超链接地址,且自动转化为如下 Markdown 表格格式输出,包含" 报告名称"、"预警类型"、"分析时间"、"点击查看"四列,其中"报告名称"列使用驾驶员潮红出汗异常报告-{记录id}形式拼接, "点击查看" 列使用 [🔗 查看报告](reportImageUrl) 格式的超链接,用户点击即可直接跳转到对应的完整报告页面。
  • 表格输出示例:
    报告名称预警类型分析时间点击查看
    驾驶员潮红出汗异常报告-20260312172200001combined_flush_sweat(潮红 Δ+0.32 / 出汗面积 22%)2026-03-12 17:22:00🔗 查看报告

使用示例

# 分析本地车载 DMS 驾驶员视频(以下只是示例,禁止直接使用openclaw-control-ui 作为 open-id)
python -m scripts.smyx_driver_flushing_sweat_detection_analysis --input /path/to/dms.mp4 --open-id your-open-id

# 分析网络车载 DMS 驾驶员视频(以下只是示例,禁止直接使用openclaw-control-ui 作为 open-id)
python -m scripts.smyx_driver_flushing_sweat_detection_analysis --url https://example.com/dms.mp4 --open-id your-open-id

# 显示历史驾驶员潮红/出汗异常报告(自动触发关键词:查看驾驶员健康历史报告、潮红预警清单等)
python -m scripts.smyx_driver_flushing_sweat_detection_analysis --list --open-id your-open-id

# 输出精简报告
python -m scripts.smyx_driver_flushing_sweat_detection_analysis --input dms.mp4 --open-id your-open-id --detail basic

# 保存结果到文件
python -m scripts.smyx_driver_flushing_sweat_detection_analysis --input dms.mp4 --open-id your-open-id --output result.json