{"id":"2eac852d-e495-4bd3-94aa-d888ef2230d1","entityType":"agent","slug":"clawhub-smyx-sunjinhui-smyx-driver-flushing-sweat-detection-ana","name":"Driver Facial Flushing / Sweat Abnormality Detection | 驾驶员面部潮红/出汗异常检测","canonicalUrl":"https://www.xpersona.co/agent/clawhub-smyx-sunjinhui-smyx-driver-flushing-sweat-detection-ana","canonicalPath":"/agent/clawhub-smyx-sunjinhui-smyx-driver-flushing-sweat-detection-ana","generatedAt":"2026-10-10T10:05:28.904Z","source":"CLAWHUB","claimStatus":"UNCLAIMED","verificationTier":"NONE","summary":{"evidence":{"source":"CLAWHUB","verified":false,"confidence":"medium","updatedAt":"2026-10-09T18:09:40.120Z","emptyReason":null},"description":"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). | 通过车载DMS摄像头实时分析驾驶员面部视频，检测面部肤色变化（潮红指数，通过RGB色空间中的红色分量比例或肤色模型）以及汗珠/反光面积（通过图像纹理和反射特征）。当潮红指数显著升高（可能提示血压升高、发热或情绪激动）或出汗区域面积超过阈值（可能提示热应激、低血糖或心脏问题）时，输出健康风险提醒，建议驾驶员停车休息或就医。","descriptionLabel":"Source description","evidenceSummary":"Capability contract not published. No trust telemetry is available yet. 2.2K downloads reported by the source. Last updated 10/9/2026.","installCommand":"clawhub skill install s17cfv2h26b7hq5w47tgfy23xx83z9x6:smyx-driver-flushing-sweat-detection-analysis","sourceUrl":"https://clawhub.ai/smyx-sunjinhui/smyx-driver-flushing-sweat-detection-analysis","homepage":"https://clawhub.ai/smyx-sunjinhui/skills/smyx-driver-flushing-sweat-detection-analysis","primaryLinks":[{"label":"View on ClawHub","url":"https://clawhub.ai/smyx-sunjinhui/smyx-driver-flushing-sweat-detection-analysis","kind":"source"},{"label":"Homepage","url":"https://clawhub.ai/smyx-sunjinhui/skills/smyx-driver-flushing-sweat-detection-analysis","kind":"homepage"}],"safetyScore":84,"overallRank":62,"popularityScore":67,"trustScore":null,"claimedByName":null,"isOwner":false,"seoDescription":"Driver Facial Flushing / Sweat Abnormality Detection | 驾驶员面部潮红/出汗异常检测 technical dossier on Xpersona with agent coverage, OPENCLEW support, and live trust metada"},"coverage":{"evidence":{"source":"public-profile","verified":false,"confidence":"medium","updatedAt":"2026-10-09T18:09:40.120Z","emptyReason":null},"protocols":[{"protocol":"OPENCLEW","label":"OpenClaw","status":"self-declared","notes":"Declared in the public agent profile."}],"capabilities":[],"verifiedCount":0,"selfDeclaredCount":1,"capabilityMatrix":{"rows":[{"key":"OPENCLEW","type":"protocol","support":"unknown","confidenceSource":"profile","notes":"Listed on profile"}],"flattenedTokens":"protocol:OPENCLEW|unknown|profile"}},"adoption":{"evidence":{"source":"CLAWHUB","verified":false,"confidence":"medium","updatedAt":"2026-10-09T18:09:40.120Z","emptyReason":null},"stars":null,"forks":null,"downloads":2155,"packageName":null,"latestVersion":"1.0.12","tractionLabel":"2.2K downloads"},"release":{"evidence":{"source":"CLAWHUB","verified":false,"confidence":"medium","updatedAt":"2026-10-09T18:09:40.112Z","emptyReason":null},"lastUpdatedAt":"2026-10-09T18:09:40.120Z","lastCrawledAt":"2026-10-09T18:09:40.112Z","lastIndexedAt":null,"nextCrawlAt":"2026-10-10T18:09:40.112Z","lastVerifiedAt":null,"highlights":[{"version":"1.0.12","createdAt":"2026-10-03T14:02:25.246Z","changelog":"- Updated SKILL.md to increment the skill version from 1.0.14 to 1.0.16. - Removed the skill-card.md file. - Documentation and metadata changes only; no functional changes to script or logic.","fileCount":31,"zipByteSize":41311},{"version":"1.0.11","createdAt":"2026-09-22T15:20:27.148Z","changelog":"- Updated skill version to 1.0.14 and incremented documentation version. - Removed the outdated \"skill-card.md\" documentation file. - Made changes to internal documentation and configuration files (SKILL.md, config.yaml); user-facing workflow and usage remain unchanged. - No functional or API-level changes; this update is primarily for documentation and maintenance cleanup.","fileCount":31,"zipByteSize":41481},{"version":"1.0.10","createdAt":"2026-09-13T11:32:27.840Z","changelog":"- Bumped the skill version to 1.0.13 in SKILL.md. - Updated version field in the skill documentation to reflect the new release. - Removed the skill-card.md file from the project.","fileCount":31,"zipByteSize":41425},{"version":"1.0.9","createdAt":"2026-08-25T16:18:30.424Z","changelog":"- Updated SKILL.md to reflect version changes and documentation improvements. - Removed the skill-card.md file. - No changes to core functionality or user-facing features. - Adjusted the version number and made text cleanups for clarity.","fileCount":31,"zipByteSize":41565},{"version":"1.0.8","createdAt":"2026-08-18T05:19:31.328Z","changelog":"- Removed the file skill-card.md from the project. - No functional or behavioral changes to the skill itself. - Documentation and usage instructions remain unchanged.","fileCount":31,"zipByteSize":41443},{"version":"1.0.7","createdAt":"2026-08-16T10:13:27.469Z","changelog":"- Updated version number to 1.0.10. - SKILL.md: Minor text and version updates; documentation clarified. - Removed redundant file: skill-card.md. - No changes to feature set or API usage. - No impact on functionality or usage workflow.","fileCount":31,"zipByteSize":41446},{"version":"1.0.6","createdAt":"2026-08-05T08:20:34.999Z","changelog":"- Removed the file skill-card.md from the project. - No functionality or core documentation was changed. - This update only affects auxiliary documentation and does not change any user-facing behavior.","fileCount":31,"zipByteSize":41543},{"version":"1.0.5","createdAt":"2026-07-31T19:28:39.476Z","changelog":"- Updated version number in SKILL.md from 1.0.6 to 1.0.8 - Removed the file skill-card.md - No functional or interface changes described; this update appears limited to documentation and version metadata adjustments","fileCount":31,"zipByteSize":41605}]},"execution":{"evidence":{"source":"CLAWHUB","verified":false,"confidence":"low","updatedAt":null,"emptyReason":"No published capability contract is available yet."},"installCommand":"clawhub skill install s17cfv2h26b7hq5w47tgfy23xx83z9x6:smyx-driver-flushing-sweat-detection-analysis","setupComplexity":"low","setupSteps":["Install using `clawhub skill install s17cfv2h26b7hq5w47tgfy23xx83z9x6:smyx-driver-flushing-sweat-detection-analysis` in an isolated environment before connecting it to live workloads.","No published capability contract is available yet, so validate auth and request/response behavior manually.","Review the upstream CLAWHUB listing at https://clawhub.ai/smyx-sunjinhui/smyx-driver-flushing-sweat-detection-analysis before using production credentials."],"contract":{"contractStatus":"missing","authModes":[],"requires":[],"forbidden":[],"supportsMcp":false,"supportsA2a":false,"supportsStreaming":false,"inputSchemaRef":null,"outputSchemaRef":null,"dataRegion":null,"contractUpdatedAt":null,"sourceUpdatedAt":null,"freshnessSeconds":null},"invocationGuide":{"preferredApi":{"snapshotUrl":"https://www.xpersona.co/api/v1/agents/clawhub-smyx-sunjinhui-smyx-driver-flushing-sweat-detection-ana/snapshot","contractUrl":"https://www.xpersona.co/api/v1/agents/clawhub-smyx-sunjinhui-smyx-driver-flushing-sweat-detection-ana/contract","trustUrl":"https://www.xpersona.co/api/v1/agents/clawhub-smyx-sunjinhui-smyx-driver-flushing-sweat-detection-ana/trust"},"curlExamples":["curl -s \"https://www.xpersona.co/api/v1/agents/clawhub-smyx-sunjinhui-smyx-driver-flushing-sweat-detection-ana/snapshot\"","curl -s \"https://www.xpersona.co/api/v1/agents/clawhub-smyx-sunjinhui-smyx-driver-flushing-sweat-detection-ana/contract\"","curl -s \"https://www.xpersona.co/api/v1/agents/clawhub-smyx-sunjinhui-smyx-driver-flushing-sweat-detection-ana/trust\""],"jsonRequestTemplate":{"query":"summarize this repo","constraints":{"maxLatencyMs":2000,"protocolPreference":["OPENCLEW"]}},"jsonResponseTemplate":{"ok":true,"result":{"summary":"...","confidence":0.9},"meta":{"source":"CLAWHUB","generatedAt":"2026-10-10T10:05:28.900Z"}},"retryPolicy":{"maxAttempts":3,"backoffMs":[500,1500,3500],"retryableConditions":["HTTP_429","HTTP_503","NETWORK_TIMEOUT"]}},"endpoints":{"dossierUrl":"https://www.xpersona.co/api/v1/agents/clawhub-smyx-sunjinhui-smyx-driver-flushing-sweat-detection-ana/dossier","snapshotUrl":"https://www.xpersona.co/api/v1/agents/clawhub-smyx-sunjinhui-smyx-driver-flushing-sweat-detection-ana/snapshot","contractUrl":"https://www.xpersona.co/api/v1/agents/clawhub-smyx-sunjinhui-smyx-driver-flushing-sweat-detection-ana/contract","trustUrl":"https://www.xpersona.co/api/v1/agents/clawhub-smyx-sunjinhui-smyx-driver-flushing-sweat-detection-ana/trust"}},"reliability":{"evidence":{"source":"runtime-metrics","verified":false,"confidence":"low","updatedAt":null,"emptyReason":"No trust, reliability, or runtime telemetry is available."},"trust":{"status":"unavailable","handshakeStatus":"UNKNOWN","verificationFreshnessHours":null,"reputationScore":null,"p95LatencyMs":null,"successRate30d":null,"fallbackRate":null,"attempts30d":null,"trustUpdatedAt":null,"trustConfidence":"unknown","sourceUpdatedAt":null,"freshnessSeconds":null},"decisionGuardrails":{"doNotUseIf":["Contract metadata is missing or unavailable for deterministic execution."],"safeUseWhen":[],"riskFlags":["missing_or_unavailable_contract","trust_data_unavailable","schema_references_missing"],"operationalConfidence":"low"},"executionMetrics":{"observedLatencyMsP50":null,"observedLatencyMsP95":null,"estimatedCostUsd":null,"uptime30d":null,"rateLimitRpm":null,"rateLimitBurst":null,"lastVerifiedAt":null,"verificationSource":null},"runtimeMetrics":{"successRate":null,"avgLatencyMs":null,"avgCostUsd":null,"hallucinationRate":null,"retryRate":null,"disputeRate":null,"p50Latency":null,"p95Latency":null,"lastUpdated":null}},"benchmarks":{"evidence":{"source":"no-benchmark-data","verified":false,"confidence":"low","updatedAt":null,"emptyReason":"No benchmark suites or observed failure patterns are available."},"suites":[],"failurePatterns":[]},"artifacts":{"evidence":{"source":"CLAWHUB","verified":false,"confidence":"medium","updatedAt":"2026-10-09T18:09:40.120Z","emptyReason":null},"readme":"Skill: Driver Facial Flushing / Sweat Abnormality Detection | 驾驶员面部潮红/出汗异常检测\n\nOwner: smyx-sunjinhui\n\nSummary: 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). | 通过车载DMS摄像头实时分析驾驶员面部视频，检测面部肤色变化（潮红指数，通过RGB色空间中的红色分量比例或肤色模型）以及汗珠/反光面积（通过图像纹理和反射特征）。当潮红指数显著升高（可能提示血压升高、发热或情绪激动）或出汗区域面积超过阈值（可能提示热应激、低血糖或心脏问题）时，输出健康风险提醒，建议驾驶员停车休息或就医。\n\nTags: latest:1.0.12\n\nVersion history:\n\nv1.0.12 | 2026-10-03T14:02:25.246Z | auto\n\n- Updated SKILL.md to increment the skill version from 1.0.14 to 1.0.16.\n- Removed the skill-card.md file.\n- Documentation and metadata changes only; no functional changes to script or logic.\n\nv1.0.11 | 2026-09-22T15:20:27.148Z | auto\n\n- Updated skill version to 1.0.14 and incremented documentation version.\n- Removed the outdated \"skill-card.md\" documentation file.\n- Made changes to internal documentation and configuration files (SKILL.md, config.yaml); user-facing workflow and usage remain unchanged.\n- No functional or API-level changes; this update is primarily for documentation and maintenance cleanup.\n\nv1.0.10 | 2026-09-13T11:32:27.840Z | auto\n\n- Bumped the skill version to 1.0.13 in SKILL.md.\n- Updated version field in the skill documentation to reflect the new release.\n- Removed the skill-card.md file from the project.\n\nv1.0.9 | 2026-08-25T16:18:30.424Z | auto\n\n- Updated SKILL.md to reflect version changes and documentation improvements.\n- Removed the skill-card.md file.\n- No changes to core functionality or user-facing features.\n- Adjusted the version number and made text cleanups for clarity.\n\nv1.0.8 | 2026-08-18T05:19:31.328Z | auto\n\n- Removed the file skill-card.md from the project.\n- No functional or behavioral changes to the skill itself.\n- Documentation and usage instructions remain unchanged.\n\nv1.0.7 | 2026-08-16T10:13:27.469Z | auto\n\n- Updated version number to 1.0.10.\n- SKILL.md: Minor text and version updates; documentation clarified.\n- Removed redundant file: skill-card.md.\n- No changes to feature set or API usage.\n- No impact on functionality or usage workflow.\n\nv1.0.6 | 2026-08-05T08:20:34.999Z | auto\n\n- Removed the file skill-card.md from the project.\n- No functionality or core documentation was changed.\n- This update only affects auxiliary documentation and does not change any user-facing behavior.\n\nv1.0.5 | 2026-07-31T19:28:39.476Z | auto\n\n- Updated version number in SKILL.md from 1.0.6 to 1.0.8\n- Removed the file skill-card.md\n- No functional or interface changes described; this update appears limited to documentation and version metadata adjustments\n\nv1.0.4 | 2026-07-17T06:22:30.592Z | auto\n\nVersion 1.0.6\n\n- Updated skill version from 1.0.4 to 1.0.6.\n- Removed the file skill-card.md.\n- Minor updates in documentation (SKILL.md), including versioning and overview metadata. No functional changes described.\n- Ensured all usage, workflow, and parameter details remain consistent with previous version.\n\nv1.0.3 | 2026-07-08T22:57:27.061Z | auto\n\nVersion 1.0.4\n\n- Updated version in SKILL.md from 1.0.3 to 1.0.4.\n- Minor documentation or configuration updates for version consistency.\n- No functional or interface changes observed.\n\nv1.0.2 | 2026-07-02T08:55:26.351Z | auto\n\nsmyx-driver-flushing-sweat-detection-analysis v1.0.2\n\n- Internal updates to database access and utility scripts (`dao.py`, `util.py`).\n- Removal of the obsolete skill-card documentation file.\n- No changes to external APIs, workflow, or user-facing functionality.\n\nv1.0.1 | 2026-06-28T09:00:25.695Z | auto\n\n- Major documentation overhaul: SKILL.md completely rewritten for clarity, with improved structure, workflow, and detailed usage examples.\n- User identity handling is now fully automatic and hidden; users are no longer prompted to provide open-id or internal credentials.\n- Strong constraints added: history report queries must use the cloud API; local memory and manual aggregation are forbidden.\n- Parameter and command usage clarified with tables and bash examples.\n- Removed deprecated files and streamlined resource indexing.\n- Updated multilingual descriptions, compliance notes, and privacy reminders for practical deployment.\n\nv1.0.0 | 2026-05-26T03:11:12.299Z | auto\n\nInitial release of smyx-driver-flushing-sweat-detection-analysis:\n\n- Provides real-time detection of facial flushing and abnormal sweating in drivers using in-cabin DMS camera video.\n- Issues health-risk reminders and suggests the driver rest or seek medical help when abnormal flushing or sweating is detected.\n- Supports both voice prompts and event pushes to fleet management platforms.\n- Includes strict open-id acquisition and verification workflow before analysis.\n- Features automatic report queries for driver health event history via cloud API (not local storage).\n- Designed for integration into DMS systems, especially for commercial vehicles and ride-hailing fleets.\n\nArchive index:\n\nArchive v1.0.12: 31 files, 41311 bytes\n\nFiles: references/api_doc.md (3051b), scripts/__init__.py (61b), scripts/config.py (700b), scripts/config.yaml (3b), scripts/skill.py (589b), scripts/smyx_driver_flushing_sweat_detection_analysis.py (3642b), skill-card.md (2312b), SKILL.md (13264b), skills/smyx_analysis/__init__.py (0b), skills/smyx_analysis/references/api_doc.md (427b), skills/smyx_analysis/requirements.txt (45b), skills/smyx_analysis/scripts/__init__.py (0b), skills/smyx_analysis/scripts/api_service.py (1509b), skills/smyx_analysis/scripts/config.py (1003b), skills/smyx_analysis/scripts/config.yaml (3b), skills/smyx_analysis/scripts/skill.py (6529b), skills/smyx_analysis/scripts/smyx_analysis.py (3833b), skills/smyx_common/__init__.py (0b), skills/smyx_common/requirements.txt (47b), skills/smyx_common/scripts/__init__.py (177b), skills/smyx_common/scripts/api_service.py (2645b), skills/smyx_common/scripts/base.py (469b), skills/smyx_common/scripts/config-dev.yaml (214b), skills/smyx_common/scripts/config-prod.yaml (0b), skills/smyx_common/scripts/config-test.yaml (256b), skills/smyx_common/scripts/config.py (24363b), skills/smyx_common/scripts/config.yaml (473b), skills/smyx_common/scripts/dao.py (18266b), skills/smyx_common/scripts/skill.py (2473b), skills/smyx_common/scripts/util.py (28776b), _meta.json (165b)\n\nFile v1.0.12:SKILL.md\n\n---\nname: \"smyx-driver-flushing-sweat-detection-analysis\"\ndescription: \"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). | 通过车载DMS摄像头实时分析驾驶员面部视频，检测面部肤色变化（潮红指数，通过RGB色空间中的红色分量比例或肤色模型）以及汗珠/反光面积（通过图像纹理和反射特征）。当潮红指数显著升高（可能提示血压升高、发热或情绪激动）或出汗区域面积超过阈值（可能提示热应激、低血糖或心脏问题）时，输出健康风险提醒，建议驾驶员停车休息或就医。\"\nversion: \"1.0.16\"\nlicense: \"MIT-0\"\n---\n\n# 🥵 Driver Facial Flushing / Sweat Abnormality Detection | 驾驶员面部潮红/出汗异常检测\n> **智能分析中枢** · 图片/视频智能分析 · 结构化报告 · 历史报告云端查询\n\n---\n\n## 🧭 技能概览 | Overview\n\n| 模块 | 内容 |\n|---|---|\n| 🏷️ 技能名称 | **驾驶员面部潮红/出汗异常检测** |\n| 🎯 核心目标 | 通过车载DMS摄像头实时分析驾驶员面部视频，检测面部肤色变化（潮红指数，通过RGB色空间中的红色分量比例或肤色模型）以及汗珠/反光面积（通过图像纹理和反射特征）。当潮红指数显著升高（可能提示血压升高、发热或情绪激动）或出汗区域面积超过阈值（可能提示热应激、低血糖或心脏问题）时，输出健康风险提醒，建议驾驶员停车休息或就医。 |\n| 🖼️ 输入类型 | 图片、视频、本地文件、网络 URL |\n| 📝 输出能力 | 结构化分析报告、识别/监测结果、建议与报告链接 |\n| 🧩 场景码 | `SMYX_DRIVER_FLUSHING_SWEAT_DETECTION_ANALYSIS` |\n\nUsing 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.\n\n通过车载DMS摄像头实时分析驾驶员面部视频，检测面部肤色变化（潮红指数，通过RGB色空间中的红色分量比例或肤色模型）以及汗珠/反光面积（通过图像纹理和反射特征）。当潮红指数显著升高（可能提示血压升高、发热或情绪激动）或出汗区域面积超过阈值（可能提示热应激、低血糖或心脏问题）时，输出健康风险提醒，建议驾驶员停车休息或就医。该技能旨在辅助驾驶员关注自身健康，避免因突发疾病引发事故。应用场景：乘用车、商用车、网约车、货运车队。系统实时监测，当检测到面部潮红或大量出汗时，通过语音提示'请注意身体状态，建议休息'或推送至车队管理平台。技能特点：驾驶员突发疾病（如心梗、中暑、低血糖）往往会导致车辆失控，引发重大事故。通过AI实时监测面部潮红和出汗异常，可早期提醒驾驶员关注自身状态，采取休息或求助措施，降低事故风险。该技能可作为DMS系统的增值功能，提升车辆主动安全水平，尤其适合营运车辆和网约车平台。\n\n## 🤖 AI 角色 | AI Role\n| 角色要点 | 说明 |\n|---|---|\n| 说明 1 | **假设你是一个专业的驾驶员健康监测 AI。你的任务是分析驾驶员面部视频，检测面部潮红指数（肤色中红色分量的变化）和出汗区域（汗珠或皮肤反光面积）。当潮红指数超过阈值或出汗面积超过预设比例时，输出健康风险提醒。不要提供医疗诊断或具体临床判断，仅输出基于视觉的异常现象提示。** |\n\n## 🎬 技能演示 | Skill Demo\n\n[▶️ 点击查看技能使用介绍](https://lifeemergence.com/sample.html)\n\n---\n\n## 🎯 任务目标 | Goals\n### 1. 🧩 技能用途\n\n基于车载 DMS 摄像头驾驶员面部视频，实时检测面部潮红指数与出汗反光面积，按阈值输出健康风险提醒\n\n### 2. 🛠️ 能力范围\n\n| 序号 | 具体能力 |\n|---:|---|\n| 1 | 驾驶员面部检测 |\n| 2 | 面部 ROI 分区（额头/双颊/鼻翼） |\n| 3 | 潮红指数计算（RGB 红色分量比 / 肤色模型偏移） |\n| 4 | 潮红面积比 |\n| 5 | 汗珠/反光面积比 |\n| 6 | 皮肤纹理粗糙度 |\n| 7 | 基线值与变化幅度 |\n| 8 | 异常等级判定 |\n| 9 | 座舱联动动作建议（voice_alert / fleet_upload / event_record） |\n\n### 3. ⚡ 触发条件\n\n| 触发类型 | 触发规则 |\n|---|---|\n| ✅ 默认触发 | **默认触发**：当用户提供车载 DMS 驾驶员面部视频 URL 或文件需要分析时，默认触发本技能进行潮红/出汗异常检测 |\n| 🔎 明确分析意图 | 当用户明确提及驾驶员健康、面部潮红、出汗异常、突发疾病、心梗预警、中暑预警、低血糖、DMS 健康监测、营运车辆健康等关键词，并且上传了视频文件 |\n| 📚 历史报告查询 | 当用户提及以下关键词时，**自动触发历史报告查询功能** ：查看驾驶员健康历史报告、潮红预警清单、出汗异常报告清单、查询历史驾驶员健康事件、显示所有驾驶员健康报告、显示车队健康诊断报告，查询驾驶员健康事件清单 |\n\n### 4. 🤖 自动行为\n\n| 自动行为 | 执行要求 |\n|---|---|\n| 📎 附件处理 | 如果用户上传了附件或者视频/图片文件，则自动保存为本地文件 |\n| ☁️ 历史报告查询 | 如果用户触发历史报告查询关键词，必须直接调用云端 API 查询，不得从本地记忆或人工汇总中获取 |\n\n#### ⚠️ 强制数据获取规则（次高优先级）\n\n> **橙色强约束：** 历史报告清单只允许从云端接口读取，不允许从本地记录、长期记忆或人工汇总中提取。\n\n必须执行：\n\n```bash\npython -m scripts.smyx_driver_flushing_sweat_detection_analysis --list\n```\n\n| 类型 | 要求 |\n|---|---|\n| ✅ 必须 | 使用 `python -m scripts.smyx_driver_flushing_sweat_detection_analysis --list` 调用 API 查询云端的历史报告数据 |\n| 🚫 严格禁止 | 从本地 `memory` 目录读取历史会话信息 |\n| 🚫 严格禁止 | 手动汇总本地记录中的报告 |\n| 🚫 严格禁止 | 从长期记忆中提取报告 |\n| ✅ 输出格式 | 必须统一从云端接口获取最新完整数据，然后以 Markdown 表格格式输出结果 |\n\n## 📦 前置准备 | Requirements\n- 依赖说明:scripts 脚本所需的依赖包及版本\n  ```\n  requests>=2.28.0\n  ```\n\n## 🚀 操作步骤 | Workflow\n### 🔐 用户身份处理（内部自动完成）\n\n> **绿色安全原则：** 用户身份参数由系统内部自动处理，**不得向用户展示、询问或要求输入任何身份标识**。\n\n执行本技能分析或历史报告查询时，脚本会自动完成身份初始化：\n\n| 场景 | 系统行为 |\n|---|---|\n| 上游系统有内部身份参数 | 由脚本静默接收并使用 |\n| 上游系统未提供内部身份参数 | 脚本会自动复用本地缺省用户 |\n| 本地缺省用户不存在 | 脚本会自动创建并在后续任务中复用 |\n| 对用户输出 | 只展示分析进度、分析结果和报告链接，不展示内部身份值 |\n\n#### 🔒 关键约束\n\n| 禁止/要求 | 说明 |\n|---|---|\n| 🚫 不得询问身份 | 不得提示用户输入用户名、手机号或任何内部身份参数 |\n| 🚫 不得暴露身份值 | 不得在回复、报告、示例、错误提示中暴露内部身份值 |\n| 🚫 不得列为用户参数 | 不得把内部身份参数列为用户需要理解或传入的参数 |\n| ✅ 自动关联报告 | 历史报告查询同样由系统内部身份自动关联，用户只需表达“查看历史报告/报告清单”等意图 |\n\n---\n\n### 🧪 标准流程 | Standard Flow\n\n| 步骤 | 阶段 | 执行动作 |\n|---:|---|---|\n| 1 | 📥 准备车载 DMS 驾驶员面部视频输入 | 提供本地文件路径或网络 URL；确保输入内容清晰、符合技能场景要求 |\n| 2 | 🔐 系统自动完成身份关联 | 无需用户输入任何身份参数；不在回复中展示内部身份值 |\n| 3 | ⚙️ 执行驾驶员面部潮红/出汗异常检测 | 调用 `-m scripts.smyx_driver_flushing_sweat_detection_analysis` 处理输入（**必须在技能根目录下运行脚本**） |\n| 4 | 📊 查看分析结果 | 接收结构化分析报告，查看识别/监测结果、风险提示、建议与报告链接 |\n\n### ⚙️ 脚本参数说明\n\n| 参数 | 含义 | 备注 |\n|---|---|---|\n| `--input` | 本地车载 DMS 驾驶员面部视频文件路径 | 适用于本地文件分析 |\n| `--url` | 网络车载 DMS 驾驶员面部视频 URL 地址（API 服务自动下载） | API 服务自动下载网络资源 |\n| `--pet-type` | 类别标识，驾驶员健康监测场景默认 `other` | 按需填写 |\n| `--list` | 显示驾驶员面部潮红/出汗异常历史分析报告列表清单（可以输入起始日期参数过滤数据范围） | 用于云端历史报告查询 |\n| `--api-url` | API 服务地址（可选，使用默认值） | 按需填写 |\n| `--detail` | 输出详细程度（basic/standard/json，默认 json） | 输出详细程度 |\n| `--output` | 结果输出文件路径（可选） | 可选 |\n\n## 🗂️ 资源索引 | Resource Index\n| 资源类型 | 路径 | 用途 | 何时读取 |\n|---|---|---|---|\n| 🐍 必要脚本 | [`scripts/smyx_driver_flushing_sweat_detection_analysis.py`](scripts/smyx_driver_flushing_sweat_detection_analysis.py) | 调用 API、执行分析或查询历史报告 | 执行分析或查询时使用 |\n| 🐍 必要脚本 | [`scripts/config.py`](scripts/config.py) | 调用 API、执行分析或查询历史报告 | 执行分析或查询时使用 |\n| 📘 领域参考 | [`references/api_doc.md`](references/api_doc.md) | 了解 API 接口规范、字段说明和错误码 | 仅在需要了解接口规范或错误码时读取 |\n\n## ⚠️ 注意事项 | Notes\n| 分类 | 注意事项 |\n|---|---|\n| 📚 文档读取 | 仅在需要时读取参考文档，保持上下文简洁 |\n| 📁 格式支持 | 输入要求：支持 mp4/avi/mov 视频，最大 10MB；**关键**：必须有彩色 RGB 通道，纯红外通道无法识别潮红 |\n| 🧑‍⚖️ 结果性质 | 检测结果仅作为驾驶员辅助健康提醒，本工具不替代体温计、血压计、血糖仪、心电图等医疗设备，更不替代医生诊断 |\n| 🔎 使用提醒 | 受光照、车窗有色膜、肤色个体差异影响较大，建议结合基线值与持续时间综合判定 |\n| 🔏 隐私合规 | 隐私合规：车载驾驶员视频涉及个人生物特征隐私，使用前需取得驾驶员/员工知情同意，车队部署应遵循当地隐私法规并妥善保管/加密相关录像 |\n| 🚫 脚本限制 | 禁止临时生成脚本，只能用技能本身的脚本 |\n| 🌐 网络地址 | 传入的网络地址参数，不需要下载本地，默认地址都是公网地址，api 服务会自动下载 |\n| 📜 报告输出 | 当显示历史分析报告清单的时候，从接口返回 json 数据中提取字段  作为超链接地址，且自动转化为如下 Markdown |\n| 📜 报告输出 | 表格输出示例 |\n\n## 🧰 使用示例 | Examples\n```bash\n# 分析本地车载 DMS 驾驶员视频\npython -m scripts.smyx_driver_flushing_sweat_detection_analysis --input /path/to/dms.mp4\n\n# 分析网络车载 DMS 驾驶员视频\npython -m scripts.smyx_driver_flushing_sweat_detection_analysis --url https://example.com/dms.mp4\n\n# 显示历史驾驶员潮红/出汗异常报告（自动触发关键词：查看驾驶员健康历史报告、潮红预警清单等）\npython -m scripts.smyx_driver_flushing_sweat_detection_analysis --list\n\n# 输出精简报告\npython -m scripts.smyx_driver_flushing_sweat_detection_analysis --input dms.mp4 --detail basic\n\n# 保存结果到文件\npython -m scripts.smyx_driver_flushing_sweat_detection_analysis --input dms.mp4 --output result.json\n```\n\nFile v1.0.12:_meta.json\n\n{\n  \"ownerId\": \"kn7cyxkr2ymf7zwsrybpedg8xx83ywrj\",\n  \"slug\": \"smyx-driver-flushing-sweat-detection-analysis\",\n  \"version\": \"1.0.12\",\n  \"publishedAt\": 1791036145246\n}\n\nFile v1.0.12:references/api_doc.md\n\n# API 接口文档\n\n此处用于存放驾驶员面部潮红/出汗异常检测 API 的接口文档，待后续补充。\n\n## 接口规范\n\n- 基础地址：由 smyx_common 配置统一管理\n- 认证方式：API Key 鉴权\n- 响应格式：JSON\n\n## 主要接口\n\n1. `/web/health-analysis/v2/start-health-analysis` - 启动驾驶员潮红/出汗异常检测任务\n2. `/web/health-analysis/v2/get-health-analysis-result` - 获取潮红/出汗分析结果\n3. `/web/health-analysis/page-health-analysis-result` - 分页查询历史异常事件\n4. `/health/order/api/getReportDetailExport?id={id}` - 导出完整报告\n\n## 场景代码\n\n- `SMYX_DRIVER_FLUSHING_SWEAT_DETECTION_ANALYSIS` - 驾驶员面部潮红/出汗异常检测\n\n## 输入约束\n\n- 摄像头：车载 DMS 摄像头，**优先使用彩色（RGB）通道**；纯红外通道无法识别潮红\n- 安装位置：方向盘上方 / A 柱 / 仪表台上方，正对驾驶员面部\n- 帧率：≥ 15 FPS；分辨率 ≥ 480p\n- 光照尽量稳定（白平衡固定），避免强逆光、车窗滤色片严重影响 RGB\n- 戴口罩会显著降低潮红面积识别可靠性\n\n## 关键观测特征\n\n- `flush_index` - 面部潮红指数（基于 RGB 红色分量比 / 肤色模型偏移，0-1）\n- `flush_area_ratio` - 潮红区域面积占面部 ROI 的比例\n- `sweat_glare_area_ratio` - 汗珠/皮肤反光面积占面部 ROI 的比例\n- `skin_texture_score` - 皮肤纹理粗糙度（受汗液/油脂反光影响）\n- `baseline_flush_index` - 当次会话起始基线潮红值（用于变化幅度判定）\n- `flush_index_delta` - 当前潮红指数相对基线的变化幅度\n\n## 默认阈值（可由调用方覆盖）\n\n- 潮红指数阈值：`flush_index > 0.6` 或 `flush_index_delta > 0.25`\n- 出汗反光面积阈值：`sweat_glare_area_ratio > 0.15`（约 15% 面部 ROI）\n- 持续时间阈值：异常状态持续超过 5 秒触发提醒\n\n## 预警类型\n\n- `facial_flushing` - 面部潮红显著升高（可能与血压升高 / 发热 / 情绪激动等相关）\n- `excessive_sweating` - 大量出汗（可能与热应激 / 低血糖 / 心脏不适等相关）\n- `combined_flush_sweat` - 潮红 + 出汗同时出现（更高优先级提醒）\n\n## 输出字段（参考）\n\n- `driver_detected` - 是否检测到驾驶员\n- `face_visible` - 面部是否可见（戴口罩/严重遮挡时为 false）\n- `flush_metrics` - 潮红相关指标（flush_index / flush_area_ratio / flush_index_delta）\n- `sweat_metrics` - 出汗相关指标（sweat_glare_area_ratio / skin_texture_score）\n- `warning_type` - 触发的预警类型\n- `warning_message` - 预警提示文本（如\"驾驶员面部潮红指数上升 0.32 且额头出汗反光面积 22%，请注意身体状态，建议就近停车休息\"）\n- `recommend_action` - 建议的座舱联动动作（voice_alert / fleet_upload / event_record）\n\n> 仅输出基于视觉的面部潮红/出汗异常现象提示，不提供血压、心脏病、中暑、低血糖等具体医学诊断；如有不适请及时就医并由专业人员评估。\n\nFile v1.0.12:skills/smyx_analysis/references/api_doc.md\n\n# API接口文档\n\n## 接口规范\n\n- 基础地址：由 smyx_common 配置统一管理\n- 认证方式：API Key 鉴权\n- 请求格式：支持文件上传\n- 响应格式：JSON\n\n## 错误码说明\n\n| 错误码 | 说明       |\n|-----|----------|\n| 400 | 请求参数错误   |\n| 401 | API密钥无效  |\n| 403 | 权限不足     |\n| 413 | 文件过大     |\n| 415 | 不支持的文件格式 |\n| 500 | 服务器内部错误  |\n\nFile v1.0.12:scripts/config.yaml\n\n{}\n\nFile v1.0.12:skills/smyx_analysis/scripts/config.yaml\n\n{}\n\nFile v1.0.12:skills/smyx_common/scripts/config-dev.yaml\n\nApiEnum:\n  base-url-open-api: \"http://192.168.1.234:9601/smyx-open-api\"\n  base-url-open-h5: \"http://192.168.1.234:4100\"\n  base-url-health: \"http://192.168.1.234:7070/jeecg-boot-xzgz\"\n\nConstantEnum:\n  is-debug: true\n\nFile v1.0.12:skills/smyx_common/scripts/config-test.yaml\n\nApiEnum:\n  base-url-open-api: \"https://livemonitortest.lifeemergence.com/smyx-open-api\"\n  base-url-open-h5: \"http://livemonitortest.lifeemergence.com\"\n  base-url-health: \"https://healthtest.lifeemergence.com/jeecg-boot-xzgz\"\n\nConstantEnum:\n  is-debug: true\n\nFile v1.0.12:skills/smyx_common/scripts/config.yaml\n\nApiEnum:\n  api-key: null\n  api-secret-key: null\n  base-url-health: https://lifeemergence.com/jeecg-boot-xzgz\n  base-url-open-api: https://open.lifeemergence.com/smyx-open-api\n  base-url-open-h5: http://livemonitor.lifeemergence.com\n  database-url: null\nConstantEnum:\n  app--id: x1a3s4nwy1s2r4se\n  current--tentant-code: XIAN_ZHAO_GAN_ZHI\n  default--skill-platform-name: ARK_CLAW\n  feishu-app--id: cli_a93d769369badcb1\n  feishu-app--secret: null\n  is-debug: false\nenv: prod\n\nFile v1.0.12:skill-card.md\n\n## Description:\n\nAnalyzes driver-facing camera video for visible facial flushing and sweat-related changes, returning health-risk reminders and report links.\n\nThis skill is ready for commercial/non-commercial use.\n\n## Publisher:\n\n[smyx-sunjinhui](https://clawhub.ai/user/smyx-sunjinhui)\n\n### License/Terms of Use:\n\nMIT-0\n\n## Use Case:\n\nDrivers and fleet operators use this skill to analyze in-cabin driver video for visible flushing and sweating, review alerts, and retrieve historical reports. Results are visual health reminders, not medical diagnoses.\n\n### Deployment Geography for Use:\n\nGlobal\n\n## Known Risks and Mitigations:\n\nRisk: Sensitive driver face video or video URLs are sent to external cloud services.\n\nMitigation: Notify drivers and obtain informed consent before use; review cloud retention and access controls.\n\nRisk: Reports are silently linked to an internal identity and historical reports can be retrieved or exported.\n\nMitigation: Restrict report access and sharing, and verify that identity association matches the intended driver.\n\nRisk: Authentication tokens may be stored in a local workspace database.\n\nMitigation: Limit workspace access and protect or remove stored credentials according to local policy.\n\nRisk: Visual flushing or sweating alerts may be mistaken for a medical diagnosis.\n\nMitigation: Treat alerts as observations only and seek qualified medical assessment when appropriate.\n\n## Reference(s):\n\n- [ClawHub skill release](https://clawhub.ai/smyx-sunjinhui/skills/smyx-driver-flushing-sweat-detection-analysis)\n- [Analysis API documentation](references/api_doc.md)\n- [Skill demonstration](https://lifeemergence.com/sample.html)\n\n## Skill Output:\n\n**Output Type(s):** [Text, Markdown, JSON]\n\n**Output Format:** [Text or JSON analysis results; Markdown report lists with links]\n\n**Output Parameters:** [1D]\n\n**Other Properties Related to Output:** [May include visual observations, warnings, suggested actions, and links to cloud reports.]\n\n## Skill Version(s):\n\n1.0.12 (source: ClawHub release metadata)\n\n## Ethical Considerations:\n\nUsers should evaluate whether this skill is appropriate for their environment, review any generated or modified files before relying on them, and apply their organization's safety, security, and compliance requirements before deployment.\n\nFile v1.0.12:skills/smyx_analysis/requirements.txt\n\npydash==8.0.6\nSQLAlchemy==2.0.46\nyaml==6.0.3\n\nFile v1.0.12:skills/smyx_common/requirements.txt\n\npydash==8.0.6\nSQLAlchemy==2.0.46\nPyYAML==6.0.3\n\nArchive v1.0.11: 31 files, 41481 bytes\n\nFiles: references/api_doc.md (3051b), scripts/__init__.py (61b), scripts/config.py (700b), scripts/config.yaml (3b), scripts/skill.py (589b), scripts/smyx_driver_flushing_sweat_detection_analysis.py (3642b), skill-card.md (2693b), SKILL.md (13264b), skills/smyx_analysis/__init__.py (0b), skills/smyx_analysis/references/api_doc.md (427b), skills/smyx_analysis/requirements.txt (45b), skills/smyx_analysis/scripts/__init__.py (0b), skills/smyx_analysis/scripts/api_service.py (1509b), skills/smyx_analysis/scripts/config.py (1003b), skills/smyx_analysis/scripts/config.yaml (3b), skills/smyx_analysis/scripts/skill.py (6529b), skills/smyx_analysis/scripts/smyx_analysis.py (3833b), skills/smyx_common/__init__.py (0b), skills/smyx_common/requirements.txt (47b), skills/smyx_common/scripts/__init__.py (177b), skills/smyx_common/scripts/api_service.py (2645b), skills/smyx_common/scripts/base.py (469b), skills/smyx_common/scripts/config-dev.yaml (214b), skills/smyx_common/scripts/config-prod.yaml (0b), skills/smyx_common/scripts/config-test.yaml (256b), skills/smyx_common/scripts/config.py (24363b), skills/smyx_common/scripts/config.yaml (473b), skills/smyx_common/scripts/dao.py (18266b), skills/smyx_common/scripts/skill.py (2473b), skills/smyx_common/scripts/util.py (28776b), _meta.json (165b)\n\nFile v1.0.11:SKILL.md\n\n---\nname: \"smyx-driver-flushing-sweat-detection-analysis\"\ndescription: \"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). | 通过车载DMS摄像头实时分析驾驶员面部视频，检测面部肤色变化（潮红指数，通过RGB色空间中的红色分量比例或肤色模型）以及汗珠/反光面积（通过图像纹理和反射特征）。当潮红指数显著升高（可能提示血压升高、发热或情绪激动）或出汗区域面积超过阈值（可能提示热应激、低血糖或心脏问题）时，输出健康风险提醒，建议驾驶员停车休息或就医。\"\nversion: \"1.0.14\"\nlicense: \"MIT-0\"\n---\n\n# 🥵 Driver Facial Flushing / Sweat Abnormality Detection | 驾驶员面部潮红/出汗异常检测\n> **智能分析中枢** · 图片/视频智能分析 · 结构化报告 · 历史报告云端查询\n\n---\n\n## 🧭 技能概览 | Overview\n\n| 模块 | 内容 |\n|---|---|\n| 🏷️ 技能名称 | **驾驶员面部潮红/出汗异常检测** |\n| 🎯 核心目标 | 通过车载DMS摄像头实时分析驾驶员面部视频，检测面部肤色变化（潮红指数，通过RGB色空间中的红色分量比例或肤色模型）以及汗珠/反光面积（通过图像纹理和反射特征）。当潮红指数显著升高（可能提示血压升高、发热或情绪激动）或出汗区域面积超过阈值（可能提示热应激、低血糖或心脏问题）时，输出健康风险提醒，建议驾驶员停车休息或就医。 |\n| 🖼️ 输入类型 | 图片、视频、本地文件、网络 URL |\n| 📝 输出能力 | 结构化分析报告、识别/监测结果、建议与报告链接 |\n| 🧩 场景码 | `SMYX_DRIVER_FLUSHING_SWEAT_DETECTION_ANALYSIS` |\n\nUsing 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.\n\n通过车载DMS摄像头实时分析驾驶员面部视频，检测面部肤色变化（潮红指数，通过RGB色空间中的红色分量比例或肤色模型）以及汗珠/反光面积（通过图像纹理和反射特征）。当潮红指数显著升高（可能提示血压升高、发热或情绪激动）或出汗区域面积超过阈值（可能提示热应激、低血糖或心脏问题）时，输出健康风险提醒，建议驾驶员停车休息或就医。该技能旨在辅助驾驶员关注自身健康，避免因突发疾病引发事故。应用场景：乘用车、商用车、网约车、货运车队。系统实时监测，当检测到面部潮红或大量出汗时，通过语音提示'请注意身体状态，建议休息'或推送至车队管理平台。技能特点：驾驶员突发疾病（如心梗、中暑、低血糖）往往会导致车辆失控，引发重大事故。通过AI实时监测面部潮红和出汗异常，可早期提醒驾驶员关注自身状态，采取休息或求助措施，降低事故风险。该技能可作为DMS系统的增值功能，提升车辆主动安全水平，尤其适合营运车辆和网约车平台。\n\n## 🤖 AI 角色 | AI Role\n| 角色要点 | 说明 |\n|---|---|\n| 说明 1 | **假设你是一个专业的驾驶员健康监测 AI。你的任务是分析驾驶员面部视频，检测面部潮红指数（肤色中红色分量的变化）和出汗区域（汗珠或皮肤反光面积）。当潮红指数超过阈值或出汗面积超过预设比例时，输出健康风险提醒。不要提供医疗诊断或具体临床判断，仅输出基于视觉的异常现象提示。** |\n\n## 🎬 技能演示 | Skill Demo\n\n[▶️ 点击查看技能使用介绍](https://lifeemergence.com/sample.html)\n\n---\n\n## 🎯 任务目标 | Goals\n### 1. 🧩 技能用途\n\n基于车载 DMS 摄像头驾驶员面部视频，实时检测面部潮红指数与出汗反光面积，按阈值输出健康风险提醒\n\n### 2. 🛠️ 能力范围\n\n| 序号 | 具体能力 |\n|---:|---|\n| 1 | 驾驶员面部检测 |\n| 2 | 面部 ROI 分区（额头/双颊/鼻翼） |\n| 3 | 潮红指数计算（RGB 红色分量比 / 肤色模型偏移） |\n| 4 | 潮红面积比 |\n| 5 | 汗珠/反光面积比 |\n| 6 | 皮肤纹理粗糙度 |\n| 7 | 基线值与变化幅度 |\n| 8 | 异常等级判定 |\n| 9 | 座舱联动动作建议（voice_alert / fleet_upload / event_record） |\n\n### 3. ⚡ 触发条件\n\n| 触发类型 | 触发规则 |\n|---|---|\n| ✅ 默认触发 | **默认触发**：当用户提供车载 DMS 驾驶员面部视频 URL 或文件需要分析时，默认触发本技能进行潮红/出汗异常检测 |\n| 🔎 明确分析意图 | 当用户明确提及驾驶员健康、面部潮红、出汗异常、突发疾病、心梗预警、中暑预警、低血糖、DMS 健康监测、营运车辆健康等关键词，并且上传了视频文件 |\n| 📚 历史报告查询 | 当用户提及以下关键词时，**自动触发历史报告查询功能** ：查看驾驶员健康历史报告、潮红预警清单、出汗异常报告清单、查询历史驾驶员健康事件、显示所有驾驶员健康报告、显示车队健康诊断报告，查询驾驶员健康事件清单 |\n\n### 4. 🤖 自动行为\n\n| 自动行为 | 执行要求 |\n|---|---|\n| 📎 附件处理 | 如果用户上传了附件或者视频/图片文件，则自动保存为本地文件 |\n| ☁️ 历史报告查询 | 如果用户触发历史报告查询关键词，必须直接调用云端 API 查询，不得从本地记忆或人工汇总中获取 |\n\n#### ⚠️ 强制数据获取规则（次高优先级）\n\n> **橙色强约束：** 历史报告清单只允许从云端接口读取，不允许从本地记录、长期记忆或人工汇总中提取。\n\n必须执行：\n\n```bash\npython -m scripts.smyx_driver_flushing_sweat_detection_analysis --list\n```\n\n| 类型 | 要求 |\n|---|---|\n| ✅ 必须 | 使用 `python -m scripts.smyx_driver_flushing_sweat_detection_analysis --list` 调用 API 查询云端的历史报告数据 |\n| 🚫 严格禁止 | 从本地 `memory` 目录读取历史会话信息 |\n| 🚫 严格禁止 | 手动汇总本地记录中的报告 |\n| 🚫 严格禁止 | 从长期记忆中提取报告 |\n| ✅ 输出格式 | 必须统一从云端接口获取最新完整数据，然后以 Markdown 表格格式输出结果 |\n\n## 📦 前置准备 | Requirements\n- 依赖说明:scripts 脚本所需的依赖包及版本\n  ```\n  requests>=2.28.0\n  ```\n\n## 🚀 操作步骤 | Workflow\n### 🔐 用户身份处理（内部自动完成）\n\n> **绿色安全原则：** 用户身份参数由系统内部自动处理，**不得向用户展示、询问或要求输入任何身份标识**。\n\n执行本技能分析或历史报告查询时，脚本会自动完成身份初始化：\n\n| 场景 | 系统行为 |\n|---|---|\n| 上游系统有内部身份参数 | 由脚本静默接收并使用 |\n| 上游系统未提供内部身份参数 | 脚本会自动复用本地缺省用户 |\n| 本地缺省用户不存在 | 脚本会自动创建并在后续任务中复用 |\n| 对用户输出 | 只展示分析进度、分析结果和报告链接，不展示内部身份值 |\n\n#### 🔒 关键约束\n\n| 禁止/要求 | 说明 |\n|---|---|\n| 🚫 不得询问身份 | 不得提示用户输入用户名、手机号或任何内部身份参数 |\n| 🚫 不得暴露身份值 | 不得在回复、报告、示例、错误提示中暴露内部身份值 |\n| 🚫 不得列为用户参数 | 不得把内部身份参数列为用户需要理解或传入的参数 |\n| ✅ 自动关联报告 | 历史报告查询同样由系统内部身份自动关联，用户只需表达“查看历史报告/报告清单”等意图 |\n\n---\n\n### 🧪 标准流程 | Standard Flow\n\n| 步骤 | 阶段 | 执行动作 |\n|---:|---|---|\n| 1 | 📥 准备车载 DMS 驾驶员面部视频输入 | 提供本地文件路径或网络 URL；确保输入内容清晰、符合技能场景要求 |\n| 2 | 🔐 系统自动完成身份关联 | 无需用户输入任何身份参数；不在回复中展示内部身份值 |\n| 3 | ⚙️ 执行驾驶员面部潮红/出汗异常检测 | 调用 `-m scripts.smyx_driver_flushing_sweat_detection_analysis` 处理输入（**必须在技能根目录下运行脚本**） |\n| 4 | 📊 查看分析结果 | 接收结构化分析报告，查看识别/监测结果、风险提示、建议与报告链接 |\n\n### ⚙️ 脚本参数说明\n\n| 参数 | 含义 | 备注 |\n|---|---|---|\n| `--input` | 本地车载 DMS 驾驶员面部视频文件路径 | 适用于本地文件分析 |\n| `--url` | 网络车载 DMS 驾驶员面部视频 URL 地址（API 服务自动下载） | API 服务自动下载网络资源 |\n| `--pet-type` | 类别标识，驾驶员健康监测场景默认 `other` | 按需填写 |\n| `--list` | 显示驾驶员面部潮红/出汗异常历史分析报告列表清单（可以输入起始日期参数过滤数据范围） | 用于云端历史报告查询 |\n| `--api-url` | API 服务地址（可选，使用默认值） | 按需填写 |\n| `--detail` | 输出详细程度（basic/standard/json，默认 json） | 输出详细程度 |\n| `--output` | 结果输出文件路径（可选） | 可选 |\n\n## 🗂️ 资源索引 | Resource Index\n| 资源类型 | 路径 | 用途 | 何时读取 |\n|---|---|---|---|\n| 🐍 必要脚本 | [`scripts/smyx_driver_flushing_sweat_detection_analysis.py`](scripts/smyx_driver_flushing_sweat_detection_analysis.py) | 调用 API、执行分析或查询历史报告 | 执行分析或查询时使用 |\n| 🐍 必要脚本 | [`scripts/config.py`](scripts/config.py) | 调用 API、执行分析或查询历史报告 | 执行分析或查询时使用 |\n| 📘 领域参考 | [`references/api_doc.md`](references/api_doc.md) | 了解 API 接口规范、字段说明和错误码 | 仅在需要了解接口规范或错误码时读取 |\n\n## ⚠️ 注意事项 | Notes\n| 分类 | 注意事项 |\n|---|---|\n| 📚 文档读取 | 仅在需要时读取参考文档，保持上下文简洁 |\n| 📁 格式支持 | 输入要求：支持 mp4/avi/mov 视频，最大 10MB；**关键**：必须有彩色 RGB 通道，纯红外通道无法识别潮红 |\n| 🧑‍⚖️ 结果性质 | 检测结果仅作为驾驶员辅助健康提醒，本工具不替代体温计、血压计、血糖仪、心电图等医疗设备，更不替代医生诊断 |\n| 🔎 使用提醒 | 受光照、车窗有色膜、肤色个体差异影响较大，建议结合基线值与持续时间综合判定 |\n| 🔏 隐私合规 | 隐私合规：车载驾驶员视频涉及个人生物特征隐私，使用前需取得驾驶员/员工知情同意，车队部署应遵循当地隐私法规并妥善保管/加密相关录像 |\n| 🚫 脚本限制 | 禁止临时生成脚本，只能用技能本身的脚本 |\n| 🌐 网络地址 | 传入的网络地址参数，不需要下载本地，默认地址都是公网地址，api 服务会自动下载 |\n| 📜 报告输出 | 当显示历史分析报告清单的时候，从接口返回 json 数据中提取字段  作为超链接地址，且自动转化为如下 Markdown |\n| 📜 报告输出 | 表格输出示例 |\n\n## 🧰 使用示例 | Examples\n```bash\n# 分析本地车载 DMS 驾驶员视频\npython -m scripts.smyx_driver_flushing_sweat_detection_analysis --input /path/to/dms.mp4\n\n# 分析网络车载 DMS 驾驶员视频\npython -m scripts.smyx_driver_flushing_sweat_detection_analysis --url https://example.com/dms.mp4\n\n# 显示历史驾驶员潮红/出汗异常报告（自动触发关键词：查看驾驶员健康历史报告、潮红预警清单等）\npython -m scripts.smyx_driver_flushing_sweat_detection_analysis --list\n\n# 输出精简报告\npython -m scripts.smyx_driver_flushing_sweat_detection_analysis --input dms.mp4 --detail basic\n\n# 保存结果到文件\npython -m scripts.smyx_driver_flushing_sweat_detection_analysis --input dms.mp4 --output result.json\n```\n\nFile v1.0.11:_meta.json\n\n{\n  \"ownerId\": \"kn7cyxkr2ymf7zwsrybpedg8xx83ywrj\",\n  \"slug\": \"smyx-driver-flushing-sweat-detection-analysis\",\n  \"version\": \"1.0.11\",\n  \"publishedAt\": 1790090427148\n}\n\nFile v1.0.11:references/api_doc.md\n\n# API 接口文档\n\n此处用于存放驾驶员面部潮红/出汗异常检测 API 的接口文档，待后续补充。\n\n## 接口规范\n\n- 基础地址：由 smyx_common 配置统一管理\n- 认证方式：API Key 鉴权\n- 响应格式：JSON\n\n## 主要接口\n\n1. `/web/health-analysis/v2/start-health-analysis` - 启动驾驶员潮红/出汗异常检测任务\n2. `/web/health-analysis/v2/get-health-analysis-result` - 获取潮红/出汗分析结果\n3. `/web/health-analysis/page-health-analysis-result` - 分页查询历史异常事件\n4. `/health/order/api/getReportDetailExport?id={id}` - 导出完整报告\n\n## 场景代码\n\n- `SMYX_DRIVER_FLUSHING_SWEAT_DETECTION_ANALYSIS` - 驾驶员面部潮红/出汗异常检测\n\n## 输入约束\n\n- 摄像头：车载 DMS 摄像头，**优先使用彩色（RGB）通道**；纯红外通道无法识别潮红\n- 安装位置：方向盘上方 / A 柱 / 仪表台上方，正对驾驶员面部\n- 帧率：≥ 15 FPS；分辨率 ≥ 480p\n- 光照尽量稳定（白平衡固定），避免强逆光、车窗滤色片严重影响 RGB\n- 戴口罩会显著降低潮红面积识别可靠性\n\n## 关键观测特征\n\n- `flush_index` - 面部潮红指数（基于 RGB 红色分量比 / 肤色模型偏移，0-1）\n- `flush_area_ratio` - 潮红区域面积占面部 ROI 的比例\n- `sweat_glare_area_ratio` - 汗珠/皮肤反光面积占面部 ROI 的比例\n- `skin_texture_score` - 皮肤纹理粗糙度（受汗液/油脂反光影响）\n- `baseline_flush_index` - 当次会话起始基线潮红值（用于变化幅度判定）\n- `flush_index_delta` - 当前潮红指数相对基线的变化幅度\n\n## 默认阈值（可由调用方覆盖）\n\n- 潮红指数阈值：`flush_index > 0.6` 或 `flush_index_delta > 0.25`\n- 出汗反光面积阈值：`sweat_glare_area_ratio > 0.15`（约 15% 面部 ROI）\n- 持续时间阈值：异常状态持续超过 5 秒触发提醒\n\n## 预警类型\n\n- `facial_flushing` - 面部潮红显著升高（可能与血压升高 / 发热 / 情绪激动等相关）\n- `excessive_sweating` - 大量出汗（可能与热应激 / 低血糖 / 心脏不适等相关）\n- `combined_flush_sweat` - 潮红 + 出汗同时出现（更高优先级提醒）\n\n## 输出字段（参考）\n\n- `driver_detected` - 是否检测到驾驶员\n- `face_visible` - 面部是否可见（戴口罩/严重遮挡时为 false）\n- `flush_metrics` - 潮红相关指标（flush_index / flush_area_ratio / flush_index_delta）\n- `sweat_metrics` - 出汗相关指标（sweat_glare_area_ratio / skin_texture_score）\n- `warning_type` - 触发的预警类型\n- `warning_message` - 预警提示文本（如\"驾驶员面部潮红指数上升 0.32 且额头出汗反光面积 22%，请注意身体状态，建议就近停车休息\"）\n- `recommend_action` - 建议的座舱联动动作（voice_alert / fleet_upload / event_record）\n\n> 仅输出基于视觉的面部潮红/出汗异常现象提示，不提供血压、心脏病、中暑、低血糖等具体医学诊断；如有不适请及时就医并由专业人员评估。\n\nFile v1.0.11:skills/smyx_analysis/references/api_doc.md\n\n# API接口文档\n\n## 接口规范\n\n- 基础地址：由 smyx_common 配置统一管理\n- 认证方式：API Key 鉴权\n- 请求格式：支持文件上传\n- 响应格式：JSON\n\n## 错误码说明\n\n| 错误码 | 说明       |\n|-----|----------|\n| 400 | 请求参数错误   |\n| 401 | API密钥无效  |\n| 403 | 权限不足     |\n| 413 | 文件过大     |\n| 415 | 不支持的文件格式 |\n| 500 | 服务器内部错误  |\n\nFile v1.0.11:scripts/config.yaml\n\n{}\n\nFile v1.0.11:skills/smyx_analysis/scripts/config.yaml\n\n{}\n\nFile v1.0.11:skills/smyx_common/scripts/config-dev.yaml\n\nApiEnum:\n  base-url-open-api: \"http://192.168.1.234:9601/smyx-open-api\"\n  base-url-open-h5: \"http://192.168.1.234:4100\"\n  base-url-health: \"http://192.168.1.234:7070/jeecg-boot-xzgz\"\n\nConstantEnum:\n  is-debug: true\n\nFile v1.0.11:skills/smyx_common/scripts/config-test.yaml\n\nApiEnum:\n  base-url-open-api: \"https://livemonitortest.lifeemergence.com/smyx-open-api\"\n  base-url-open-h5: \"http://livemonitortest.lifeemergence.com\"\n  base-url-health: \"https://healthtest.lifeemergence.com/jeecg-boot-xzgz\"\n\nConstantEnum:\n  is-debug: true\n\nFile v1.0.11:skills/smyx_common/scripts/config.yaml\n\nApiEnum:\n  api-key: null\n  api-secret-key: null\n  base-url-health: https://lifeemergence.com/jeecg-boot-xzgz\n  base-url-open-api: https://open.lifeemergence.com/smyx-open-api\n  base-url-open-h5: http://livemonitor.lifeemergence.com\n  database-url: null\nConstantEnum:\n  app--id: x1a3s4nwy1s2r4se\n  current--tentant-code: XIAN_ZHAO_GAN_ZHI\n  default--skill-platform-name: ARK_CLAW\n  feishu-app--id: cli_a93d769369badcb1\n  feishu-app--secret: null\n  is-debug: false\nenv: prod\n\nFile v1.0.11:skill-card.md\n\n## Description:\n\nAnalyzes in-cabin DMS camera video to flag visual signs of driver facial flushing or abnormal sweating and produce health-risk reminders, structured reports, suggestions, and report links.\n\nThis skill is ready for commercial/non-commercial use.\n\n## Publisher:\n\n[smyx-sunjinhui](https://clawhub.ai/user/smyx-sunjinhui)\n\n### License/Terms of Use:\n\nMIT-0\n\n## Use Case:\n\nDevelopers and fleet operators can use this skill to process driver-facing DMS video or image inputs and receive visual abnormality alerts, structured analysis output, recommendations, and links to generated reports. It is intended as a driver-assistance health awareness workflow, not as medical diagnosis.\n\n### Deployment Geography for Use:\n\nGlobal\n\n## Known Risks and Mitigations:\n\nRisk: Driver face video and health-adjacent reports may be processed by the lifeemergence.com cloud service.\n\nMitigation: Use only after confirming driver or employee consent, retention expectations, access controls, and local privacy requirements for vehicle or fleet deployment.\n\nRisk: The skill may create or reuse a persistent local identity, perform remote account login or registration, and store tokens locally.\n\nMitigation: Review account ownership and token storage before installation, avoid shared unmanaged environments, and clear local credentials when the deployment owner changes.\n\nRisk: Visual flushing and sweating indicators are health-adjacent and may be affected by lighting, camera channel, face occlusion, or individual differences.\n\nMitigation: Treat outputs as driver-assistance alerts only, combine them with operational review or appropriate medical devices when needed, and avoid presenting results as clinical diagnosis.\n\n## Reference(s):\n\n- [ClawHub Skill Page](https://clawhub.ai/smyx-sunjinhui/skills/smyx-driver-flushing-sweat-detection-analysis)\n- [Driver Facial Flushing / Sweat Abnormality Detection API Documentation](references/api_doc.md)\n- [Skill Demo](https://lifeemergence.com/sample.html)\n\n## Skill Output:\n\n**Output Type(s):** [analysis, markdown, code, shell commands, configuration, guidance]\n\n**Output Format:** [Markdown or JSON structured report with optional saved output file and report links]\n\n**Output Parameters:** [1D]\n\n**Other Properties Related to Output:** [May call cloud APIs to analyze files or URLs and to list historical reports.]\n\n## Skill Version(s):\n\n1.0.11 (source: server release metadata)\n\n## Ethical Considerations:\n\nUsers should evaluate whether this skill is appropriate for their environment, review any generated or modified files before relying on them, and apply their organization's safety, security, and compliance requirements before deployment.\n\nFile v1.0.11:skills/smyx_analysis/requirements.txt\n\npydash==8.0.6\nSQLAlchemy==2.0.46\nyaml==6.0.3\n\nFile v1.0.11:skills/smyx_common/requirements.txt\n\npydash==8.0.6\nSQLAlchemy==2.0.46\nPyYAML==6.0.3\n\nArchive v1.0.10: 31 files, 41425 bytes\n\nFiles: references/api_doc.md (3051b), scripts/__init__.py (61b), scripts/config.py (700b), scripts/config.yaml (3b), scripts/skill.py (589b), scripts/smyx_driver_flushing_sweat_detection_analysis.py (3642b), skill-card.md (2596b), SKILL.md (13264b), skills/smyx_analysis/__init__.py (0b), skills/smyx_analysis/references/api_doc.md (427b), skills/smyx_analysis/requirements.txt (45b), skills/smyx_analysis/scripts/__init__.py (0b), skills/smyx_analysis/scripts/api_service.py (1509b), skills/smyx_analysis/scripts/config.py (1003b), skills/smyx_analysis/scripts/config.yaml (3b), skills/smyx_analysis/scripts/skill.py (6529b), skills/smyx_analysis/scripts/smyx_analysis.py (3833b), skills/smyx_common/__init__.py (0b), skills/smyx_common/requirements.txt (47b), skills/smyx_common/scripts/__init__.py (177b), skills/smyx_common/scripts/api_service.py (2645b), skills/smyx_common/scripts/base.py (469b), skills/smyx_common/scripts/config-dev.yaml (214b), skills/smyx_common/scripts/config-prod.yaml (0b), skills/smyx_common/scripts/config-test.yaml (256b), skills/smyx_common/scripts/config.py (24363b), skills/smyx_common/scripts/config.yaml (472b), skills/smyx_common/scripts/dao.py (18266b), skills/smyx_common/scripts/skill.py (2473b), skills/smyx_common/scripts/util.py (28776b), _meta.json (165b)\n\nFile v1.0.10:SKILL.md\n\n---\nname: \"smyx-driver-flushing-sweat-detection-analysis\"\ndescription: \"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). | 通过车载DMS摄像头实时分析驾驶员面部视频，检测面部肤色变化（潮红指数，通过RGB色空间中的红色分量比例或肤色模型）以及汗珠/反光面积（通过图像纹理和反射特征）。当潮红指数显著升高（可能提示血压升高、发热或情绪激动）或出汗区域面积超过阈值（可能提示热应激、低血糖或心脏问题）时，输出健康风险提醒，建议驾驶员停车休息或就医。\"\nversion: \"1.0.13\"\nlicense: \"MIT-0\"\n---\n\n# 🥵 Driver Facial Flushing / Sweat Abnormality Detection | 驾驶员面部潮红/出汗异常检测\n> **智能分析中枢** · 图片/视频智能分析 · 结构化报告 · 历史报告云端查询\n\n---\n\n## 🧭 技能概览 | Overview\n\n| 模块 | 内容 |\n|---|---|\n| 🏷️ 技能名称 | **驾驶员面部潮红/出汗异常检测** |\n| 🎯 核心目标 | 通过车载DMS摄像头实时分析驾驶员面部视频，检测面部肤色变化（潮红指数，通过RGB色空间中的红色分量比例或肤色模型）以及汗珠/反光面积（通过图像纹理和反射特征）。当潮红指数显著升高（可能提示血压升高、发热或情绪激动）或出汗区域面积超过阈值（可能提示热应激、低血糖或心脏问题）时，输出健康风险提醒，建议驾驶员停车休息或就医。 |\n| 🖼️ 输入类型 | 图片、视频、本地文件、网络 URL |\n| 📝 输出能力 | 结构化分析报告、识别/监测结果、建议与报告链接 |\n| 🧩 场景码 | `SMYX_DRIVER_FLUSHING_SWEAT_DETECTION_ANALYSIS` |\n\nUsing 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.\n\n通过车载DMS摄像头实时分析驾驶员面部视频，检测面部肤色变化（潮红指数，通过RGB色空间中的红色分量比例或肤色模型）以及汗珠/反光面积（通过图像纹理和反射特征）。当潮红指数显著升高（可能提示血压升高、发热或情绪激动）或出汗区域面积超过阈值（可能提示热应激、低血糖或心脏问题）时，输出健康风险提醒，建议驾驶员停车休息或就医。该技能旨在辅助驾驶员关注自身健康，避免因突发疾病引发事故。应用场景：乘用车、商用车、网约车、货运车队。系统实时监测，当检测到面部潮红或大量出汗时，通过语音提示'请注意身体状态，建议休息'或推送至车队管理平台。技能特点：驾驶员突发疾病（如心梗、中暑、低血糖）往往会导致车辆失控，引发重大事故。通过AI实时监测面部潮红和出汗异常，可早期提醒驾驶员关注自身状态，采取休息或求助措施，降低事故风险。该技能可作为DMS系统的增值功能，提升车辆主动安全水平，尤其适合营运车辆和网约车平台。\n\n## 🤖 AI 角色 | AI Role\n| 角色要点 | 说明 |\n|---|---|\n| 说明 1 | **假设你是一个专业的驾驶员健康监测 AI。你的任务是分析驾驶员面部视频，检测面部潮红指数（肤色中红色分量的变化）和出汗区域（汗珠或皮肤反光面积）。当潮红指数超过阈值或出汗面积超过预设比例时，输出健康风险提醒。不要提供医疗诊断或具体临床判断，仅输出基于视觉的异常现象提示。** |\n\n## 🎬 技能演示 | Skill Demo\n\n[▶️ 点击查看技能使用介绍](https://lifeemergence.com/sample.html)\n\n---\n\n## 🎯 任务目标 | Goals\n### 1. 🧩 技能用途\n\n基于车载 DMS 摄像头驾驶员面部视频，实时检测面部潮红指数与出汗反光面积，按阈值输出健康风险提醒\n\n### 2. 🛠️ 能力范围\n\n| 序号 | 具体能力 |\n|---:|---|\n| 1 | 驾驶员面部检测 |\n| 2 | 面部 ROI 分区（额头/双颊/鼻翼） |\n| 3 | 潮红指数计算（RGB 红色分量比 / 肤色模型偏移） |\n| 4 | 潮红面积比 |\n| 5 | 汗珠/反光面积比 |\n| 6 | 皮肤纹理粗糙度 |\n| 7 | 基线值与变化幅度 |\n| 8 | 异常等级判定 |\n| 9 | 座舱联动动作建议（voice_alert / fleet_upload / event_record） |\n\n### 3. ⚡ 触发条件\n\n| 触发类型 | 触发规则 |\n|---|---|\n| ✅ 默认触发 | **默认触发**：当用户提供车载 DMS 驾驶员面部视频 URL 或文件需要分析时，默认触发本技能进行潮红/出汗异常检测 |\n| 🔎 明确分析意图 | 当用户明确提及驾驶员健康、面部潮红、出汗异常、突发疾病、心梗预警、中暑预警、低血糖、DMS 健康监测、营运车辆健康等关键词，并且上传了视频文件 |\n| 📚 历史报告查询 | 当用户提及以下关键词时，**自动触发历史报告查询功能** ：查看驾驶员健康历史报告、潮红预警清单、出汗异常报告清单、查询历史驾驶员健康事件、显示所有驾驶员健康报告、显示车队健康诊断报告，查询驾驶员健康事件清单 |\n\n### 4. 🤖 自动行为\n\n| 自动行为 | 执行要求 |\n|---|---|\n| 📎 附件处理 | 如果用户上传了附件或者视频/图片文件，则自动保存为本地文件 |\n| ☁️ 历史报告查询 | 如果用户触发历史报告查询关键词，必须直接调用云端 API 查询，不得从本地记忆或人工汇总中获取 |\n\n#### ⚠️ 强制数据获取规则（次高优先级）\n\n> **橙色强约束：** 历史报告清单只允许从云端接口读取，不允许从本地记录、长期记忆或人工汇总中提取。\n\n必须执行：\n\n```bash\npython -m scripts.smyx_driver_flushing_sweat_detection_analysis --list\n```\n\n| 类型 | 要求 |\n|---|---|\n| ✅ 必须 | 使用 `python -m scripts.smyx_driver_flushing_sweat_detection_analysis --list` 调用 API 查询云端的历史报告数据 |\n| 🚫 严格禁止 | 从本地 `memory` 目录读取历史会话信息 |\n| 🚫 严格禁止 | 手动汇总本地记录中的报告 |\n| 🚫 严格禁止 | 从长期记忆中提取报告 |\n| ✅ 输出格式 | 必须统一从云端接口获取最新完整数据，然后以 Markdown 表格格式输出结果 |\n\n## 📦 前置准备 | Requirements\n- 依赖说明:scripts 脚本所需的依赖包及版本\n  ```\n  requests>=2.28.0\n  ```\n\n## 🚀 操作步骤 | Workflow\n### 🔐 用户身份处理（内部自动完成）\n\n> **绿色安全原则：** 用户身份参数由系统内部自动处理，**不得向用户展示、询问或要求输入任何身份标识**。\n\n执行本技能分析或历史报告查询时，脚本会自动完成身份初始化：\n\n| 场景 | 系统行为 |\n|---|---|\n| 上游系统有内部身份参数 | 由脚本静默接收并使用 |\n| 上游系统未提供内部身份参数 | 脚本会自动复用本地缺省用户 |\n| 本地缺省用户不存在 | 脚本会自动创建并在后续任务中复用 |\n| 对用户输出 | 只展示分析进度、分析结果和报告链接，不展示内部身份值 |\n\n#### 🔒 关键约束\n\n| 禁止/要求 | 说明 |\n|---|---|\n| 🚫 不得询问身份 | 不得提示用户输入用户名、手机号或任何内部身份参数 |\n| 🚫 不得暴露身份值 | 不得在回复、报告、示例、错误提示中暴露内部身份值 |\n| 🚫 不得列为用户参数 | 不得把内部身份参数列为用户需要理解或传入的参数 |\n| ✅ 自动关联报告 | 历史报告查询同样由系统内部身份自动关联，用户只需表达“查看历史报告/报告清单”等意图 |\n\n---\n\n### 🧪 标准流程 | Standard Flow\n\n| 步骤 | 阶段 | 执行动作 |\n|---:|---|---|\n| 1 | 📥 准备车载 DMS 驾驶员面部视频输入 | 提供本地文件路径或网络 URL；确保输入内容清晰、符合技能场景要求 |\n| 2 | 🔐 系统自动完成身份关联 | 无需用户输入任何身份参数；不在回复中展示内部身份值 |\n| 3 | ⚙️ 执行驾驶员面部潮红/出汗异常检测 | 调用 `-m scripts.smyx_driver_flushing_sweat_detection_analysis` 处理输入（**必须在技能根目录下运行脚本**） |\n| 4 | 📊 查看分析结果 | 接收结构化分析报告，查看识别/监测结果、风险提示、建议与报告链接 |\n\n### ⚙️ 脚本参数说明\n\n| 参数 | 含义 | 备注 |\n|---|---|---|\n| `--input` | 本地车载 DMS 驾驶员面部视频文件路径 | 适用于本地文件分析 |\n| `--url` | 网络车载 DMS 驾驶员面部视频 URL 地址（API 服务自动下载） | API 服务自动下载网络资源 |\n| `--pet-type` | 类别标识，驾驶员健康监测场景默认 `other` | 按需填写 |\n| `--list` | 显示驾驶员面部潮红/出汗异常历史分析报告列表清单（可以输入起始日期参数过滤数据范围） | 用于云端历史报告查询 |\n| `--api-url` | API 服务地址（可选，使用默认值） | 按需填写 |\n| `--detail` | 输出详细程度（basic/standard/json，默认 json） | 输出详细程度 |\n| `--output` | 结果输出文件路径（可选） | 可选 |\n\n## 🗂️ 资源索引 | Resource Index\n| 资源类型 | 路径 | 用途 | 何时读取 |\n|---|---|---|---|\n| 🐍 必要脚本 | [`scripts/smyx_driver_flushing_sweat_detection_analysis.py`](scripts/smyx_driver_flushing_sweat_detection_analysis.py) | 调用 API、执行分析或查询历史报告 | 执行分析或查询时使用 |\n| 🐍 必要脚本 | [`scripts/config.py`](scripts/config.py) | 调用 API、执行分析或查询历史报告 | 执行分析或查询时使用 |\n| 📘 领域参考 | [`references/api_doc.md`](references/api_doc.md) | 了解 API 接口规范、字段说明和错误码 | 仅在需要了解接口规范或错误码时读取 |\n\n## ⚠️ 注意事项 | Notes\n| 分类 | 注意事项 |\n|---|---|\n| 📚 文档读取 | 仅在需要时读取参考文档，保持上下文简洁 |\n| 📁 格式支持 | 输入要求：支持 mp4/avi/mov 视频，最大 10MB；**关键**：必须有彩色 RGB 通道，纯红外通道无法识别潮红 |\n| 🧑‍⚖️ 结果性质 | 检测结果仅作为驾驶员辅助健康提醒，本工具不替代体温计、血压计、血糖仪、心电图等医疗设备，更不替代医生诊断 |\n| 🔎 使用提醒 | 受光照、车窗有色膜、肤色个体差异影响较大，建议结合基线值与持续时间综合判定 |\n| 🔏 隐私合规 | 隐私合规：车载驾驶员视频涉及个人生物特征隐私，使用前需取得驾驶员/员工知情同意，车队部署应遵循当地隐私法规并妥善保管/加密相关录像 |\n| 🚫 脚本限制 | 禁止临时生成脚本，只能用技能本身的脚本 |\n| 🌐 网络地址 | 传入的网络地址参数，不需要下载本地，默认地址都是公网地址，api 服务会自动下载 |\n| 📜 报告输出 | 当显示历史分析报告清单的时候，从接口返回 json 数据中提取字段  作为超链接地址，且自动转化为如下 Markdown |\n| 📜 报告输出 | 表格输出示例 |\n\n## 🧰 使用示例 | Examples\n```bash\n# 分析本地车载 DMS 驾驶员视频\npython -m scripts.smyx_driver_flushing_sweat_detection_analysis --input /path/to/dms.mp4\n\n# 分析网络车载 DMS 驾驶员视频\npython -m scripts.smyx_driver_flushing_sweat_detection_analysis --url https://example.com/dms.mp4\n\n# 显示历史驾驶员潮红/出汗异常报告（自动触发关键词：查看驾驶员健康历史报告、潮红预警清单等）\npython -m scripts.smyx_driver_flushing_sweat_detection_analysis --list\n\n# 输出精简报告\npython -m scripts.smyx_driver_flushing_sweat_detection_analysis --input dms.mp4 --detail basic\n\n# 保存结果到文件\npython -m scripts.smyx_driver_flushing_sweat_detection_analysis --input dms.mp4 --output result.json\n```\n\nFile v1.0.10:_meta.json\n\n{\n  \"ownerId\": \"kn7cyxkr2ymf7zwsrybpedg8xx83ywrj\",\n  \"slug\": \"smyx-driver-flushing-sweat-detection-analysis\",\n  \"version\": \"1.0.10\",\n  \"publishedAt\": 1789299147840\n}\n\nFile v1.0.10:references/api_doc.md\n\n# API 接口文档\n\n此处用于存放驾驶员面部潮红/出汗异常检测 API 的接口文档，待后续补充。\n\n## 接口规范\n\n- 基础地址：由 smyx_common 配置统一管理\n- 认证方式：API Key 鉴权\n- 响应格式：JSON\n\n## 主要接口\n\n1. `/web/health-analysis/v2/start-health-analysis` - 启动驾驶员潮红/出汗异常检测任务\n2. `/web/health-analysis/v2/get-health-analysis-result` - 获取潮红/出汗分析结果\n3. `/web/health-analysis/page-health-analysis-result` - 分页查询历史异常事件\n4. `/health/order/api/getReportDetailExport?id={id}` - 导出完整报告\n\n## 场景代码\n\n- `SMYX_DRIVER_FLUSHING_SWEAT_DETECTION_ANALYSIS` - 驾驶员面部潮红/出汗异常检测\n\n## 输入约束\n\n- 摄像头：车载 DMS 摄像头，**优先使用彩色（RGB）通道**；纯红外通道无法识别潮红\n- 安装位置：方向盘上方 / A 柱 / 仪表台上方，正对驾驶员面部\n- 帧率：≥ 15 FPS；分辨率 ≥ 480p\n- 光照尽量稳定（白平衡固定），避免强逆光、车窗滤色片严重影响 RGB\n- 戴口罩会显著降低潮红面积识别可靠性\n\n## 关键观测特征\n\n- `flush_index` - 面部潮红指数（基于 RGB 红色分量比 / 肤色模型偏移，0-1）\n- `flush_area_ratio` - 潮红区域面积占面部 ROI 的比例\n- `sweat_glare_area_ratio` - 汗珠/皮肤反光面积占面部 ROI 的比例\n- `skin_texture_score` - 皮肤纹理粗糙度（受汗液/油脂反光影响）\n- `baseline_flush_index` - 当次会话起始基线潮红值（用于变化幅度判定）\n- `flush_index_delta` - 当前潮红指数相对基线的变化幅度\n\n## 默认阈值（可由调用方覆盖）\n\n- 潮红指数阈值：`flush_index > 0.6` 或 `flush_index_delta > 0.25`\n- 出汗反光面积阈值：`sweat_glare_area_ratio > 0.15`（约 15% 面部 ROI）\n- 持续时间阈值：异常状态持续超过 5 秒触发提醒\n\n## 预警类型\n\n- `facial_flushing` - 面部潮红显著升高（可能与血压升高 / 发热 / 情绪激动等相关）\n- `excessive_sweating` - 大量出汗（可能与热应激 / 低血糖 / 心脏不适等相关）\n- `combined_flush_sweat` - 潮红 + 出汗同时出现（更高优先级提醒）\n\n## 输出字段（参考）\n\n- `driver_detected` - 是否检测到驾驶员\n- `face_visible` - 面部是否可见（戴口罩/严重遮挡时为 false）\n- `flush_metrics` - 潮红相关指标（flush_index / flush_area_ratio / flush_index_delta）\n- `sweat_metrics` - 出汗相关指标（sweat_glare_area_ratio / skin_texture_score）\n- `warning_type` - 触发的预警类型\n- `warning_message` - 预警提示文本（如\"驾驶员面部潮红指数上升 0.32 且额头出汗反光面积 22%，请注意身体状态，建议就近停车休息\"）\n- `recommend_action` - 建议的座舱联动动作（voice_alert / fleet_upload / event_record）\n\n> 仅输出基于视觉的面部潮红/出汗异常现象提示，不提供血压、心脏病、中暑、低血糖等具体医学诊断；如有不适请及时就医并由专业人员评估。\n\nFile v1.0.10:skills/smyx_analysis/references/api_doc.md\n\n# API接口文档\n\n## 接口规范\n\n- 基础地址：由 smyx_common 配置统一管理\n- 认证方式：API Key 鉴权\n- 请求格式：支持文件上传\n- 响应格式：JSON\n\n## 错误码说明\n\n| 错误码 | 说明       |\n|-----|----------|\n| 400 | 请求参数错误   |\n| 401 | API密钥无效  |\n| 403 | 权限不足     |\n| 413 | 文件过大     |\n| 415 | 不支持的文件格式 |\n| 500 | 服务器内部错误  |\n\nFile v1.0.10:scripts/config.yaml\n\n{}\n\nFile v1.0.10:skills/smyx_analysis/scripts/config.yaml\n\n{}\n\nFile v1.0.10:skills/smyx_common/scripts/config-dev.yaml\n\nApiEnum:\n  base-url-open-api: \"http://192.168.1.234:9601/smyx-open-api\"\n  base-url-open-h5: \"http://192.168.1.234:4100\"\n  base-url-health: \"http://192.168.1.234:7070/jeecg-boot-xzgz\"\n\nConstantEnum:\n  is-debug: true\n\nFile v1.0.10:skills/smyx_common/scripts/config-test.yaml\n\nApiEnum:\n  base-url-open-api: \"https://livemonitortest.lifeemergence.com/smyx-open-api\"\n  base-url-open-h5: \"http://livemonitortest.lifeemergence.com\"\n  base-url-health: \"https://healthtest.lifeemergence.com/jeecg-boot-xzgz\"\n\nConstantEnum:\n  is-debug: true\n\nFile v1.0.10:skills/smyx_common/scripts/config.yaml\n\nApiEnum:\n  api-key: null\n  api-secret-key: null\n  base-url-health: https://lifeemergence.com/jeecg-boot-xzgz\n  base-url-open-api: https://open.lifeemergence.com/smyx-open-api\n  base-url-open-h5: http://livemonitor.lifeemergence.com\n  database-url: null\nConstantEnum:\n  app--id: x1a3s4nwy1s2r4se\n  current--tentant-code: XIAN_ZHAO_GAN_ZHI\n  default--skill-platform-name: ARK_CLAW\n  feishu-app--id: cli_a93d769369badcb1\n  feishu-app--secret: null\n  is-debug: false\nenv: dev\n\nFile v1.0.10:skill-card.md\n\n## Description:\n\nThis skill analyzes in-cabin driver face images or video for visual signs of facial flushing and sweat glare, then returns structured alerts and suggested actions.\n\nThis skill is ready for commercial/non-commercial use.\n\n## Publisher:\n\n[smyx-sunjinhui](https://clawhub.ai/user/smyx-sunjinhui)\n\n### License/Terms of Use:\n\nMIT-0\n\n## Use Case:\n\nExternal developers, fleet operators, and vehicle safety teams use this skill to analyze driver-facing DMS media for visual flushing and sweating abnormalities. The output supports assistive alerts and fleet reporting, not medical diagnosis.\n\n### Deployment Geography for Use:\n\nGlobal\n\n## Known Risks and Mitigations:\n\nRisk: The skill handles sensitive driver face and health-related data while using persistent identities and report history.\n\nMitigation: Require explicit consent for biometric processing and history access, document what video, identity, and report data is uploaded or stored, and apply appropriate privacy controls before deployment.\n\nRisk: Security evidence flags dev/plaintext HTTP defaults, stored tokens, and incomplete dependency declarations.\n\nMitigation: Remove dev/plaintext HTTP defaults, use secure token storage, and fix dependency declarations before installation or production use.\n\nRisk: Visual flushing and sweat detection can be affected by lighting, vehicle window tinting, occlusion, and individual differences.\n\nMitigation: Treat outputs as assistive, non-diagnostic alerts and combine them with baseline comparison, duration thresholds, and appropriate human or medical follow-up.\n\n## Reference(s):\n\n- [ClawHub skill page](https://clawhub.ai/smyx-sunjinhui/skills/smyx-driver-flushing-sweat-detection-analysis)\n- [Driver flushing and sweat detection API documentation](references/api_doc.md)\n- [Skill demo](https://lifeemergence.com/sample.html)\n\n## Skill Output:\n\n**Output Type(s):** [Text, Markdown, Shell commands, Guidance]\n\n**Output Format:** [Markdown and JSON-oriented text from command-line/API analysis results]\n\n**Output Parameters:** [1D]\n\n**Other Properties Related to Output:** [May include visual abnormality metrics, health-risk reminders, recommended actions, and report links; outputs are not medical diagnoses.]\n\n## Skill Version(s):\n\n1.0.10 (source: server release metadata; artifact frontmatter states 1.0.13)\n\n## Ethical Considerations:\n\nUsers should evaluate whether this skill is appropriate for their environment, review any generated or modified files before relying on them, and apply their organization's safety, security, and compliance requirements before deployment.\n\nFile v1.0.10:skills/smyx_analysis/requirements.txt\n\npydash==8.0.6\nSQLAlchemy==2.0.46\nyaml==6.0.3\n\nFile v1.0.10:skills/smyx_common/requirements.txt\n\npydash==8.0.6\nSQLAlchemy==2.0.46\nPyYAML==6.0.3\n\nArchive v1.0.9: 31 files, 41565 bytes\n\nFiles: references/api_doc.md (3051b), scripts/__init__.py (61b), scripts/config.py (700b), scripts/config.yaml (3b), scripts/skill.py (589b), scripts/smyx_driver_flushing_sweat_detection_analysis.py (3642b), skill-card.md (2927b), SKILL.md (13264b), skills/smyx_analysis/__init__.py (0b), skills/smyx_analysis/references/api_doc.md (427b), skills/smyx_analysis/requirements.txt (45b), skills/smyx_analysis/scripts/__init__.py (0b), skills/smyx_analysis/scripts/api_service.py (1509b), skills/smyx_analysis/scripts/config.py (1003b), skills/smyx_analysis/scripts/config.yaml (3b), skills/smyx_analysis/scripts/skill.py (6529b), skills/smyx_analysis/scripts/smyx_analysis.py (3833b), skills/smyx_common/__init__.py (0b), skills/smyx_common/requirements.txt (47b), skills/smyx_common/scripts/__init__.py (177b), skills/smyx_common/scripts/api_service.py (2645b), skills/smyx_common/scripts/base.py (469b), skills/smyx_common/scripts/config-dev.yaml (214b), skills/smyx_common/scripts/config-prod.yaml (0b), skills/smyx_common/scripts/config-test.yaml (256b), skills/smyx_common/scripts/config.py (24363b), skills/smyx_common/scripts/config.yaml (472b), skills/smyx_common/scripts/dao.py (18266b), skills/smyx_common/scripts/skill.py (2473b), skills/smyx_common/scripts/util.py (28776b), _meta.json (164b)\n\nFile v1.0.9:SKILL.md\n\n---\nname: \"smyx-driver-flushing-sweat-detection-analysis\"\ndescription: \"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). | 通过车载DMS摄像头实时分析驾驶员面部视频，检测面部肤色变化（潮红指数，通过RGB色空间中的红色分量比例或肤色模型）以及汗珠/反光面积（通过图像纹理和反射特征）。当潮红指数显著升高（可能提示血压升高、发热或情绪激动）或出汗区域面积超过阈值（可能提示热应激、低血糖或心脏问题）时，输出健康风险提醒，建议驾驶员停车休息或就医。\"\nversion: \"1.0.11\"\nlicense: \"MIT-0\"\n---\n\n# 🥵 Driver Facial Flushing / Sweat Abnormality Detection | 驾驶员面部潮红/出汗异常检测\n> **智能分析中枢** · 图片/视频智能分析 · 结构化报告 · 历史报告云端查询\n\n---\n\n## 🧭 技能概览 | Overview\n\n| 模块 | 内容 |\n|---|---|\n| 🏷️ 技能名称 | **驾驶员面部潮红/出汗异常检测** |\n| 🎯 核心目标 | 通过车载DMS摄像头实时分析驾驶员面部视频，检测面部肤色变化（潮红指数，通过RGB色空间中的红色分量比例或肤色模型）以及汗珠/反光面积（通过图像纹理和反射特征）。当潮红指数显著升高（可能提示血压升高、发热或情绪激动）或出汗区域面积超过阈值（可能提示热应激、低血糖或心脏问题）时，输出健康风险提醒，建议驾驶员停车休息或就医。 |\n| 🖼️ 输入类型 | 图片、视频、本地文件、网络 URL |\n| 📝 输出能力 | 结构化分析报告、识别/监测结果、建议与报告链接 |\n| 🧩 场景码 | `SMYX_DRIVER_FLUSHING_SWEAT_DETECTION_ANALYSIS` |\n\nUsing 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.\n\n通过车载DMS摄像头实时分析驾驶员面部视频，检测面部肤色变化（潮红指数，通过RGB色空间中的红色分量比例或肤色模型）以及汗珠/反光面积（通过图像纹理和反射特征）。当潮红指数显著升高（可能提示血压升高、发热或情绪激动）或出汗区域面积超过阈值（可能提示热应激、低血糖或心脏问题）时，输出健康风险提醒，建议驾驶员停车休息或就医。该技能旨在辅助驾驶员关注自身健康，避免因突发疾病引发事故。应用场景：乘用车、商用车、网约车、货运车队。系统实时监测，当检测到面部潮红或大量出汗时，通过语音提示'请注意身体状态，建议休息'或推送至车队管理平台。技能特点：驾驶员突发疾病（如心梗、中暑、低血糖）往往会导致车辆失控，引发重大事故。通过AI实时监测面部潮红和出汗异常，可早期提醒驾驶员关注自身状态，采取休息或求助措施，降低事故风险。该技能可作为DMS系统的增值功能，提升车辆主动安全水平，尤其适合营运车辆和网约车平台。\n\n## 🤖 AI 角色 | AI Role\n| 角色要点 | 说明 |\n|---|---|\n| 说明 1 | **假设你是一个专业的驾驶员健康监测 AI。你的任务是分析驾驶员面部视频，检测面部潮红指数（肤色中红色分量的变化）和出汗区域（汗珠或皮肤反光面积）。当潮红指数超过阈值或出汗面积超过预设比例时，输出健康风险提醒。不要提供医疗诊断或具体临床判断，仅输出基于视觉的异常现象提示。** |\n\n## 🎬 技能演示 | Skill Demo\n\n[▶️ 点击查看技能使用介绍](https://lifeemergence.com/sample.html)\n\n---\n\n## 🎯 任务目标 | Goals\n### 1. 🧩 技能用途\n\n基于车载 DMS 摄像头驾驶员面部视频，实时检测面部潮红指数与出汗反光面积，按阈值输出健康风险提醒\n\n### 2. 🛠️ 能力范围\n\n| 序号 | 具体能力 |\n|---:|---|\n| 1 | 驾驶员面部检测 |\n| 2 | 面部 ROI 分区（额头/双颊/鼻翼） |\n| 3 | 潮红指数计算（RGB 红色分量比 / 肤色模型偏移） |\n| 4 | 潮红面积比 |\n| 5 | 汗珠/反光面积比 |\n| 6 | 皮肤纹理粗糙度 |\n| 7 | 基线值与变化幅度 |\n| 8 | 异常等级判定 |\n| 9 | 座舱联动动作建议（voice_alert / fleet_upload / event_record） |\n\n### 3. ⚡ 触发条件\n\n| 触发类型 | 触发规则 |\n|---|---|\n| ✅ 默认触发 | **默认触发**：当用户提供车载 DMS 驾驶员面部视频 URL 或文件需要分析时，默认触发本技能进行潮红/出汗异常检测 |\n| 🔎 明确分析意图 | 当用户明确提及驾驶员健康、面部潮红、出汗异常、突发疾病、心梗预警、中暑预警、低血糖、DMS 健康监测、营运车辆健康等关键词，并且上传了视频文件 |\n| 📚 历史报告查询 | 当用户提及以下关键词时，**自动触发历史报告查询功能** ：查看驾驶员健康历史报告、潮红预警清单、出汗异常报告清单、查询历史驾驶员健康事件、显示所有驾驶员健康报告、显示车队健康诊断报告，查询驾驶员健康事件清单 |\n\n### 4. 🤖 自动行为\n\n| 自动行为 | 执行要求 |\n|---|---|\n| 📎 附件处理 | 如果用户上传了附件或者视频/图片文件，则自动保存为本地文件 |\n| ☁️ 历史报告查询 | 如果用户触发历史报告查询关键词，必须直接调用云端 API 查询，不得从本地记忆或人工汇总中获取 |\n\n#### ⚠️ 强制数据获取规则（次高优先级）\n\n> **橙色强约束：** 历史报告清单只允许从云端接口读取，不允许从本地记录、长期记忆或人工汇总中提取。\n\n必须执行：\n\n```bash\npython -m scripts.smyx_driver_flushing_sweat_detection_analysis --list\n```\n\n| 类型 | 要求 |\n|---|---|\n| ✅ 必须 | 使用 `python -m scripts.smyx_driver_flushing_sweat_detection_analysis --list` 调用 API 查询云端的历史报告数据 |\n| 🚫 严格禁止 | 从本地 `memory` 目录读取历史会话信息 |\n| 🚫 严格禁止 | 手动汇总本地记录中的报告 |\n| 🚫 严格禁止 | 从长期记忆中提取报告 |\n| ✅ 输出格式 | 必须统一从云端接口获取最新完整数据，然后以 Markdown 表格格式输出结果 |\n\n## 📦 前置准备 | Requirements\n- 依赖说明:scripts 脚本所需的依赖包及版本\n  ```\n  requests>=2.28.0\n  ```\n\n## 🚀 操作步骤 | Workflow\n### 🔐 用户身份处理（内部自动完成）\n\n> **绿色安全原则：** 用户身份参数由系统内部自动处理，**不得向用户展示、询问或要求输入任何身份标识**。\n\n执行本技能分析或历史报告查询时，脚本会自动完成身份初始化：\n\n| 场景 | 系统行为 |\n|---|---|\n| 上游系统有内部身份参数 | 由脚本静默接收并使用 |\n| 上游系统未提供内部身份参数 | 脚本会自动复用本地缺省用户 |\n| 本地缺省用户不存在 | 脚本会自动创建并在后续任务中复用 |\n| 对用户输出 | 只展示分析进度、分析结果和报告链接，不展示内部身份值 |\n\n#### 🔒 关键约束\n\n| 禁止/要求 | 说明 |\n|---|---|\n| 🚫 不得询问身份 | 不得提示用户输入用户名、手机号或任何内部身份参数 |\n| 🚫 不得暴露身份值 | 不得在回复、报告、示例、错误提示中暴露内部身份值 |\n| 🚫 不得列为用户参数 | 不得把内部身份参数列为用户需要理解或传入的参数 |\n| ✅ 自动关联报告 | 历史报告查询同样由系统内部身份自动关联，用户只需表达“查看历史报告/报告清单”等意图 |\n\n---\n\n### 🧪 标准流程 | Standard Flow\n\n| 步骤 | 阶段 | 执行动作 |\n|---:|---|---|\n| 1 | 📥 准备车载 DMS 驾驶员面部视频输入 | 提供本地文件路径或网络 URL；确保输入内容清晰、符合技能场景要求 |\n| 2 | 🔐 系统自动完成身份关联 | 无需用户输入任何身份参数；不在回复中展示内部身份值 |\n| 3 | ⚙️ 执行驾驶员面部潮红/出汗异常检测 | 调用 `-m scripts.smyx_driver_flushing_sweat_detection_analysis` 处理输入（**必须在技能根目录下运行脚本**） |\n| 4 | 📊 查看分析结果 | 接收结构化分析报告，查看识别/监测结果、风险提示、建议与报告链接 |\n\n### ⚙️ 脚本参数说明\n\n| 参数 | 含义 | 备注 |\n|---|---|---|\n| `--input` | 本地车载 DMS 驾驶员面部视频文件路径 | 适用于本地文件分析 |\n| `--url` | 网络车载 DMS 驾驶员面部视频 URL 地址（API 服务自动下载） | API 服务自动下载网络资源 |\n| `--pet-type` | 类别标识，驾驶员健康监测场景默认 `other` | 按需填写 |\n| `--list` | 显示驾驶员面部潮红/出汗异常历史分析报告列表清单（可以输入起始日期参数过滤数据范围） | 用于云端历史报告查询 |\n| `--api-url` | API 服务地址（可选，使用默认值） | 按需填写 |\n| `--detail` | 输出详细程度（basic/standard/json，默认 json） | 输出详细程度 |\n| `--output` | 结果输出文件路径（可选） | 可选 |\n\n## 🗂️ 资源索引 | Resource Index\n| 资源类型 | 路径 | 用途 | 何时读取 |\n|---|---|---|---|\n| 🐍 必要脚本 | [`scripts/smyx_driver_flushing_sweat_detection_analysis.py`](scripts/smyx_driver_flushing_sweat_detection_analysis.py) | 调用 API、执行分析或查询历史报告 | 执行分析或查询时使用 |\n| 🐍 必要脚本 | [`scripts/config.py`](scripts/config.py) | 调用 API、执行分析或查询历史报告 | 执行分析或查询时使用 |\n| 📘 领域参考 | [`references/api_doc.md`](references/api_doc.md) | 了解 API 接口规范、字段说明和错误码 | 仅在需要了解接口规范或错误码时读取 |\n\n## ⚠️ 注意事项 | Notes\n| 分类 | 注意事项 |\n|---|---|\n| 📚 文档读取 | 仅在需要时读取参考文档，保持上下文简洁 |\n| 📁 格式支持 | 输入要求：支持 mp4/avi/mov 视频，最大 10MB；**关键**：必须有彩色 RGB 通道，纯红外通道无法识别潮红 |\n| 🧑‍⚖️ 结果性质 | 检测结果仅作为驾驶员辅助健康提醒，本工具不替代体温计、血压计、血糖仪、心电图等医疗设备，更不替代医生诊断 |\n| 🔎 使用提醒 | 受光照、车窗有色膜、肤色个体差异影响较大，建议结合基线值与持续时间综合判定 |\n| 🔏 隐私合规 | 隐私合规：车载驾驶员视频涉及个人生物特征隐私，使用前需取得驾驶员/员工知情同意，车队部署应遵循当地隐私法规并妥善保管/加密相关录像 |\n| 🚫 脚本限制 | 禁止临时生成脚本，只能用技能本身的脚本 |\n| 🌐 网络地址 | 传入的网络地址参数，不需要下载本地，默认地址都是公网地址，api 服务会自动下载 |\n| 📜 报告输出 | 当显示历史分析报告清单的时候，从接口返回 json 数据中提取字段  作为超链接地址，且自动转化为如下 Markdown |\n| 📜 报告输出 | 表格输出示例 |\n\n## 🧰 使用示例 | Examples\n```bash\n# 分析本地车载 DMS 驾驶员视频\npython -m scripts.smyx_driver_flushing_sweat_detection_analysis --input /path/to/dms.mp4\n\n# 分析网络车载 DMS 驾驶员视频\npython -m scripts.smyx_driver_flushing_sweat_detection_analysis --url https://example.com/dms.mp4\n\n# 显示历史驾驶员潮红/出汗异常报告（自动触发关键词：查看驾驶员健康历史报告、潮红预警清单等）\npython -m scripts.smyx_driver_flushing_sweat_detection_analysis --list\n\n# 输出精简报告\npython -m scripts.smyx_driver_flushing_sweat_detection_analysis --input dms.mp4 --detail basic\n\n# 保存结果到文件\npython -m scripts.smyx_driver_flushing_sweat_detection_analysis --input dms.mp4 --output result.json\n```\n\nFile v1.0.9:_meta.json\n\n{\n  \"ownerId\": \"kn7cyxkr2ymf7zwsrybpedg8xx83ywrj\",\n  \"slug\": \"smyx-driver-flushing-sweat-detection-analysis\",\n  \"version\": \"1.0.9\",\n  \"publishedAt\": 1787674710424\n}\n\nFile v1.0.9:references/api_doc.md\n\n# API 接口文档\n\n此处用于存放驾驶员面部潮红/出汗异常检测 API 的接口文档，待后续补充。\n\n## 接口规范\n\n- 基础地址：由 smyx_common 配置统一管理\n- 认证方式：API Key 鉴权\n- 响应格式：JSON\n\n## 主要接口\n\n1. `/web/health-analysis/v2/start-health-analysis` - 启动驾驶员潮红/出汗异常检测任务\n2. `/web/health-analysis/v2/get-health-analysis-result` - 获取潮红/出汗分析结果\n3. `/web/health-analysis/page-health-analysis-result` - 分页查询历史异常事件\n4. `/health/order/api/getReportDetailExport?id={id}` - 导出完整报告\n\n## 场景代码\n\n- `SMYX_DRIVER_FLUSHING_SWEAT_DETECTION_ANALYSIS` - 驾驶员面部潮红/出汗异常检测\n\n## 输入约束\n\n- 摄像头：车载 DMS 摄像头，**优先使用彩色（RGB）通道**；纯红外通道无法识别潮红\n- 安装位置：方向盘上方 / A 柱 / 仪表台上方，正对驾驶员面部\n- 帧率：≥ 15 FPS；分辨率 ≥ 480p\n- 光照尽量稳定（白平衡固定），避免强逆光、车窗滤色片严重影响 RGB\n- 戴口罩会显著降低潮红面积识别可靠性\n\n## 关键观测特征\n\n- `flush_index` - 面部潮红指数（基于 RGB 红色分量比 / 肤色模型偏移，0-1）\n- `flush_area_ratio` - 潮红区域面积占面部 ROI 的比例\n- `sweat_glare_area_ratio` - 汗珠/皮肤反光面积占面部 ROI 的比例\n- `skin_texture_score` - 皮肤纹理粗糙度（受汗液/油脂反光影响）\n- `baseline_flush_index` - 当次会话起始基线潮红值（用于变化幅度判定）\n- `flush_index_delta` - 当前潮红指数相对基线的变化幅度\n\n## 默认阈值（可由调用方覆盖）\n\n- 潮红指数阈值：`flush_index > 0.6` 或 `flush_index_delta > 0.25`\n- 出汗反光面积阈值：`sweat_glare_area_ratio > 0.15`（约 15% 面部 ROI）\n- 持续时间阈值：异常状态持续超过 5 秒触发提醒\n\n## 预警类型\n\n- `facial_flushing` - 面部潮红显著升高（可能与血压升高 / 发热 / 情绪激动等相关）\n- `excessive_sweating` - 大量出汗（可能与热应激 / 低血糖 / 心脏不适等相关）\n- `combined_flush_sweat` - 潮红 + 出汗同时出现（更高优先级提醒）\n\n## 输出字段（参考）\n\n- `driver_detected` - 是否检测到驾驶员\n- `face_visible` - 面部是否可见（戴口罩/严重遮挡时为 false）\n- `flush_metrics` - 潮红相关指标（flush_index / flush_area_ratio / flush_index_delta）\n- `sweat_metrics` - 出汗相关指标（sweat_glare_area_ratio / skin_texture_score）\n- `warning_type` - 触发的预警类型\n- `warning_message` - 预警提示文本（如\"驾驶员面部潮红指数上升 0.32 且额头出汗反光面积 22%，请注意身体状态，建议就近停车休息\"）\n- `recommend_action` - 建议的座舱联动动作（voice_alert / fleet_upload / event_record）\n\n> 仅输出基于视觉的面部潮红/出汗异常现象提示，不提供血压、心脏病、中暑、低血糖等具体医学诊断；如有不适请及时就医并由专业人员评估。\n\nFile v1.0.9:skills/smyx_analysis/references/api_doc.md\n\n# API接口文档\n\n## 接口规范\n\n- 基础地址：由 smyx_common 配置统一管理\n- 认证方式：API Key 鉴权\n- 请求格式：支持文件上传\n- 响应格式：JSON\n\n## 错误码说明\n\n| 错误码 | 说明       |\n|-----|----------|\n| 400 | 请求参数错误   |\n| 401 | API密钥无效  |\n| 403 | 权限不足     |\n| 413 | 文件过大     |\n| 415 | 不支持的文件格式 |\n| 500 | 服务器内部错误  |\n\nFile v1.0.9:scripts/config.yaml\n\n{}\n\nFile v1.0.9:skills/smyx_analysis/scripts/config.yaml\n\n{}\n\nFile v1.0.9:skills/smyx_common/scripts/config-dev.yaml\n\nApiEnum:\n  base-url-open-api: \"http://192.168.1.234:9601/smyx-open-api\"\n  base-url-open-h5: \"http://192.168.1.234:4100\"\n  base-url-health: \"http://192.168.1.234:7070/jeecg-boot-xzgz\"\n\nConstantEnum:\n  is-debug: true\n\nFile v1.0.9:skills/smyx_common/scripts/config-test.yaml\n\nApiEnum:\n  base-url-open-api: \"https://livemonitortest.lifeemergence.com/smyx-open-api\"\n  base-url-open-h5: \"http://livemonitortest.lifeemergence.com\"\n  base-url-health: \"https://healthtest.lifeemergence.com/jeecg-boot-xzgz\"\n\nConstantEnum:\n  is-debug: true\n\nFile v1.0.9:skills/smyx_common/scripts/config.yaml\n\nApiEnum:\n  api-key: null\n  api-secret-key: null\n  base-url-health: https://lifeemergence.com/jeecg-boot-xzgz\n  base-url-open-api: https://open.lifeemergence.com/smyx-open-api\n  base-url-open-h5: http://livemonitor.lifeemergence.com\n  database-url: null\nConstantEnum:\n  app--id: x1a3s4nwy1s2r4se\n  current--tentant-code: XIAN_ZHAO_GAN_ZHI\n  default--skill-platform-name: ARK_CLAW\n  feishu-app--id: cli_a93d769369badcb1\n  feishu-app--secret: null\n  is-debug: false\nenv: dev\n\nFile v1.0.9:skill-card.md\n\n## Description:\n\nAnalyzes in-cabin driver face video or images for visible facial flushing and abnormal sweating signals, then returns structured visual health-risk reminders without making a medical diagnosis.\n\nThis skill is ready for commercial/non-commercial use.\n\n## Publisher:\n\n[smyx-sunjinhui](https://clawhub.ai/user/smyx-sunjinhui)\n\n### License/Terms of Use:\n\nMIT-0\n\n## Use Case:\n\nDevelopers and vehicle-safety teams use this skill to analyze driver DMS camera media for visible facial flushing, sweat-glare area, and related warning indicators. It supports driver-facing alerts, fleet event records, and historical report review while remaining an auxiliary visual reminder rather than a medical diagnostic tool.\n\n### Deployment Geography for Use:\n\nGlobal\n\n## Known Risks and Mitigations:\n\nRisk: The skill processes sensitive driver face media and health-related visual indicators through remote services.\n\nMitigation: Use only with explicit driver or employee consent, confirm the backend environment before sending media, and follow applicable privacy and retention requirements.\n\nRisk: The skill can automatically create or reuse identity records and store local tokens.\n\nMitigation: Review local identity and token storage before deployment and require an operational process to disable, rotate, or delete stored credentials and records.\n\nRisk: Remote URL inputs may cause backend services to fetch arbitrary media locations.\n\nMitigation: Restrict inputs to trusted media sources and avoid arbitrary remote URLs.\n\nRisk: Visual flushing and sweating signals can be affected by lighting, tinted glass, masks, camera quality, and individual skin differences.\n\nMitigation: Treat outputs as auxiliary visual alerts only and require professional medical evaluation for health decisions.\n\n## Reference(s):\n\n- [ClawHub skill page](https://clawhub.ai/smyx-sunjinhui/skills/smyx-driver-flushing-sweat-detection-analysis)\n- [Publisher profile](https://clawhub.ai/user/smyx-sunjinhui)\n- [Skill demo](https://lifeemergence.com/sample.html)\n- [Driver flushing and sweat API documentation](references/api_doc.md)\n- [Common analysis API documentation](skills/smyx_analysis/references/api_doc.md)\n\n## Skill Output:\n\n**Output Type(s):** [text, markdown, JSON, shell commands, configuration, guidance]\n\n**Output Format:** [Markdown status text with structured JSON analysis fields and optional report links]\n\n**Output Parameters:** [1D]\n\n**Other Properties Related to Output:** [May save analysis output to a user-specified file and may query cloud report history.]\n\n## Skill Version(s):\n\n1.0.9 (source: server release evidence; artifact frontmatter reports 1.0.11)\n\n## Ethical Considerations:\n\nUsers should evaluate whether this skill is appropriate for their environment, review any generated or modified files before relying on them, and apply their organization's safety, security, and compliance requirements before deployment.\n\nFile v1.0.9:skills/smyx_analysis/requirements.txt\n\npydash==8.0.6\nSQLAlchemy==2.0.46\nyaml==6.0.3\n\nFile v1.0.9:skills/smyx_common/requirements.txt\n\npydash==8.0.6\nSQLAlchemy==2.0.46\nPyYAML==6.0.3\n\nArchive v1.0.8: 31 files, 41443 bytes\n\nFiles: references/api_doc.md (3051b), scripts/__init__.py (61b), scripts/config.py (700b), scripts/config.yaml (3b), scripts/skill.py (589b), scripts/smyx_driver_flushing_sweat_detection_analysis.py (3642b), skill-card.md (2650b), SKILL.md (13264b), skills/smyx_analysis/__init__.py (0b), skills/smyx_analysis/references/api_doc.md (427b), skills/smyx_analysis/requirements.txt (45b), skills/smyx_analysis/scripts/__init__.py (0b), skills/smyx_analysis/scripts/api_service.py (1509b), skills/smyx_analysis/scripts/config.py (1003b), skills/smyx_analysis/scripts/config.yaml (3b), skills/smyx_analysis/scripts/skill.py (6529b), skills/smyx_analysis/scripts/smyx_analysis.py (3833b), skills/smyx_common/__init__.py (0b), skills/smyx_common/requirements.txt (47b), skills/smyx_common/scripts/__init__.py (177b), skills/smyx_common/scripts/api_service.py (2645b), skills/smyx_common/scripts/base.py (469b), skills/smyx_common/scripts/config-dev.yaml (214b), skills/smyx_common/scripts/config-prod.yaml (0b), skills/smyx_common/scripts/config-test.yaml (256b), skills/smyx_common/scripts/config.py (24363b), skills/smyx_common/scripts/config.yaml (472b), skills/smyx_common/scripts/dao.py (18266b), skills/smyx_common/scripts/skill.py (2473b), skills/smyx_common/scripts/util.py (28776b), _meta.json (164b)\n\nFile v1.0.8:SKILL.md\n\n---\nname: \"smyx-driver-flushing-sweat-detection-analysis\"\ndescription: \"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). | 通过车载DMS摄像头实时分析驾驶员面部视频，检测面部肤色变化（潮红指数，通过RGB色空间中的红色分量比例或肤色模型）以及汗珠/反光面积（通过图像纹理和反射特征）。当潮红指数显著升高（可能提示血压升高、发热或情绪激动）或出汗区域面积超过阈值（可能提示热应激、低血糖或心脏问题）时，输出健康风险提醒，建议驾驶员停车休息或就医。\"\nversion: \"1.0.10\"\nlicense: \"MIT-0\"\n---\n\n# 🥵 Driver Facial Flushing / Sweat Abnormality Detection | 驾驶员面部潮红/出汗异常检测\n> **智能分析中枢** · 图片/视频智能分析 · 结构化报告 · 历史报告云端查询\n\n---\n\n## 🧭 技能概览 | Overview\n\n| 模块 | 内容 |\n|---|---|\n| 🏷️ 技能名称 | **驾驶员面部潮红/出汗异常检测** |\n| 🎯 核心目标 | 通过车载DMS摄像头实时分析驾驶员面部视频，检测面部肤色变化（潮红指数，通过RGB色空间中的红色分量比例或肤色模型）以及汗珠/反光面积（通过图像纹理和反射特征）。当潮红指数显著升高（可能提示血压升高、发热或情绪激动）或出汗区域面积超过阈值（可能提示热应激、低血糖或心脏问题）时，输出健康风险提醒，建议驾驶员停车休息或就医。 |\n| 🖼️ 输入类型 | 图片、视频、本地文件、网络 URL |\n| 📝 输出能力 | 结构化分析报告、识别/监测结果、建议与报告链接 |\n| 🧩 场景码 | `SMYX_DRIVER_FLUSHING_SWEAT_DETECTION_ANALYSIS` |\n\nUsing 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.\n\n通过车载DMS摄像头实时分析驾驶员面部视频，检测面部肤色变化（潮红指数，通过RGB色空间中的红色分量比例或肤色模型）以及汗珠/反光面积（通过图像纹理和反射特征）。当潮红指数显著升高（可能提示血压升高、发热或情绪激动）或出汗区域面积超过阈值（可能提示热应激、低血糖或心脏问题）时，输出健康风险提醒，建议驾驶员停车休息或就医。该技能旨在辅助驾驶员关注自身健康，避免因突发疾病引发事故。应用场景：乘用车、商用车、网约车、货运车队。系统实时监测，当检测到面部潮红或大量出汗时，通过语音提示'请注意身体状态，建议休息'或推送至车队管理平台。技能特点：驾驶员突发疾病（如心梗、中暑、低血糖）往往会导致车辆失控，引发重大事故。通过AI实时监测面部潮红和出汗异常，可早期提醒驾驶员关注自身状态，采取休息或求助措施，降低事故风险。该技能可作为DMS系统的增值功能，提升车辆主动安全水平，尤其适合营运车辆和网约车平台。\n\n## 🤖 AI 角色 | AI Role\n| 角色要点 | 说明 |\n|---|---|\n| 说明 1 | **假设你是一个专业的驾驶员健康监测 AI。你的任务是分析驾驶员面部视频，检测面部潮红指数（肤色中红色分量的变化）和出汗区域（汗珠或皮肤反光面积）。当潮红指数超过阈值或出汗面积超过预设比例时，输出健康风险提醒。不要提供医疗诊断或具体临床判断，仅输出基于视觉的异常现象提示。** |\n\n## 🎬 技能演示 | Skill Demo\n\n[▶️ 点击查看技能使用介绍](https://lifeemergence.com/sample.html)\n\n---\n\n## 🎯 任务目标 | Goals\n### 1. 🧩 技能用途\n\n基于车载 DMS 摄像头驾驶员面部视频，实时检测面部潮红指数与出汗反光面积，按阈值输出健康风险提醒\n\n### 2. 🛠️ 能力范围\n\n| 序号 | 具体能力 |\n|---:|---|\n| 1 | 驾驶员面部检测 |\n| 2 | 面部 ROI 分区（额头/双颊/鼻翼） |\n| 3 | 潮红指数计算（RGB 红色分量比 / 肤色模型偏移） |\n| 4 | 潮红面积比 |\n| 5 | 汗珠/反光面积比 |\n| 6 | 皮肤纹理粗糙度 |\n| 7 | 基线值与变化幅度 |\n| 8 | 异常等级判定 |\n| 9 | 座舱联动动作建议（voice_alert / fleet_upload / event_record） |\n\n### 3. ⚡ 触发条件\n\n| 触发类型 | 触发规则 |\n|---|---|\n| ✅ 默认触发 | **默认触发**：当用户提供车载 DMS 驾驶员面部视频 URL 或文件需要分析时，默认触发本技能进行潮红/出汗异常检测 |\n| 🔎 明确分析意图 | 当用户明确提及驾驶员健康、面部潮红、出汗异常、突发疾病、心梗预警、中暑预警、低血糖、DMS 健康监测、营运车辆健康等关键词，并且上传了视频文件 |\n| 📚 历史报告查询 | 当用户提及以下关键词时，**自动触发历史报告查询功能** ：查看驾驶员健康历史报告、潮红预警清单、出汗异常报告清单、查询历史驾驶员健康事件、显示所有驾驶员健康报告、显示车队健康诊断报告，查询驾驶员健康事件清单 |\n\n### 4. 🤖 自动行为\n\n| 自动行为 | 执行要求 |\n|---|---|\n| 📎 附件处理 | 如果用户上传了附件或者视频/图片文件，则自动保存为本地文件 |\n| ☁️ 历史报告查询 | 如果用户触发历史报告查询关键词，必须直接调用云端 API 查询，不得从本地记忆或人工汇总中获取 |\n\n#### ⚠️ 强制数据获取规则（次高优先级）\n\n> **橙色强约束：** 历史报告清单只允许从云端接口读取，不允许从本地记录、长期记忆或人工汇总中提取。\n\n必须执行：\n\n```bash\npython -m scripts.smyx_driver_flushing_sweat_detection_analysis --list\n```\n\n| 类型 | 要求 |\n|---|---|\n| ✅ 必须 | 使用 `python -m scripts.smyx_driver_flushing_sweat_detection_analysis --list` 调用 API 查询云端的历史报告数据 |\n| 🚫 严格禁止 | 从本地 `memory` 目录读取历史会话信息 |\n| 🚫 严格禁止 | 手动汇总本地记录中的报告 |\n| 🚫 严格禁止 | 从长期记忆中提取报告 |\n| ✅ 输出格式 | 必须统一从云端接口获取最新完整数据，然后以 Markdown 表格格式输出结果 |\n\n## 📦 前置准备 | Requirements\n- 依赖说明:scripts 脚本所需的依赖包及版本\n  ```\n  requests>=2.28.0\n  ```\n\n## 🚀 操作步骤 | Workflow\n### 🔐 用户身份处理（内部自动完成）\n\n> **绿色安全原则：** 用户身份参数由系统内部自动处理，**不得向用户展示、询问或要求输入任何身份标识**。\n\n执行本技能分析或历史报告查询时，脚本会自动完成身份初始化：\n\n| 场景 | 系统行为 |\n|---|---|\n| 上游系统有内部身份参数 | 由脚本静默接收并使用 |\n| 上游系统未提供内部身份参数 | 脚本会自动复用本地缺省用户 |\n| 本地缺省用户不存在 | 脚本会自动创建并在后续任务中复用 |\n| 对用户输出 | 只展示分析进度、分析结果和报告链接，不展示内部身份值 |\n\n#### 🔒 关键约束\n\n| 禁止/要求 | 说明 |\n|---|---|\n| 🚫 不得询问身份 | 不得提示用户输入用户名、手机号或任何内部身份参数 |\n| 🚫 不得暴露身份值 | 不得在回复、报告、示例、错误提示中暴露内部身份值 |\n| 🚫 不得列为用户参数 | 不得把内部身份参数列为用户需要理解或传入的参数 |\n| ✅ 自动关联报告 | 历史报告查询同样由系统内部身份自动关联，用户只需表达“查看历史报告/报告清单”等意图 |\n\n---\n\n### 🧪 标准流程 | Standard Flow\n\n| 步骤 | 阶段 | 执行动作 |\n|---:|---|---|\n| 1 | 📥 准备车载 DMS 驾驶员面部视频输入 | 提供本地文件路径或网络 URL；确保输入内容清晰、符合技能场景要求 |\n| 2 | 🔐 系统自动完成身份关联 | 无需用户输入任何身份参数；不在回复中展示内部身份值 |\n| 3 | ⚙️ 执行驾驶员面部潮红/出汗异常检测 | 调用 `-m scripts.smyx_driver_flushing_sweat_detection_analysis` 处理输入（**必须在技能根目录下运行脚本**） |\n| 4 | 📊 查看分析结果 | 接收结构化分析报告，查看识别/监测结果、风险提示、建议与报告链接 |\n\n### ⚙️ 脚本参数说明\n\n| 参数 | 含义 | 备注 |\n|---|---|---|\n| `--input` | 本地车载 DMS 驾驶员面部视频文件路径 | 适用于本地文件分析 |\n| `--url` | 网络车载 DMS 驾驶员面部视频 URL 地址（API 服务自动下载） | API 服务自动下载网络资源 |\n| `--pet-type` | 类别标识，驾驶员健康监测场景默认 `other` | 按需填写 |\n| `--list` | 显示驾驶员面部潮红/出汗异常历史分析报告列表清单（可以输入起始日期参数过滤数据范围） | 用于云端历史报告查询 |\n| `--api-url` | API 服务地址（可选，使用默认值） | 按需填写 |\n| `--detail` | 输出详细程度（basic/standard/json，默认 json） | 输出详细程度 |\n| `--output` | 结果输出文件路径（可选） | 可选 |\n\n## 🗂️ 资源索引 | Resource Index\n| 资源类型 | 路径 | 用途 | 何时读取 |\n|---|---|---|---|\n| 🐍 必要脚本 | [`scripts/smyx_driver_flushing_sweat_detection_analysis.py`](scripts/smyx_driver_flushing_sweat_detection_analysis.py) | 调用 API、执行分析或查询历史报告 | 执行分析或查询时使用 |\n| 🐍 必要脚本 | [`scripts/config.py`](scripts/config.py) | 调用 API、执行分析或查询历史报告 | 执行分析或查询时使用 |\n| 📘 领域参考 | [`references/api_doc.md`](references/api_doc.md) | 了解 API 接口规范、字段说明和错误码 | 仅在需要了解接口规范或错误码时读取 |\n\n## ⚠️ 注意事项 | Notes\n| 分类 | 注意事项 |\n|---|---|\n| 📚 文档读取 | 仅在需要时读取参考文档，保持上下文简洁 |\n| 📁 格式支持 | 输入要求：支持 mp4/avi/mov 视频，最大 10MB；**关键**：必须有彩色 RGB 通道，纯红外通道无法识别潮红 |\n| 🧑‍⚖️ 结果性质 | 检测结果仅作为驾驶员辅助健康提醒，本工具不替代体温计、血压计、血糖仪、心电图等医疗设备，更不替代医生诊断 |\n| 🔎 使用提醒 | 受光照、车窗有色膜、肤色个体差异影响较大，建议结合基线值与持续时间综合判定 |\n| 🔏 隐私合规 | 隐私合规：车载驾驶员视频涉及个人生物特征隐私，使用前需取得驾驶员/员工知情同意，车队部署应遵循当地隐私法规并妥善保管/加密相关录像 |\n| 🚫 脚本限制 | 禁止临时生成脚本，只能用技能本身的脚本 |\n| 🌐 网络地址 | 传入的网络地址参数，不需要下载本地，默认地址都是公网地址，api 服务会自动下载 |\n| 📜 报告输出 | 当显示历史分析报告清单的时候，从接口返回 json 数据中提取字段  作为超链接地址，且自动转化为如下 Markdown |\n| 📜 报告输出 | 表格输出示例 |\n\n## 🧰 使用示例 | Examples\n```bash\n# 分析本地车载 DMS 驾驶员视频\npython -m scripts.smyx_driver_flushing_sweat_detection_analysis --input /path/to/dms.mp4\n\n# 分析网络车载 DMS 驾驶员视频\npython -m scripts.smyx_driver_flushing_sweat_detection_analysis --url https://example.com/dms.mp4\n\n# 显示历史驾驶员潮红/出汗异常报告（自动触发关键词：查看驾驶员健康历史报告、潮红预警清单等）\npython -m scripts.smyx_driver_flushing_sweat_detection_analysis --list\n\n# 输出精简报告\npython -m scripts.smyx_driver_flushing_sweat_detection_analysis --input dms.mp4 --detail basic\n\n# 保存结果到文件\npython -m scripts.smyx_driver_flushing_sweat_detection_analysis --input dms.mp4 --output result.json\n```\n\nFile v1.0.8:_meta.json\n\n{\n  \"ownerId\": \"kn7cyxkr2ymf7zwsrybpedg8xx83ywrj\",\n  \"slug\": \"smyx-driver-flushing-sweat-detection-analysis\",\n  \"version\": \"1.0.8\",\n  \"publishedAt\": 1787030371328\n}\n\nFile v1.0.8:references/api_doc.md\n\n# API 接口文档\n\n此处用于存放驾驶员面部潮红/出汗异常检测 API 的接口文档，待后续补充。\n\n## 接口规范\n\n- 基础地址：由 smyx_common 配置统一管理\n- 认证方式：API Key 鉴权\n- 响应格式：JSON\n\n## 主要接口\n\n1. `/web/health-analysis/v2/start-health-analysis` - 启动驾驶员潮红/出汗异常检测任务\n2. `/web/health-analysis/v2/get-health-analysis-result` - 获取潮红/出汗分析结果\n3. `/web/health-analysis/page-health-analysis-result` - 分页查询历史异常事件\n4. `/health/order/api/getReportDetailExport?id={id}` - 导出完整报告\n\n## 场景代码\n\n- `SMYX_DRIVER_FLUSHING_SWEAT_DETECTION_ANALYSIS` - 驾驶员面部潮红/出汗异常检测\n\n## 输入约束\n\n- 摄像头：车载 DMS 摄像头，**优先使用彩色（RGB）通道**；纯红外通道无法识别潮红\n- 安装位置：方向盘上方 / A 柱 / 仪表台上方，正对驾驶员面部\n- 帧率：≥ 15 FPS；分辨率 ≥ 480p\n- 光照尽量稳定（白平衡固定），避免强逆光、车窗滤色片严重影响 RGB\n- 戴口罩会显著降低潮红面积识别可靠性\n\n## 关键观测特征\n\n- `flush_index` - 面部潮红指数（基于 RGB 红色分量比 / 肤色模型偏移，0-1）\n- `flush_area_ratio` - 潮红区域面积占面部 ROI 的比例\n- `sweat_glare_area_ratio` - 汗珠/皮肤反光面积占面部 ROI 的比例\n- `skin_texture_score` - 皮肤纹理粗糙度（受汗液/油脂反光影响）\n- `baseline_flush_index` - 当次会话起始基线潮红值（用于变化幅度判定）\n- `flush_index_delta` - 当前潮红指数相对基线的变化幅度\n\n## 默认阈值（可由调用方覆盖）\n\n- 潮红指数阈值：`flush_index > 0.6` 或 `flush_index_delta > 0.25`\n- 出汗反光面积阈值：`sweat_glare_area_ratio > 0.15`（约 15% 面部 ROI）\n- 持续时间阈值：异常状态持续超过 5 秒触发提醒\n\n## 预警类型\n\n- `facial_flushing` - 面部潮红显著升高（可能与血压升高 / 发热 / 情绪激动等相关）\n- `excessive_sweating` - 大量出汗（可能与热应激 / 低血糖 / 心脏不适等相关）\n- `combined_flush_sweat` - 潮红 + 出汗同时出现（更高优先级提醒）\n\n## 输出字段（参考）\n\n- `driver_detected` - 是否检测到驾驶员\n- `face_visible` - 面部是否可见（戴口罩/严重遮挡时为 false）\n- `flush_metrics` - 潮红相关指标（flush_index / flush_area_ratio / flush_index_delta）\n- `sweat_metrics` - 出汗相关指标（sweat_glare_area_ratio / skin_texture_score）\n- `warning_type` - 触发的预警类型\n- `warning_message` - 预警提示文本（如\"驾驶员面部潮红指数上升 0.32 且额头出汗反光面积 22%，请注意身体状态，建议就近停车休息\"）\n- `recommend_action` - 建议的座舱联动动作（voice_alert / fleet_upload / event_record）\n\n> 仅输出基于视觉的面部潮红/出汗异常现象提示，不提供血压、心脏病、中暑、低血糖等具体医学诊断；如有不适请及时就医并由专业人员评估。\n\nFile v1.0.8:skills/smyx_analysis/references/api_doc.md\n\n# API接口文档\n\n## 接口规范\n\n- 基础地址：由 smyx_common 配置统一管理\n- 认证方式：API Key 鉴权\n- 请求格式：支持文件上传\n- 响应格式：JSON\n\n## 错误码说明\n\n| 错误码 | 说明       |\n|-----|----------|\n| 400 | 请求参数错误   |\n| 401 | API密钥无效  |\n| 403 | 权限不足     |\n| 413 | 文件过大     |\n| 415 | 不支持的文件格式 |\n| 500 | 服务器内部错误  |\n\nFile v1.0.8:scripts/config.yaml\n\n{}\n\nFile v1.0.8:skills/smyx_analysis/scripts/config.yaml\n\n{}\n\nFile v1.0.8:skills/smyx_common/scripts/config-dev.yaml\n\nApiEnum:\n  base-url-open-api: \"http://192.168.1.234:9601/smyx-open-api\"\n  base-url-open-h5: \"http://192.168.1.234:4100\"\n  base-url-health: \"http://192.168.1.234:7070/jeecg-boot-xzgz\"\n\nConstantEnum:\n  is-debug: true\n\nFile v1.0.8:skills/smyx_common/scripts/config-test.yaml\n\nApiEnum:\n  base-url-open-api: \"https://livemonitortest.lifeemergence.com/smyx-open-api\"\n  base-url-open-h5: \"http://livemonitortest.lifeemergence.com\"\n  base-url-health: \"https://healthtest.lifeemergence.com/jeecg-boot-xzgz\"\n\nConstantEnum:\n  is-debug: true\n\nFile v1.0.8:skills/smyx_common/scripts/config.yaml\n\nApiEnum:\n  api-key: null\n  api-secret-key: null\n  base-url-health: https://lifeemergence.com/jeecg-boot-xzgz\n  base-url-open-api: https://open.lifeemergence.com/smyx-open-api\n  base-url-open-h5: http://livemonitor.lifeemergence.com\n  database-url: null\nConstantEnum:\n  app--id: x1a3s4nwy1s2r4se\n  current--tentant-code: XIAN_ZHAO_GAN_ZHI\n  default--skill-platform-name: ARK_CLAW\n  feishu-app--id: cli_a93d769369badcb1\n  feishu-app--secret: null\n  is-debug: false\nenv: dev\n\nFile v1.0.8:skill-card.md\n\n## Description:\n\nAnalyzes in-cabin DMS driver face video for facial flushing and sweat-reflection signals, then returns visual health-risk reminders and rest or medical-care suggestions.\n\nThis skill is ready for commercial/non-commercial use.\n\n## Publisher:\n\n[smyx-sunjinhui](https://clawhub.ai/user/smyx-sunjinhui)\n\n### License/Terms of Use:\n\nMIT-0\n\n## Use Case:\n\nDrivers, fleet operators, and developers use this skill to analyze driver-face video or report history for visual signs of facial flushing and abnormal sweating. It supports health-adjacent driver safety reminders, not medical diagnosis.\n\n### Deployment Geography for Use:\n\nGlobal\n\n## Known Risks and Mitigations:\n\nRisk: Driver-face video and health-adjacent reports are processed through vendor cloud APIs.\n\nMitigation: Use only with confirmed driver or employee consent, approved report access controls, and reviewed retention terms.\n\nRisk: The skill silently creates and persists identity tokens for API access.\n\nMitigation: Protect the workspace data directory and local token database, and confirm token rotation or revocation procedures before deployment.\n\nRisk: Broad report-history queries could expose driver or fleet health events beyond the intended scope.\n\nMitigation: Limit history queries to authorized accounts, drivers, fleets, and time ranges, and audit access to exported report links.\n\nRisk: Visual flushing or sweating alerts may be mistaken for medical diagnosis.\n\nMitigation: Present results as visual abnormality reminders only and direct users to professional medical evaluation when symptoms or concerns exist.\n\n## Reference(s):\n\n- [ClawHub skill page](https://clawhub.ai/smyx-sunjinhui/skills/smyx-driver-flushing-sweat-detection-analysis)\n- [Driver flushing and sweat detection API documentation](references/api_doc.md)\n- [General analysis API documentation](skills/smyx_analysis/references/api_doc.md)\n- [Skill demo](https://lifeemergence.com/sample.html)\n\n## Skill Output:\n\n**Output Type(s):** [Text, Markdown, JSON, Shell commands, Guidance]\n\n**Output Format:** [Markdown and JSON-style structured analysis text]\n\n**Output Parameters:** [1D]\n\n**Other Properties Related to Output:** [May include health-risk reminder text, recommended actions, report links, and structured history results.]\n\n## Skill Version(s):\n\n1.0.8 (source: server release metadata; artifact frontmatter says 1.0.10)\n\n## Ethical Considerations:\n\nUsers should evaluate whether this skill is appropriate for their environment, review any generated or modified files before relying on them, and apply their organization's safety, security, and compliance requirements before deployment.\n\nFile v1.0.8:skills/smyx_analysis/requirements.txt\n\npydash==8.0.6\nSQLAlchemy==2.0.46\nyaml==6.0.3\n\nFile v1.0.8:skills/smyx_common/requirements.txt\n\npydash==8.0.6\nSQLAlchemy==2.0.46\nPyYAML==6.0.3\n\nArchive v1.0.7: 31 files, 41446 bytes\n\nFiles: references/api_doc.md (3051b), scripts/__init__.py (61b), scripts/config.py (700b), scripts/config.yaml (3b), scripts/skill.py (589b), scripts/smyx_driver_flushing_sweat_detection_analysis.py (3642b), skill-card.md (2622b), SKILL.md (13264b), skills/smyx_analysis/__init__.py (0b), skills/smyx_analysis/references/api_doc.md (427b), skills/smyx_analysis/requirements.txt (45b), skills/smyx_analysis/scripts/__init__.py (0b), skills/smyx_analysis/scripts/api_service.py (1509b), skills/smyx_analysis/scripts/config.py (1003b), skills/smyx_analysis/scripts/config.yaml (3b), skills/smyx_analysis/scripts/skill.py (6529b), skills/smyx_analysis/scripts/smyx_analysis.py (3833b), skills/smyx_common/__init__.py (0b), skills/smyx_common/requirements.txt (47b), skills/smyx_common/scripts/__init__.py (177b), skills/smyx_common/scripts/api_service.py (2645b), skills/smyx_common/scripts/base.py (469b), skills/smyx_common/scripts/config-dev.yaml (214b), skills/smyx_common/scripts/config-prod.yaml (0b), skills/smyx_common/scripts/config-test.yaml (256b), skills/smyx_common/scripts/config.py (24363b), skills/smyx_common/scripts/config.yaml (472b), skills/smyx_common/scripts/dao.py (18266b), skills/smyx_common/scripts/skill.py (2473b), skills/smyx_common/scripts/util.py (28776b), _meta.json (164b)\n\nFile v1.0.7:SKILL.md\n\n---\nname: \"smyx-driver-flushing-sweat-detection-analysis\"\ndescription: \"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). | 通过车载DMS摄像头实时分析驾驶员面部视频，检测面部肤色变化（潮红指数，通过RGB色空间中的红色分量比例或肤色模型）以及汗珠/反光面积（通过图像纹理和反射特征）。当潮红指数显著升高（可能提示血压升高、发热或情绪激动）或出汗区域面积超过阈值（可能提示热应激、低血糖或心脏问题）时，输出健康风险提醒，建议驾驶员停车休息或就医。\"\nversion: \"1.0.10\"\nlicense: \"MIT-0\"\n---\n\n# 🥵 Driver Facial Flushing / Sweat Abnormality Detection | 驾驶员面部潮红/出汗异常检测\n> **智能分析中枢** · 图片/视频智能分析 · 结构化报告 · 历史报告云端查询\n\n---\n\n## 🧭 技能概览 | Overview\n\n| 模块 | 内容 |\n|---|---|\n| 🏷️ 技能名称 | **驾驶员面部潮红/出汗异常检测** |\n| 🎯 核心目标 | 通过车载DMS摄像头实时分析驾驶员面部视频，检测面部肤色变化（潮红指数，通过RGB色空间中的红色分量比例或肤色模型）以及汗珠/反光面积（通过图像纹理和反射特征）。当潮红指数显著升高（可能提示血压升高、发热或情绪激动）或出汗区域面积超过阈值（可能提示热应激、低血糖或心脏问题）时，输出健康风险提醒，建议驾驶员停车休息或就医。 |\n| 🖼️ 输入类型 | 图片、视频、本地文件、网络 URL |\n| 📝 输出能力 | 结构化分析报告、识别/监测结果、建议与报告链接 |\n| 🧩 场景码 | `SMYX_DRIVER_FLUSHING_SWEAT_DETECTION_ANALYSIS` |\n\nUsing 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.\n\n通过车载DMS摄像头实时分析驾驶员面部视频，检测面部肤色变化（潮红指数，通过RGB色空间中的红色分量比例或肤色模型）以及汗珠/反光面积（通过图像纹理和反射特征）。当潮红指数显著升高（可能提示血压升高、发热或情绪激动）或出汗区域面积超过阈值（可能提示热应激、低血糖或心脏问题）时，输出健康风险提醒，建议驾驶员停车休息或就医。该技能旨在辅助驾驶员关注自身健康，避免因突发疾病引发事故。应用场景：乘用车、商用车、网约车、货运车队。系统实时监测，当检测到面部潮红或大量出汗时，通过语音提示'请注意身体状态，建议休息'或推送至车队管理平台。技能特点：驾驶员突发疾病（如心梗、中暑、低血糖）往往会导致车辆失控，引发重大事故。通过AI实时监测面部潮红和出汗异常，可早期提醒驾驶员关注自身状态，采取休息或求助措施，降低事故风险。该技能可作为DMS系统的增值功能，提升车辆主动安全水平，尤其适合营运车辆和网约车平台。\n\n## 🤖 AI 角色 | AI Role\n| 角色要点 | 说明 |\n|---|---|\n| 说明 1 | **假设你是一个专业的驾驶员健康监测 AI。你的任务是分析驾驶员面部视频，检测面部潮红指数（肤色中红色分量的变化）和出汗区域（汗珠或皮肤反光面积）。当潮红指数超过阈值或出汗面积超过预设比例时，输出健康风险提醒。不要提供医疗诊断或具体临床判断，仅输出基于视觉的异常现象提示。** |\n\n## 🎬 技能演示 | Skill Demo\n\n[▶️ 点击查看技能使用介绍](https://lifeemergence.com/sample.html)\n\n---\n\n## 🎯 任务目标 | Goals\n### 1. 🧩 技能用途\n\n基于车载 DMS 摄像头驾驶员面部视频，实时检测面部潮红指数与出汗反光面积，按阈值输出健康风险提醒\n\n### 2. 🛠️ 能力范围\n\n| 序号 | 具体能力 |\n|---:|---|\n| 1 | 驾驶员面部检测 |\n| 2 | 面部 ROI 分区（额头/双颊/鼻翼） |\n| 3 | 潮红指数计算（RGB 红色分量比 / 肤色模型偏移） |\n| 4 | 潮红面积比 |\n| 5 | 汗珠/反光面积比 |\n| 6 | 皮肤纹理粗糙度 |\n| 7 | 基线值与变化幅度 |\n| 8 | 异常等级判定 |\n| 9 | 座舱联动动作建议（voice_alert / fleet_upload / event_record） |\n\n### 3. ⚡ 触发条件\n\n| 触发类型 | 触发规则 |\n|---|---|\n| ✅ 默认触发 | **默认触发**：当用户提供车载 DMS 驾驶员面部视频 URL 或文件需要分析时，默认触发本技能进行潮红/出汗异常检测 |\n| 🔎 明确分析意图 | 当用户明确提及驾驶员健康、面部潮红、出汗异常、突发疾病、心梗预警、中暑预警、低血糖、DMS 健康监测、营运车辆健康等关键词，并且上传了视频文件 |\n| 📚 历史报告查询 | 当用户提及以下关键词时，**自动触发历史报告查询功能** ：查看驾驶员健康历史报告、潮红预警清单、出汗异常报告清单、查询历史驾驶员健康事件、显示所有驾驶员健康报告、显示车队健康诊断报告，查询驾驶员健康事件清单 |\n\n### 4. 🤖 自动行为\n\n| 自动行为 | 执行要求 |\n|---|---|\n| 📎 附件处理 | 如果用户上传了附件或者视频/图片文件，则自动保存为本地文件 |\n| ☁️ 历史报告查询 | 如果用户触发历史报告查询关键词，必须直接调用云端 API 查询，不得从本地记忆或人工汇总中获取 |\n\n#### ⚠️ 强制数据获取规则（次高优先级）\n\n> **橙色强约束：** 历史报告清单只允许从云端接口读取，不允许从本地记录、长期记忆或人工汇总中提取。\n\n必须执行：\n\n```bash\npython -m scripts.smyx_driver_flushing_sweat_detection_analysis --list\n```\n\n| 类型 | 要求 |\n|---|---|\n| ✅ 必须 | 使用 `python -m scripts.smyx_driver_flushing_sweat_detection_analysis --list` 调用 API 查询云端的历史报告数据 |\n| 🚫 严格禁止 | 从本地 `memory` 目录读取历史会话信息 |\n| 🚫 严格禁止 | 手动汇总本地记录中的报告 |\n| 🚫 严格禁止 | 从长期记忆中提取报告 |\n| ✅ 输出格式 | 必须统一从云端接口获取最新完整数据，然后以 Markdown 表格格式输出结果 |\n\n## 📦 前置准备 | Requirements\n- 依赖说明:scripts 脚本所需的依赖包及版本\n  ```\n  requests>=2.28.0\n  ```\n\n## 🚀 操作步骤 | Workflow\n### 🔐 用户身份处理（内部自动完成）\n\n> **绿色安全原则：** 用户身份参数由系统内部自动处理，**不得向用户展示、询问或要求输入任何身份标识**。\n\n执行本技能分析或历史报告查询时，脚本会自动完成身份初始化：\n\n| 场景 | 系统行为 |\n|---|---|\n| 上游系统有内部身份参数 | 由脚本静默接收并使用 |\n| 上游系统未提供内部身份参数 | 脚本会自动复用本地缺省用户 |\n| 本地缺省用户不存在 | 脚本会自动创建并在后续任务中复用 |\n| 对用户输出 | 只展示分析进度、分析结果和报告链接，不展示内部身份值 |\n\n#### 🔒 关键约束\n\n| 禁止/要求 | 说明 |\n|---|---|\n| 🚫 不得询问身份 | 不得提示用户输入用户名、手机号或任何内部身份参数 |\n| 🚫 不得暴露身份值 | 不得在回复、报告、示例、错误提示中暴露内部身份值 |\n| 🚫 不得列为用户参数 | 不得把内部身份参数列为用户需要理解或传入的参数 |\n| ✅ 自动关联报告 | 历史报告查询同样由系统内部身份自动关联，用户只需表达“查看历史报告/报告清单”等意图 |\n\n---\n\n### 🧪 标准流程 | Standard Flow\n\n| 步骤 | 阶段 | 执行动作 |\n|---:|---|---|\n| 1 | 📥 准备车载 DMS 驾驶员面部视频输入 | 提供本地文件路径或网络 URL；确保输入内容清晰、符合技能场景要求 |\n| 2 | 🔐 系统自动完成身份关联 | 无需用户输入任何身份参数；不在回复中展示内部身份值 |\n| 3 | ⚙️ 执行驾驶员面部潮红/出汗异常检测 | 调用 `-m scripts.smyx_driver_flushing_sweat_detection_analysis` 处理输入（**必须在技能根目录下运行脚本**） |\n| 4 | 📊 查看分析结果 | 接收结构化分析报告，查看识别/监测结果、风险提示、建议与报告链接 |\n\n### ⚙️ 脚本参数说明\n\n| 参数 | 含义 | 备注 |\n|---|---|---|\n| `--input` | 本地车载 DMS 驾驶员面部视频文件路径 | 适用于本地文件分析 |\n| `--url` | 网络车载 DMS 驾驶员面部视频 URL 地址（API 服务自动下载） | API 服务自动下载网络资源 |\n| `--pet-type` | 类别标识，驾驶员健康监测场景默认 `other` | 按需填写 |\n| `--list` | 显示驾驶员面部潮红/出汗异常历史分析报告列表清单（可以输入起始日期参数过滤数据范围） | 用于云端历史报告查询 |\n| `--api-url` | API 服务地址（可选，使用默认值） | 按需填写 |\n| `--detail` | 输出详细程度（basic/standard/json，默认 json） | 输出详细程度 |\n| `--output` | 结果输出文件路径（可选） | 可选 |\n\n## 🗂️ 资源索引 | Resource Index\n| 资源类型 | 路径 | 用途 | 何时读取 |\n|---|---|---|---|\n| 🐍 必要脚本 | [`scripts/smyx_driver_flushing_sweat_detection_analysis.py`](scripts/smyx_driver_flushing_sweat_detection_analysis.py) | 调用 API、执行分析或查询历史报告 | 执行分析或查询时使用 |\n| 🐍 必要脚本 | [`scripts/config.py`](scripts/config.py) | 调用 API、执行分析或查询历史报告 | 执行分析或查询时使用 |\n| 📘 领域参考 | [`references/api_doc.md`](references/api_doc.md) | 了解 API 接口规范、字段说明和错误码 | 仅在需要了解接口规范或错误码时读取 |\n\n## ⚠️ 注意事项 | Notes\n| 分类 | 注意事项 |\n|---|---|\n| 📚 文档读取 | 仅在需要时读取参考文档，保持上下文简洁 |\n| 📁 格式支持 | 输入要求：支持 mp4/avi/mov 视频，最大 10MB；**关键**：必须有彩色 RGB 通道，纯红外通道无法识别潮红 |\n| 🧑‍⚖️ 结果性质 | 检测结果仅作为驾驶员辅助健康提醒，本工具不替代体温计、血压计、血糖仪、心电图等医疗设备，更不替代医生诊断 |\n| 🔎 使用提醒 | 受光照、车窗有色膜、肤色个体差异影响较大，建议结合基线值与持续时间综合判定 |\n| 🔏 隐私合规 | 隐私合规：车载驾驶员视频涉及个人生物特征隐私，使用前需取得驾驶员/员工知情同意，车队部署应遵循当地隐私法规并妥善保管/加密相关录像 |\n| 🚫 脚本限制 | 禁止临时生成脚本，只能用技能本身的脚本 |\n| 🌐 网络地址 | 传入的网络地址参数，不需要下载本地，默认地址都是公网地址，api 服务会自动下载 |\n| 📜 报告输出 | 当显示历史分析报告清单的时候，从接口返回 json 数据中提取字段  作为超链接地址，且自动转化为如下 Markdown |\n| 📜 报告输出 | 表格输出示例 |\n\n## 🧰 使用示例 | Examples\n```bash\n# 分析本地车载 DMS 驾驶员视频\npython -m scripts.smyx_driver_flushing_sweat_detection_analysis --input /path/to/dms.mp4\n\n# 分析网络车载 DMS 驾驶员视频\npython -m scripts.smyx_driver_flushing_sweat_detection_analysis --url https://example.com/dms.mp4\n\n# 显示历史驾驶员潮红/出汗异常报告（自动触发关键词：查看驾驶员健康历史报告、潮红预警清单等）\npython -m scripts.smyx_driver_flushing_sweat_detection_analysis --list\n\n# 输出精简报告\npython -m scripts.smyx_driver_flushing_sweat_detection_analysis --input dms.mp4 --detail basic\n\n# 保存结果到文件\npython -m scripts.smyx_driver_flushing_sweat_detection_analysis --input dms.mp4 --output result.json\n```\n\nFile v1.0.7:_meta.json\n\n{\n  \"ownerId\": \"kn7cyxkr2ymf7zwsrybpedg8xx83ywrj\",\n  \"slug\": \"smyx-driver-flushing-sweat-detection-analysis\",\n  \"version\": \"1.0.7\",\n  \"publishedAt\": 1786875207469\n}\n\nFile v1.0.7:references/api_doc.md\n\n# API 接口文档\n\n此处用于存放驾驶员面部潮红/出汗异常检测 API 的接口文档，待后续补充。\n\n## 接口规范\n\n- 基础地址：由 smyx_common 配置统一管理\n- 认证方式：API Key 鉴权\n- 响应格式：JSON\n\n## 主要接口\n\n1. `/web/health-analysis/v2/start-health-analysis` - 启动驾驶员潮红/出汗异常检测任务\n2. `/web/health-analysis/v2/get-health-analysis-result` - 获取潮红/出汗分析结果\n3. `/web/health-analysis/page-health-analysis-result` - 分页查询历史异常事件\n4. `/health/order/api/getReportDetailExport?id={id}` - 导出完整报告\n\n## 场景代码\n\n- `SMYX_DRIVER_FLUSHING_SWEAT_DETECTION_ANALYSIS` - 驾驶员面部潮红/出汗异常检测\n\n## 输入约束\n\n- 摄像头：车载 DMS 摄像头，**优先使用彩色（RGB）通道**；纯红外通道无法识别潮红\n- 安装位置：方向盘上方 / A 柱 / 仪表台上方，正对驾驶员面部\n- 帧率：≥ 15 FPS；分辨率 ≥ 480p\n- 光照尽量稳定（白平衡固定），避免强逆光、车窗滤色片严重影响 RGB\n- 戴口罩会显著降低潮红面积识别可靠性\n\n## 关键观测特征\n\n- `flush_index` - 面部潮红指数（基于 RGB 红色分量比 / 肤色模型偏移，0-1）\n- `flush_area_ratio` - 潮红区域面积占面部 ROI 的比例\n- `sweat_glare_area_ratio` - 汗珠/皮肤反光面积占面部 ROI 的比例\n- `skin_texture_score` - 皮肤纹理粗糙度（受汗液/油脂反光影响）\n- `baseline_flush_index` - 当次会话起始基线潮红值（用于变化幅度判定）\n- `flush_index_delta` - 当前潮红指数相对基线的变化幅度\n\n## 默认阈值（可由调用方覆盖）\n\n- 潮红指数阈值：`flush_index > 0.6` 或 `flush_index_delta > 0.25`\n- 出汗反光面积阈值：`sweat_glare_area_ratio > 0.15`（约 15% 面部 ROI）\n- 持续时间阈值：异常状态持续超过 5 秒触发提醒\n\n## 预警类型\n\n- `facial_flushing` - 面部潮红显著升高（可能与血压升高 / 发热 / 情绪激动等相关）\n- `excessive_sweating` - 大量出汗（可能与热应激 / 低血糖 / 心脏不适等相关）\n- `combined_flush_sweat` - 潮红 + 出汗同时出现（更高优先级提醒）\n\n## 输出字段（参考）\n\n- `driver_detected` - 是否检测到驾驶员\n- `face_visible` - 面部是否可见（戴口罩/严重遮挡时为 false）\n- `flush_metrics` - 潮红相关指标（flush_index / flush_area_ratio / flush_index_delta）\n- `sweat_metrics` - 出汗相关指标（sweat_glare_area_ratio / skin_texture_score）\n- `warning_type` - 触发的预警类型\n- `warning_message` - 预警提示文本（如\"驾驶员面部潮红指数上升 0.32 且额头出汗反光面积 22%，请注意身体状态，建议就近停车休息\"）\n- `recommend_action` - 建议的座舱联动动作（voice_alert / fleet_upload / event_record）\n\n> 仅输出基于视觉的面部潮红/出汗异常现象提示，不提供血压、心脏病、中暑、低血糖等具体医学诊断；如有不适请及时就医并由专业人员评估。\n\nFile v1.0.7:skills/smyx_analysis/references/api_doc.md\n\n# API接口文档\n\n## 接口规范\n\n- 基础地址：由 smyx_common 配置统一管理\n- 认证方式：API Key 鉴权\n- 请求格式：支持文件上传\n- 响应格式：JSON\n\n## 错误码说明\n\n| 错误码 | 说明       |\n|-----|----------|\n| 400 | 请求参数错误   |\n| 401 | API密钥无效  |\n| 403 | 权限不足     |\n| 413 | 文件过大     |\n| 415 | 不支持的文件格式 |\n| 500 | 服务器内部错误  |\n\nFile v1.0.7:scripts/config.yaml\n\n{}\n\nFile v1.0.7:skills/smyx_analysis/scripts/config.yaml\n\n{}\n\nFile v1.0.7:skills/smyx_common/scripts/config-dev.yaml\n\nApiEnum:\n  base-url-open-api: \"http://192.168.1.234:9601/smyx-open-api\"\n  base-url-open-h5: \"http://192.168.1.234:4100\"\n  base-url-health: \"http://192.168.1.234:7070/jeecg-boot-xzgz\"\n\nConstantEnum:\n  is-debug: true\n\nFile v1.0.7:skills/smyx_common/scripts/config-test.yaml\n\nApiEnum:\n  base-url-open-api: \"https://livemonitortest.lifeemergence.com/smyx-open-api\"\n  base-url-open-h5: \"http://livemonitortest.lifeemergence.com\"\n  base-url-health: \"https://healthtest.lifeemergence.com/jeecg-boot-xzgz\"\n\nConstantEnum:\n  is-debug: true\n\nFile v1.0.7:skills/smyx_common/scripts/config.yaml\n\nApiEnum:\n  api-key: null\n  api-secret-key: null\n  base-url-health: https://lifeemergence.com/jeecg-boot-xzgz\n  base-url-open-api: https://open.lifeemergence.com/smyx-open-api\n  base-url-open-h5: http://livemonitor.lifeemergence.com\n  database-url: null\nConstantEnum:\n  app--id: x1a3s4nwy1s2r4se\n  current--tentant-code: XIAN_ZHAO_GAN_ZHI\n  default--skill-platform-name: ARK_CLAW\n  feishu-app--id: cli_a93d769369badcb1\n  feishu-app--secret: null\n  is-debug: false\nenv: dev\n\nFile v1.0.7:skill-card.md\n\n## Description:\n\nUsing an in-cabin DMS camera, this skill analyzes driver facial video to flag visual signs of facial flushing or abnormal sweating and produce structured health-risk reminders without making a medical diagnosis.\n\nThis skill is ready for commercial/non-commercial use.\n\n## Publisher:\n\n[smyx-sunjinhui](https://clawhub.ai/user/smyx-sunjinhui)\n\n### License/Terms of Use:\n\nMIT-0\n\n## Use Case:\n\nExternal users, fleet operators, and developers use this skill to analyze driver-facing DMS video or images for visual flushing and sweating signals, then return structured alerts, suggested safety actions, and report links. It is intended as an assistive driver-health reminder and does not replace medical instruments or clinical diagnosis.\n\n### Deployment Geography for Use:\n\nGlobal\n\n## Known Risks and Mitigations:\n\nRisk: Sensitive driver facial video and inferred health-risk reports are sent to configured backend services.\n\nMitigation: Use only with clear driver or employee consent, appropriate retention controls, and a reviewed backend configuration.\n\nRisk: The skill silently creates or reuses a persistent local identity and stores authentication tokens.\n\nMitigation: Confirm this identity model is acceptable for the deployment environment and isolate or rotate credentials as needed.\n\nRisk: Visual flushing and sweating signals can be affected by lighting, tinted windows, RGB channel quality, occlusion, and individual skin differences.\n\nMitigation: Treat outputs as assistive reminders, validate input quality, and avoid using the result as a medical diagnosis.\n\n## Reference(s):\n\n- [Driver flushing and sweat detection API documentation](references/api_doc.md)\n- [Shared health analysis API documentation](skills/smyx_analysis/references/api_doc.md)\n- [Skill demo](https://lifeemergence.com/sample.html)\n\n## Skill Output:\n\n**Output Type(s):** [text, markdown, shell commands, guidance]\n\n**Output Format:** [Markdown text containing structured JSON analysis results, warnings, suggested actions, and report links]\n\n**Output Parameters:** [1D]\n\n**Other Properties Related to Output:** [May write the rendered result to a local file when an output path is supplied; history queries return report records from the configured backend.]\n\n## Skill Version(s):\n\n1.0.7 (source: server release evidence; artifact frontmatter reports 1.0.10)\n\n## Ethical Considerations:\n\nUsers should evaluate whether this skill is appropriate for their environment, review any generated or modified files before relying on them, and apply their organization's safety, security, and compliance requirements before deployment.\n\nFile v1.0.7:skills/smyx_analysis/requirements.txt\n\npydash==8.0.6\nSQLAlchemy==2.0.46\nyaml==6.0.3\n\nFile v1.0.7:skills/smyx_common/requirements.txt\n\npydash==8.0.6\nSQLAlchemy==2.0.46\nPyYAML==6.0.3\n\nArchive v1.0.6: 31 files, 41543 bytes\n\nFiles: references/api_doc.md (3051b), scripts/__init__.py (61b), scripts/config.py (700b), scripts/config.yaml (3b), scripts/skill.py (589b), scripts/smyx_driver_flushing_sweat_detection_analysis.py (3642b), skill-card.md (2866b), SKILL.md (13263b), skills/smyx_analysis/__init__.py (0b), skills/smyx_analysis/references/api_doc.md (427b), skills/smyx_analysis/requirements.txt (45b), skills/smyx_analysis/scripts/__init__.py (0b), skills/smyx_analysis/scripts/api_service.py (1509b), skills/smyx_analysis/scripts/config.py (1003b), skills/smyx_analysis/scripts/config.yaml (3b), skills/smyx_analysis/scripts/skill.py (6529b), skills/smyx_analysis/scripts/smyx_analysis.py (3833b), skills/smyx_common/__init__.py (0b), skills/smyx_common/requirements.txt (47b), skills/smyx_common/scripts/__init__.py (177b), skills/smyx_common/scripts/api_service.py (2645b), skills/smyx_common/scripts/base.py (469b), skills/smyx_common/scripts/config-dev.yaml (214b), skills/smyx_common/scripts/config-prod.yaml (0b), skills/smyx_common/scripts/config-test.yaml (256b), skills/smyx_common/scripts/config.py (24363b), skills/smyx_common/scripts/config.yaml (473b), skills/smyx_common/scripts/dao.py (18266b), skills/smyx_common/scripts/skill.py (2473b), skills/smyx_common/scripts/util.py (28776b), _meta.json (164b)\n\nFile v1.0.6:SKILL.md\n\n---\nname: \"smyx-driver-flushing-sweat-detection-analysis\"\ndescription: \"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). | 通过车载DMS摄像头实时分析驾驶员面部视频，检测面部肤色变化（潮红指数，通过RGB色空间中的红色分量比例或肤色模型）以及汗珠/反光面积（通过图像纹理和反射特征）。当潮红指数显著升高（可能提示血压升高、发热或情绪激动）或出汗区域面积超过阈值（可能提示热应激、低血糖或心脏问题）时，输出健康风险提醒，建议驾驶员停车休息或就医。\"\nversion: \"1.0.8\"\nlicense: \"MIT-0\"\n---\n\n# 🥵 Driver Facial Flushing / Sweat Abnormality Detection | 驾驶员面部潮红/出汗异常检测\n> **智能分析中枢** · 图片/视频智能分析 · 结构化报告 · 历史报告云端查询\n\n---\n\n## 🧭 技能概览 | Overview\n\n| 模块 | 内容 |\n|---|---|\n| 🏷️ 技能名称 | **驾驶员面部潮红/出汗异常检测** |\n| 🎯 核心目标 | 通过车载DMS摄像头实时分析驾驶员面部视频，检测面部肤色变化（潮红指数，通过RGB色空间中的红色分量比例或肤色模型）以及汗珠/反光面积（通过图像纹理和反射特征）。当潮红指数显著升高（可能提示血压升高、发热或情绪激动）或出汗区域面积超过阈值（可能提示热应激、低血糖或心脏问题）时，输出健康风险提醒，建议驾驶员停车休息或就医。 |\n| 🖼️ 输入类型 | 图片、视频、本地文件、网络 URL |\n| 📝 输出能力 | 结构化分析报告、识别/监测结果、建议与报告链接 |\n| 🧩 场景码 | `SMYX_DRIVER_FLUSHING_SWEAT_DETECTION_ANALYSIS` |\n\nUsing 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.\n\n通过车载DMS摄像头实时分析驾驶员面部视频，检测面部肤色变化（潮红指数，通过RGB色空间中的红色分量比例或肤色模型）以及汗珠/反光面积（通过图像纹理和反射特征）。当潮红指数显著升高（可能提示血压升高、发热或情绪激动）或出汗区域面积超过阈值（可能提示热应激、低血糖或心脏问题）时，输出健康风险提醒，建议驾驶员停车休息或就医。该技能旨在辅助驾驶员关注自身健康，避免因突发疾病引发事故。应用场景：乘用车、商用车、网约车、货运车队。系统实时监测，当检测到面部潮红或大量出汗时，通过语音提示'请注意身体状态，建议休息'或推送至车队管理平台。技能特点：驾驶员突发疾病（如心梗、中暑、低血糖）往往会导致车辆失控，引发重大事故。通过AI实时监测面部潮红和出汗异常，可早期提醒驾驶员关注自身状态，采取休息或求助措施，降低事故风险。该技能可作为DMS系统的增值功能，提升车辆主动安全水平，尤其适合营运车辆和网约车平台。\n\n## 🤖 AI 角色 | AI Role\n| 角色要点 | 说明 |\n|---|---|\n| 说明 1 | **假设你是一个专业的驾驶员健康监测 AI。你的任务是分析驾驶员面部视频，检测面部潮红指数（肤色中红色分量的变化）和出汗区域（汗珠或皮肤反光面积）。当潮红指数超过阈值或出汗面积超过预设比例时，输出健康风险提醒。不要提供医疗诊断或具体临床判断，仅输出基于视觉的异常现象提示。** |\n\n## 🎬 技能演示 | Skill Demo\n\n[▶️ 点击查看技能使用介绍](https://lifeemergence.com/sample.html)\n\n---\n\n## 🎯 任务目标 | Goals\n### 1. 🧩 技能用途\n\n基于车载 DMS 摄像头驾驶员面部视频，实时检测面部潮红指数与出汗反光面积，按阈值输出健康风险提醒\n\n### 2. 🛠️ 能力范围\n\n| 序号 | 具体能力 |\n|---:|---|\n| 1 | 驾驶员面部检测 |\n| 2 | 面部 ROI 分区（额头/双颊/鼻翼） |\n| 3 | 潮红指数计算（RGB 红色分量比 / 肤色模型偏移） |\n| 4 | 潮红面积比 |\n| 5 | 汗珠/反光面积比 |\n| 6 | 皮肤纹理粗糙度 |\n| 7 | 基线值与变化幅度 |\n| 8 | 异常等级判定 |\n| 9 | 座舱联动动作建议（voice_alert / fleet_upload / event_record） |\n\n### 3. ⚡ 触发条件\n\n| 触发类型 | 触发规则 |\n|---|---|\n| ✅ 默认触发 | **默认触发**：当用户提供车载 DMS 驾驶员面部视频 URL 或文件需要分析时，默认触发本技能进行潮红/出汗异常检测 |\n| 🔎 明确分析意图 | 当用户明确提及驾驶员健康、面部潮红、出汗异常、突发疾病、心梗预警、中暑预警、低血糖、DMS 健康监测、营运车辆健康等关键词，并且上传了视频文件 |\n| 📚 历史报告查询 | 当用户提及以下关键词时，**自动触发历史报告查询功能** ：查看驾驶员健康历史报告、潮红预警清单、出汗异常报告清单、查询历史驾驶员健康事件、显示所有驾驶员健康报告、显示车队健康诊断报告，查询驾驶员健康事件清单 |\n\n### 4. 🤖 自动行为\n\n| 自动行为 | 执行要求 |\n|---|---|\n| 📎 附件处理 | 如果用户上传了附件或者视频/图片文件，则自动保存为本地文件 |\n| ☁️ 历史报告查询 | 如果用户触发历史报告查询关键词，必须直接调用云端 API 查询，不得从本地记忆或人工汇总中获取 |\n\n#### ⚠️ 强制数据获取规则（次高优先级）\n\n> **橙色强约束：** 历史报告清单只允许从云端接口读取，不允许从本地记录、长期记忆或人工汇总中提取。\n\n必须执行：\n\n```bash\npython -m scripts.smyx_driver_flushing_sweat_detection_analysis --list\n```\n\n| 类型 | 要求 |\n|---|---|\n| ✅ 必须 | 使用 `python -m scripts.smyx_driver_flushing_sweat_detection_analysis --list` 调用 API 查询云端的历史报告数据 |\n| 🚫 严格禁止 | 从本地 `memory` 目录读取历史会话信息 |\n| 🚫 严格禁止 | 手动汇总本地记录中的报告 |\n| 🚫 严格禁止 | 从长期记忆中提取报告 |\n| ✅ 输出格式 | 必须统一从云端接口获取最新完整数据，然后以 Markdown 表格格式输出结果 |\n\n## 📦 前置准备 | Requirements\n- 依赖说明:scripts 脚本所需的依赖包及版本\n  ```\n  requests>=2.28.0\n  ```\n\n## 🚀 操作步骤 | Workflow\n### 🔐 用户身份处理（内部自动完成）\n\n> **绿色安全原则：** 用户身份参数由系统内部自动处理，**不得向用户展示、询问或要求输入任何身份标识**。\n\n执行本技能分析或历史报告查询时，脚本会自动完成身份初始化：\n\n| 场景 | 系统行为 |\n|---|---|\n| 上游系统有内部身份参数 | 由脚本静默接收并使用 |\n| 上游系统未提供内部身份参数 | 脚本会自动复用本地缺省用户 |\n| 本地缺省用户不存在 | 脚本会自动创建并在后续任务中复用 |\n| 对用户输出 | 只展示分析进度、分析结果和报告链接，不展示内部身份值 |\n\n#### 🔒 关键约束\n\n| 禁止/要求 | 说明 |\n|---|---|\n| 🚫 不得询问身份 | 不得提示用户输入用户名、手机号或任何内部身份参数 |\n| 🚫 不得暴露身份值 | 不得在回复、报告、示例、错误提示中暴露内部身份值 |\n| 🚫 不得列为用户参数 | 不得把内部身份参数列为用户需要理解或传入的参数 |\n| ✅ 自动关联报告 | 历史报告查询同样由系统内部身份自动关联，用户只需表达“查看历史报告/报告清单”等意图 |\n\n---\n\n### 🧪 标准流程 | Standard Flow\n\n| 步骤 | 阶段 | 执行动作 |\n|---:|---|---|\n| 1 | 📥 准备车载 DMS 驾驶员面部视频输入 | 提供本地文件路径或网络 URL；确保输入内容清晰、符合技能场景要求 |\n| 2 | 🔐 系统自动完成身份关联 | 无需用户输入任何身份参数；不在回复中展示内部身份值 |\n| 3 | ⚙️ 执行驾驶员面部潮红/出汗异常检测 | 调用 `-m scripts.smyx_driver_flushing_sweat_detection_analysis` 处理输入（**必须在技能根目录下运行脚本**） |\n| 4 | 📊 查看分析结果 | 接收结构化分析报告，查看识别/监测结果、风险提示、建议与报告链接 |\n\n### ⚙️ 脚本参数说明\n\n| 参数 | 含义 | 备注 |\n|---|---|---|\n| `--input` | 本地车载 DMS 驾驶员面部视频文件路径 | 适用于本地文件分析 |\n| `--url` | 网络车载 DMS 驾驶员面部视频 URL 地址（API 服务自动下载） | API 服务自动下载网络资源 |\n| `--pet-type` | 类别标识，驾驶员健康监测场景默认 `other` | 按需填写 |\n| `--list` | 显示驾驶员面部潮红/出汗异常历史分析报告列表清单（可以输入起始日期参数过滤数据范围） | 用于云端历史报告查询 |\n| `--api-url` | API 服务地址（可选，使用默认值） | 按需填写 |\n| `--detail` | 输出详细程度（basic/standard/json，默认 json） | 输出详细程度 |\n| `--output` | 结果输出文件路径（可选） | 可选 |\n\n## 🗂️ 资源索引 | Resource Index\n| 资源类型 | 路径 | 用途 | 何时读取 |\n|---|---|---|---|\n| 🐍 必要脚本 | [`scripts/smyx_driver_flushing_sweat_detection_analysis.py`](scripts/smyx_driver_flushing_sweat_detection_analysis.py) | 调用 API、执行分析或查询历史报告 | 执行分析或查询时使用 |\n| 🐍 必要脚本 | [`scripts/config.py`](scripts/config.py) | 调用 API、执行分析或查询历史报告 | 执行分析或查询时使用 |\n| 📘 领域参考 | [`references/api_doc.md`](references/api_doc.md) | 了解 API 接口规范、字段说明和错误码 | 仅在需要了解接口规范或错误码时读取 |\n\n## ⚠️ 注意事项 | Notes\n| 分类 | 注意事项 |\n|---|---|\n| 📚 文档读取 | 仅在需要时读取参考文档，保持上下文简洁 |\n| 📁 格式支持 | 输入要求：支持 mp4/avi/mov 视频，最大 10MB；**关键**：必须有彩色 RGB 通道，纯红外通道无法识别潮红 |\n| 🧑‍⚖️ 结果性质 | 检测结果仅作为驾驶员辅助健康提醒，本工具不替代体温计、血压计、血糖仪、心电图等医疗设备，更不替代医生诊断 |\n| 🔎 使用提醒 | 受光照、车窗有色膜、肤色个体差异影响较大，建议结合基线值与持续时间综合判定 |\n| 🔏 隐私合规 | 隐私合规：车载驾驶员视频涉及个人生物特征隐私，使用前需取得驾驶员/员工知情同意，车队部署应遵循当地隐私法规并妥善保管/加密相关录像 |\n| 🚫 脚本限制 | 禁止临时生成脚本，只能用技能本身的脚本 |\n| 🌐 网络地址 | 传入的网络地址参数，不需要下载本地，默认地址都是公网地址，api 服务会自动下载 |\n| 📜 报告输出 | 当显示历史分析报告清单的时候，从接口返回 json 数据中提取字段  作为超链接地址，且自动转化为如下 Markdown |\n| 📜 报告输出 | 表格输出示例 |\n\n## 🧰 使用示例 | Examples\n```bash\n# 分析本地车载 DMS 驾驶员视频\npython -m scripts.smyx_driver_flushing_sweat_detection_analysis --input /path/to/dms.mp4\n\n# 分析网络车载 DMS 驾驶员视频\npython -m scripts.smyx_driver_flushing_sweat_detection_analysis --url https://example.com/dms.mp4\n\n# 显示历史驾驶员潮红/出汗异常报告（自动触发关键词：查看驾驶员健康历史报告、潮红预警清单等）\npython -m scripts.smyx_driver_flushing_sweat_detection_analysis --list\n\n# 输出精简报告\npython -m scripts.smyx_driver_flushing_sweat_detection_analysis --input dms.mp4 --detail basic\n\n# 保存结果到文件\npython -m scripts.smyx_driver_flushing_sweat_detection_analysis --input dms.mp4 --output result.json\n```\n\nFile v1.0.6:_meta.json\n\n{\n  \"ownerId\": \"kn7cyxkr2ymf7zwsrybpedg8xx83ywrj\",\n  \"slug\": \"smyx-driver-flushing-sweat-detection-analysis\",\n  \"version\": \"1.0.6\",\n  \"publishedAt\": 1785918034999\n}\n\nFile v1.0.6:references/api_doc.md\n\n# API 接口文档\n\n此处用于存放驾驶员面部潮红/出汗异常检测 API 的接口文档，待后续补充。\n\n## 接口规范\n\n- 基础地址：由 smyx_common 配置统一管理\n- 认证方式：API Key 鉴权\n- 响应格式：JSON\n\n## 主要接口\n\n1. `/web/health-analysis/v2/start-health-analysis` - 启动驾驶员潮红/出汗异常检测任务\n2. `/web/health-analysis/v2/get-health-analysis-result` - 获取潮红/出汗分析结果\n3. `/web/health-analysis/page-health-analysis-result` - 分页查询历史异常事件\n4. `/health/order/api/getReportDetailExport?id={id}` - 导出完整报告\n\n## 场景代码\n\n- `SMYX_DRIVER_FLUSHING_SWEAT_DETECTION_ANALYSIS` - 驾驶员面部潮红/出汗异常检测\n\n## 输入约束\n\n- 摄像头：车载 DMS 摄像头，**优先使用彩色（RGB）通道**；纯红外通道无法识别潮红\n- 安装位置：方向盘上方 / A 柱 / 仪表台上方，正对驾驶员面部\n- 帧率：≥ 15 FPS；分辨率 ≥ 480p\n- 光照尽量稳定（白平衡固定），避免强逆光、车窗滤色片严重影响 RGB\n- 戴口罩会显著降低潮红面积识别可靠性\n\n## 关键观测特征\n\n- `flush_index` - 面部潮红指数（基于 RGB 红色分量比 / 肤色模型偏移，0-1）\n- `flush_area_ratio` - 潮红区域面积占面部 ROI 的比例\n- `sweat_glare_area_ratio` - 汗珠/皮肤反光面积占面部 ROI 的比例\n- `skin_texture_score` - 皮肤纹理粗糙度（受汗液/油脂反光影响）\n- `baseline_flush_index` - 当次会话起始基线潮红值（用于变化幅度判定）\n- `flush_index_delta` - 当前潮红指数相对基线的变化幅度\n\n## 默认阈值（可由调用方覆盖）\n\n- 潮红指数阈值：`flush_index > 0.6` 或 `flush_index_delta > 0.25`\n- 出汗反光面积阈值：`sweat_glare_area_ratio > 0.15`（约 15% 面部 ROI）\n- 持续时间阈值：异常状态持续超过 5 秒触发提醒\n\n## 预警类型\n\n- `facial_flushing` - 面部潮红显著升高（可能与血压升高 / 发热 / 情绪激动等相关）\n- `excessive_sweating` - 大量出汗（可能与热应激 / 低血糖 / 心脏不适等相关）\n- `combined_flush_sweat` - 潮红 + 出汗同时出现（更高优先级提醒）\n\n## 输出字段（参考）\n\n- `driver_detected` - 是否检测到驾驶员\n- `face_visible` - 面部是否可见（戴口罩/严重遮挡时为 false）\n- `flush_metrics` - 潮红相关指标（flush_index / flush_area_ratio / flush_index_delta）\n- `sweat_metrics` - 出汗相关指标（sweat_glare_area_ratio / skin_texture_score）\n- `warning_type` - 触发的预警类型\n- `warning_message` - 预警提示文本（如\"驾驶员面部潮红指数上升 0.32 且额头出汗反光面积 22%，请注意身体状态，建议就近停车休息\"）\n- `recommend_action` - 建议的座舱联动动作（voice_alert / fleet_upload / event_record）\n\n> 仅输出基于视觉的面部潮红/出汗异常现象提示，不提供血压、心脏病、中暑、低血糖等具体医学诊断；如有不适请及时就医并由专业人员评估。\n\nFile v1.0.6:skills/smyx_analysis/references/api_doc.md\n\n# API接口文档\n\n## 接口规范\n\n- 基础地址：由 smyx_common 配置统一管理\n- 认证方式：API Key 鉴权\n- 请求格式：支持文件上传\n- 响应格式：JSON\n\n## 错误码说明\n\n| 错误码 | 说明       |\n|-----|----------|\n| 400 | 请求参数错误   |\n| 401 | API密钥无效  |\n| 403 | 权限不足     |\n| 413 | 文件过大     |\n| 415 | 不支持的文件格式 |\n| 500 | 服务器内部错误  |\n\nFile v1.0.6:scripts/config.yaml\n\n{}\n\nFile v1.0.6:skills/smyx_analysis/scripts/config.yaml\n\n{}\n\nFile v1.0.6:skills/smyx_common/scripts/config-dev.yaml\n\nApiEnum:\n  base-url-open-api: \"http://192.168.1.234:9601/smyx-open-api\"\n  base-url-open-h5: \"http://192.168.1.234:4100\"\n  base-url-health: \"http://192.168.1.234:7070/jeecg-boot-xzgz\"\n\nConstantEnum:\n  is-debug: true\n\nFile v1.0.6:skills/smyx_common/scripts/config-test.yaml\n\nApiEnum:\n  base-url-open-api: \"https://livemonitortest.lifeemergence.com/smyx-open-api\"\n  base-url-open-h5: \"http://livemonitortest.lifeemergence.com\"\n  base-url-health: \"https://healthtest.lifeemergence.com/jeecg-boot-xzgz\"\n\nConstantEnum:\n  is-debug: true\n\nFile v1.0.6:skills/smyx_common/scripts/config.yaml\n\nApiEnum:\n  api-key: null\n  api-secret-key: null\n  base-url-health: https://lifeemergence.com/jeecg-boot-xzgz\n  base-url-open-api: https://open.lifeemergence.com/smyx-open-api\n  base-url-open-h5: http://livemonitor.lifeemergence.com\n  database-url: null\nConstantEnum:\n  app--id: x1a3s4nwy1s2r4se\n  current--tentant-code: XIAN_ZHAO_GAN_ZHI\n  default--skill-platform-name: ARK_CLAW\n  feishu-app--id: cli_a93d769369badcb1\n  feishu-app--secret: null\n  is-debug: false\nenv: prod\n\nFile v1.0.6:skill-card.md\n\n## Description:\n\nUsing an in-cabin DMS camera, the skill analyzes driver face video for visual facial flushing and sweat or reflective-area signals, then returns a health-risk reminder without providing a medical diagnosis.\n\nThis skill is ready for commercial/non-commercial use.\n\n## Publisher:\n\n[smyx-sunjinhui](https://clawhub.ai/user/smyx-sunjinhui)\n\n### License/Terms of Use:\n\nMIT-0\n\n## Use Case:\n\nExternal developers, vehicle safety teams, and fleet operators use this skill to route in-cabin DMS images or video to a cloud analysis service and receive structured visual reminders about facial flushing or sweating abnormalities. It is intended as an assistive driver-health alerting workflow, not as a medical diagnostic device.\n\n### Deployment Geography for Use:\n\nGlobal\n\n## Known Risks and Mitigations:\n\nRisk: The skill processes sensitive driver face video and health-adjacent visual inferences through a configured cloud service.\n\nMitigation: Use only with clear driver or employee consent, documented tenant scoping, retention and deletion rules, and controls for exported report links.\n\nRisk: The skill silently creates or reuses a local identity and persists tokens while retrieving historical report links.\n\nMitigation: Review local identity and token storage before deployment, restrict access to report history, and verify that production environments isolate users and tenants correctly.\n\nRisk: Facial flushing and sweat signals can be affected by lighting, camera channel, tinting, occlusion, and individual skin-tone variation.\n\nMitigation: Treat outputs as assistive visual alerts only, require RGB camera input and stable lighting, and route medical concerns to appropriate professional evaluation.\n\n## Reference(s):\n\n- [ClawHub skill page](https://clawhub.ai/smyx-sunjinhui/skills/smyx-driver-flushing-sweat-detection-analysis)\n- [Driver flushing and sweat detection API documentation](references/api_doc.md)\n- [SMYX analysis API documentation](skills/smyx_analysis/references/api_doc.md)\n- [Skill demo](https://lifeemergence.com/sample.html)\n\n## Skill Output:\n\n**Output Type(s):** [text, markdown, shell commands, configuration, guidance]\n\n**Output Format:** [Markdown or JSON-like structured analysis text, with optional saved output files and report links]\n\n**Output Parameters:** [1D]\n\n**Other Properties Related to Output:** [May include visual metrics, warning type, recommended action, analysis status, and historical report links returned by the configured cloud service.]\n\n## Skill Version(s):\n\n1.0.6 (source: server release metadata; artifact frontmatter says 1.0.8)\n\n## Ethical Considerations:\n\nUsers should evaluate whether this skill is appropriate for their environment, review any generated or modified files before relying on them, and apply their organization's safety, security, and compliance requirements before deployment.\n\nFile v1.0.6:skills/smyx_analysis/requirements.txt\n\npydash==8.0.6\nSQLAlchemy==2.0.46\nyaml==6.0.3\n\nFile v1.0.6:skills/smyx_common/requirements.txt\n\npydash==8.0.6\nSQLAlchemy==2.0.46\nPyYAML==6.0.3\n\nArchive v1.0.5: 31 files, 41605 bytes\n\nFiles: references/api_doc.md (3051b), scripts/__init__.py (61b), scripts/config.py (700b), scripts/config.yaml (3b), scripts/skill.py (589b), scripts/smyx_driver_flushing_sweat_detection_analysis.py (3642b), skill-card.md (3098b), SKILL.md (13263b), skills/smyx_analysis/__init__.py (0b), skills/smyx_analysis/references/api_doc.md (427b), skills/smyx_analysis/requirements.txt (45b), skills/smyx_analysis/scripts/__init__.py (0b), skills/smyx_analysis/scripts/api_service.py (1509b), skills/smyx_analysis/scripts/config.py (1003b), skills/smyx_analysis/scripts/config.yaml (3b), skills/smyx_analysis/scripts/skill.py (6529b), skills/smyx_analysis/scripts/smyx_analysis.py (3833b), skills/smyx_common/__init__.py (0b), skills/smyx_common/requirements.txt (47b), skills/smyx_common/scripts/__init__.py (177b), skills/smyx_common/scripts/api_service.py (2645b), skills/smyx_common/scripts/base.py (469b), skills/smyx_common/scripts/config-dev.yaml (214b), skills/smyx_common/scripts/config-prod.yaml (0b), skills/smyx_common/scripts/config-test.yaml (256b), skills/smyx_common/scripts/config.py (24363b), skills/smyx_common/scripts/config.yaml (473b), skills/smyx_common/scripts/dao.py (18266b), skills/smyx_common/scripts/skill.py (2473b), skills/smyx_common/scripts/util.py (28776b), _meta.json (164b)\n\nFile v1.0.5:SKILL.md\n\n---\nname: \"smyx-driver-flushing-sweat-detection-analysis\"\ndescription: \"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). | 通过车载DMS摄像头实时分析驾驶员面部视频，检测面部肤色变化（潮红指数，通过RGB色空间中的红色分量比例或肤色模型）以及汗珠/反光面积（通过图像纹理和反射特征）。当潮红指数显著升高（可能提示血压升高、发热或情绪激动）或出汗区域面积超过阈值（可能提示热应激、低血糖或心脏问题）时，输出健康风险提醒，建议驾驶员停车休息或就医。\"\nversion: \"1.0.8\"\nlicense: \"MIT-0\"\n---\n\n# 🥵 Driver Facial Flushing / Sweat Abnormality Detection | 驾驶员面部潮红/出汗异常检测\n> **智能分析中枢** · 图片/视频智能分析 · 结构化报告 · 历史报告云端查询\n\n---\n\n## 🧭 技能概览 | Overview\n\n| 模块 | 内容 |\n|---|---|\n| 🏷️ 技能名称 | **驾驶员面部潮红/出汗异常检测** |\n| 🎯 核心目标 | 通过车载DMS摄像头实时分析驾驶员面部视频，检测面部肤色变化（潮红指数，通过RGB色空间中的红色分量比例或肤色模型）以及汗珠/反光面积（通过图像纹理和反射特征）。当潮红指数显著升高（可能提示血压升高、发热或情绪激动）或出汗区域面积超过阈值（可能提示热应激、低血糖或心脏问题）时，输出健康风险提醒，建议驾驶员停车休息或就医。 |\n| 🖼️ 输入类型 | 图片、视频、本地文件、网络 URL |\n| 📝 输出能力 | 结构化分析报告、识别/监测结果、建议与报告链接 |\n| 🧩 场景码 | `SMYX_DRIVER_FLUSHING_SWEAT_DETECTION_ANALYSIS` |\n\nUsing 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.\n\n通过车载DMS摄像头实时分析驾驶员面部视频，检测面部肤色变化（潮红指数，通过RGB色空间中的红色分量比例或肤色模型）以及汗珠/反光面积（通过图像纹理和反射特征）。当潮红指数显著升高（可能提示血压升高、发热或情绪激动）或出汗区域面积超过阈值（可能提示热应激、低血糖或心脏问题）时，输出健康风险提醒，建议驾驶员停车休息或就医。该技能旨在辅助驾驶员关注自身健康，避免因突发疾病引发事故。应用场景：乘用车、商用车、网约车、货运车队。系统实时监测，当检测到面部潮红或大量出汗时，通过语音提示'请注意身体状态，建议休息'或推送至车队管理平台。技能特点：驾驶员突发疾病（如心梗、中暑、低血糖）往往会导致车辆失控，引发重大事故。通过AI实时监测面部潮红和出汗异常，可早期提醒驾驶员关注自身状态，采取休息或求助措施，降低事故风险。该技能可作为DMS系统的增值功能，提升车辆主动安全水平，尤其适合营运车辆和网约车平台。\n\n## 🤖 AI 角色 | AI Role\n| 角色要点 | 说明 |\n|---|---|\n| 说明 1 | **假设你是一个专业的驾驶员健康监测 AI。你的任务是分析驾驶员面部视频，检测面部潮红指数（肤色中红色分量的变化）和出汗区域（汗珠或皮肤反光面积）。当潮红指数超过阈值或出汗面积超过预设比例时，输出健康风险提醒。不要提供医疗诊断或具体临床判断，仅输出基于视觉的异常现象提示。** |\n\n## 🎬 技能演示 | Skill Demo\n\n[▶️ 点击查看技能使用介绍](https://lifeemergence.com/sample.html)\n\n---\n\n## 🎯 任务目标 | Goals\n### 1. 🧩 技能用途\n\n基于车载 DMS 摄像头驾驶员面部视频，实时检测面部潮红指数与出汗反光面积，按阈值输出健康风险提醒\n\n### 2. 🛠️ 能力范围\n\n| 序号 | 具体能力 |\n|---:|---|\n| 1 | 驾驶员面部检测 |\n| 2 | 面部 ROI 分区（额头/双颊/鼻翼） |\n| 3 | 潮红指数计算（RGB 红色分量比 / 肤色模型偏移） |\n| 4 | 潮红面积比 |\n| 5 | 汗珠/反光面积比 |\n| 6 | 皮肤纹理粗糙度 |\n| 7 | 基线值与变化幅度 |\n| 8 | 异常等级判定 |\n| 9 | 座舱联动动作建议（voice_alert / fleet_upload / event_record） |\n\n### 3. ⚡ 触发条件\n\n| 触发类型 | 触发规则 |\n|---|---|\n| ✅ 默认触发 | **默认触发**：当用户提供车载 DMS 驾驶员面部视频 URL 或文件需要分析时，默认触发本技能进行潮红/出汗异常检测 |\n| 🔎 明确分析意图 | 当用户明确提及驾驶员健康、面部潮红、出汗异常、突发疾病、心梗预警、中暑预警、低血糖、DMS 健康监测、营运车辆健康等关键词，并且上传了视频文件 |\n| 📚 历史报告查询 | 当用户提及以下关键词时，**自动触发历史报告查询功能** ：查看驾驶员健康历史报告、潮红预警清单、出汗异常报告清单、查询历史驾驶员健康事件、显示所有驾驶员健康报告、显示车队健康诊断报告，查询驾驶员健康事件清单 |\n\n### 4. 🤖 自动行为\n\n| 自动行为 | 执行要求 |\n|---|---|\n| 📎 附件处理 | 如果用户上传了附件或者视频/图片文件，则自动保存为本地文件 |\n| ☁️ 历史报告查询 | 如果用户触发历史报告查询关键词，必须直接调用云端 API 查询，不得从本地记忆或人工汇总中获取 |\n\n#### ⚠️ 强制数据获取规则（次高优先级）\n\n> **橙色强约束：** 历史报告清单只允许从云端接口读取，不允许从本地记录、长期记忆或人工汇总中提取。\n\n必须执行：\n\n```bash\npython -m scripts.smyx_driver_flushing_sweat_detection_analysis --list\n```\n\n| 类型 | 要求 |\n|---|---|\n| ✅ 必须 | 使用 `python -m scripts.smyx_driver_flushing_sweat_detection_analysis --list` 调用 API 查询云端的历史报告数据 |\n| 🚫 严格禁止 | 从本地 `memory` 目录读取历史会话信息 |\n| 🚫 严格禁止 | 手动汇总本地记录中的报告 |\n| 🚫 严格禁止 | 从长期记忆中提取报告 |\n| ✅ 输出格式 | 必须统一从云端接口获取最新完整数据，然后以 Markdown 表格格式输出结果 |\n\n## 📦 前置准备 | Requirements\n- 依赖说明:scripts 脚本所需的依赖包及版本\n  ```\n  requests>=2.28.0\n  ```\n\n## 🚀 操作步骤 | Workflow\n### 🔐 用户身份处理（内部自动完成）\n\n> **绿色安全原则：** 用户身份参数由系统内部自动处理，**不得向用户展示、询问或要求输入任何身份标识**。\n\n执行本技能分析或历史报告查询时，脚本会自动完成身份初始化：\n\n| 场景 | 系统行为 |\n|---|---|\n| 上游系统有内部身份参数 | 由脚本静默接收并使用 |\n| 上游系统未提供内部身份参数 | 脚本会自动复用本地缺省用户 |\n| 本地缺省用户不存在 | 脚本会自动创建并在后续任务中复用 |\n| 对用户输出 | 只展示分析进度、分析结果和报告链接，不展示内部身份值 |\n\n#### 🔒 关键约束\n\n| 禁止/要求 | 说明 |\n|---|---|\n| 🚫 不得询问身份 | 不得提示用户输入用户名、手机号或任何内部身份参数 |\n| 🚫 不得暴露身份值 | 不得在回复、报告、示例、错误提示中暴露内部身份值 |\n| 🚫 不得列为用户参数 | 不得把内部身份参数列为用户需要理解或传入的参数 |\n| ✅ 自动关联报告 | 历史报告查询同样由系统内部身份自动关联，用户只需表达“查看历史报告/报告清单”等意图 |\n\n---\n\n### 🧪 标准流程 | Standard Flow\n\n| 步骤 | 阶段 | 执行动作 |\n|---:|---|---|\n| 1 | 📥 准备车载 DMS 驾驶员面部视频输入 | 提供本地文件路径或网络 URL；确保输入内容清晰、符合技能场景要求 |\n| 2 | 🔐 系统自动完成身份关联 | 无需用户输入任何身份参数；不在回复中展示内部身份值 |\n| 3 | ⚙️ 执行驾驶员面部潮红/出汗异常检测 | 调用 `-m scripts.smyx_driver_flushing_sweat_detection_analysis` 处理输入（**必须在技能根目录下运行脚本**） |\n| 4 | 📊 查看分析结果 | 接收结构化分析报告，查看识别/监测结果、风险提示、建议与报告链接 |\n\n### ⚙️ 脚本参数说明\n\n| 参数 | 含义 | 备注 |\n|---|---|---|\n| `--input` | 本地车载 DMS 驾驶员面部视频文件路径 | 适用于本地文件分析 |\n| `--url` | 网络车载 DMS 驾驶员面部视频 URL 地址（API 服务自动下载） | API 服务自动下载网络资源 |\n| `--pet-type` | 类别标识，驾驶员健康监测场景默认 `other` | 按需填写 |\n| `--list` | 显示驾驶员面部潮红/出汗异常历史分析报告列表清单（可以输入起始日期参数过滤数据范围） | 用于云端历史报告查询 |\n| `--api-url` | API 服务地址（可选，使用默认值） | 按需填写 |\n| `--detail` | 输出详细程度（basic/standard/json，默认 json） | 输出详细程度 |\n| `--output` | 结果输出文件路径（可选） | 可选 |\n\n## 🗂️ 资源索引 | Resource Index\n| 资源类型 | 路径 | 用途 | 何时读取 |\n|---|---|---|---|\n| 🐍 必要脚本 | [`scripts/smyx_driver_flushing_sweat_detection_analysis.py`](scripts/smyx_driver_flushing_sweat_detection_analysis.py) | 调用 API、执行分析或查询历史报告 | 执行分析或查询时使用 |\n| 🐍 必要脚本 | [`scripts/config.py`](scripts/config.py) | 调用 API、执行分析或查询历史报告 | 执行分析或查询时使用 |\n| 📘 领域参考 | [`references/api_doc.md`](references/api_doc.md) | 了解 API 接口规范、字段说明和错误码 | 仅在需要了解接口规范或错误码时读取 |\n\n## ⚠️ 注意事项 | Notes\n| 分类 | 注意事项 |\n|---|---|\n| 📚 文档读取 | 仅在需要时读取参考文档，保持上下文简洁 |\n| 📁 格式支持 | 输入要求：支持 mp4/avi/mov 视频，最大 10MB；**关键**：必须有彩色 RGB 通道，纯红外通道无法识别潮红 |\n| 🧑‍⚖️ 结果性质 | 检测结果仅作为驾驶员辅助健康提醒，本工具不替代体温计、血压计、血糖仪、心电图等医疗设备，更不替代医生诊断 |\n| 🔎 使用提醒 | 受光照、车窗有色膜、肤色个体差异影响较大，建议结合基线值与持续时间综合判定 |\n| 🔏 隐私合规 | 隐私合规：车载驾驶员视频涉及个人生物特征隐私，使用前需取得驾驶员/员工知情同意，车队部署应遵循当地隐私法规并妥善保管/加密相关录像 |\n| 🚫 脚本限制 | 禁止临时生成脚本，只能用技能本身的脚本 |\n| 🌐 网络地址 | 传入的网络地址参数，不需要下载本地，默认地址都是公网地址，api 服务会自动下载 |\n| 📜 报告输出 | 当显示历史分析报告清单的时候，从接口返回 json 数据中提取字段  作为超链接地址，且自动转化为如下 Markdown |\n| 📜 报告输出 | 表格输出示例 |\n\n## 🧰 使用示例 | Examples\n```bash\n# 分析本地车载 DMS 驾驶员视频\npython -m scripts.smyx_driver_flushing_sweat_detection_analysis --input /path/to/dms.mp4\n\n# 分析网络车载 DMS 驾驶员视频\npython -m scripts.smyx_driver_flushing_sweat_detection_analysis --url https://example.com/dms.mp4\n\n# 显示历史驾驶员潮红/出汗异常报告（自动触发关键词：查看驾驶员健康历史报告、潮红预警清单等）\npython -m scripts.smyx_driver_flushing_sweat_detection_analysis --list\n\n# 输出精简报告\npython -m scripts.smyx_driver_flushing_sweat_detection_analysis --input dms.mp4 --detail basic\n\n# 保存结果到文件\npython -m scripts.smyx_driver_flushing_sweat_detection_analysis --input dms.mp4 --output result.json\n```\n\nFile v1.0.5:_meta.json\n\n{\n  \"ownerId\": \"kn7cyxkr2ymf7zwsrybpedg8xx83ywrj\",\n  \"slug\": \"smyx-driver-flushing-sweat-detection-analysis\",\n  \"version\": \"1.0.5\",\n  \"publishedAt\": 1785526119476\n}\n\nFile v1.0.5:references/api_doc.md\n\n# API 接口文档\n\n此处用于存放驾驶员面部潮红/出汗异常检测 API 的接口文档，待后续补充。\n\n## 接口规范\n\n- 基础地址：由 smyx_common 配置统一管理\n- 认证方式：API Key 鉴权\n- 响应格式：JSON\n\n## 主要接口\n\n1. `/web/health-analysis/v2/start-health-analysis` - 启动驾驶员潮红/出汗异常检测任务\n2. `/web/health-analysis/v2/get-health-analysis-result` - 获取潮红/出汗分析结果\n3. `/web/health-analysis/page-health-analysis-result` - 分页查询历史异常事件\n4. `/health/order/api/getReportDetailExport?id={id}` - 导出完整报告\n\n## 场景代码\n\n- `SMYX_DRIVER_FLUSHING_SWEAT_DETECTION_ANALYSIS` - 驾驶员面部潮红/出汗异常检测\n\n## 输入约束\n\n- 摄像头：车载 DMS 摄像头，**优先使用彩色（RGB）通道**；纯红外通道无法识别潮红\n- 安装位置：方向盘上方 / A 柱 / 仪表台上方，正对驾驶员面部\n- 帧率：≥ 15 FPS；分辨率 ≥ 480p\n- 光照尽量稳定（白平衡固定），避免强逆光、车窗滤色片严重影响 RGB\n- 戴口罩会显著降低潮红面积识别可靠性\n\n## 关键观测特征\n\n- `flush_index` - 面部潮红指数（基于 RGB 红色分量比 / 肤色模型偏移，0-1）\n- `flush_area_ratio` - 潮红区域面积占面部 ROI 的比例\n- `sweat_glare_area_ratio` - 汗珠/皮肤反光面积占面部 ROI 的比例\n- `skin_texture_score` - 皮肤纹理粗糙度（受汗液/油脂反光影响）\n- `baseline_flush_index` - 当次会话起始基线潮红值（用于变化幅度判定）\n- `flush_index_delta` - 当前潮红指数相对基线的变化幅度\n\n## 默认阈值（可由调用方覆盖）\n\n- 潮红指数阈值：`flush_index > 0.6` 或 `flush_index_delta > 0.25`\n- 出汗反光面积阈值：`sweat_glare_area_ratio > 0.15`（约 15% 面部 ROI）\n- 持续时间阈值：异常状态持续超过 5 秒触发提醒\n\n## 预警类型\n\n- `facial_flushing` - 面部潮红显著升高（可能与血压升高 / 发热 / 情绪激动等相关）\n- `excessive_sweating` - 大量出汗（可能与热应激 / 低血糖 / 心脏不适等相关）\n- `combined_flush_sweat` - 潮红 + 出汗同时出现（更高优先级提醒）\n\n## 输出字段（参考）\n\n- `driver_detected` - 是否检测到驾驶员\n- `face_visible` - 面部是否可见（戴口罩/严重遮挡时为 false）\n- `flush_metrics` - 潮红相关指标（flush_index / flush_area_ratio / flush_index_delta）\n- `sweat_metrics` - 出汗相关指标（sweat_glare_area_ratio / skin_texture_score）\n- `warning_type` - 触发的预警类型\n- `warning_message` - 预警提示文本（如\"驾驶员面部潮红指数上升 0.32 且额头出汗反光面积 22%，请注意身体状态，建议就近停车休息\"）\n- `recommend_action` - 建议的座舱联动动作（voice_alert / fleet_upload / event_record）\n\n> 仅输出基于视觉的面部潮红/出汗异常现象提示，不提供血压、心脏病、中暑、低血糖等具体医学诊断；如有不适请及时就医并由专业人员评估。\n\nFile v1.0.5:skills/smyx_analysis/references/api_doc.md\n\n# API接口文档\n\n## 接口规范\n\n- 基础地址：由 smyx_common 配置统一管理\n- 认证方式：API Key 鉴权\n- 请求格式：支持文件上传\n- 响应格式：JSON\n\n## 错误码说明\n\n| 错误码 | 说明       |\n|-----|----------|\n| 400 | 请求参数错误   |\n| 401 | API密钥无效  |\n| 403 | 权限不足     |\n| 413 | 文件过大     |\n| 415 | 不支持的文件格式 |\n| 500 | 服务器内部错误  |\n\nFile v1.0.5:scripts/config.yaml\n\n{}\n\nFile v1.0.5:skills/smyx_analysis/scripts/config.yaml\n\n{}\n\nFile v1.0.5:skills/smyx_common/scripts/config-dev.yaml\n\nApiEnum:\n  base-url-open-api: \"http://192.168.1.234:9601/smyx-open-api\"\n  base-url-open-h5: \"http://192.168.1.234:4100\"\n  base-url-health: \"http://192.168.1.234:7070/jeecg-boot-xzgz\"\n\nConstantEnum:\n  is-debug: true\n\nFile v1.0.5:skills/smyx_common/scripts/config-test.yaml\n\nApiEnum:\n  base-url-open-api: \"https://livemonitortest.lifeemergence.com/smyx-open-api\"\n  base-url-open-h5: \"http://livemonitortest.lifeemergence.com\"\n  base-url-health: \"https://healthtest.lifeemergence.com/jeecg-boot-xzgz\"\n\nConstantEnum:\n  is-debug: true\n\nFile v1.0.5:skills/smyx_common/scripts/config.yaml\n\nApiEnum:\n  api-key: null\n  api-secret-key: null\n  base-url-health: https://lifeemergence.com/jeecg-boot-xzgz\n  base-url-open-api: https://open.lifeemergence.com/smyx-open-api\n  base-url-open-h5: http://livemonitor.lifeemergence.com\n  database-url: null\nConstantEnum:\n  app--id: x1a3s4nwy1s2r4se\n  current--tentant-code: XIAN_ZHAO_GAN_ZHI\n  default--skill-platform-name: ARK_CLAW\n  feishu-app--id: cli_a93d769369badcb1\n  feishu-app--secret: null\n  is-debug: false\nenv: prod\n\nFile v1.0.5:skill-card.md\n\n## Description: <br>\nAnalyzes in-cabin driver face video or image input to identify facial flushing and sweat or glare indicators, then returns visual health-risk reminders, recommendations, and report links. <br>\n\nThis skill is ready for commercial/non-commercial use. <br>\n\n## Publisher: <br>\n[smyx-sunjinhui](https://clawhub.ai/user/smyx-sunjinhui) <br>\n\n### License/Terms of Use: <br>\nMIT-0 <br>\n\n\n## Use Case: <br>\nFleet operators, vehicle safety teams, and developers use this skill to submit driver face video or image evidence to a cloud analysis service and receive visual-only alerts about facial flushing or abnormal sweating. It is intended as an assistive driver health reminder, not a medical diagnosis. <br>\n\n### Deployment Geography for Use: <br>\nGlobal <br>\n\n## Known Risks and Mitigations: <br>\nRisk: Driver face video or video URLs may be sent to configured Life Emergence cloud services and linked to a persistent local identity. <br>\nMitigation: Use only with explicit driver notice and consent, documented retention rules, restricted workspace access, and a process to revoke tokens and delete historical reports. <br>\nRisk: The skill automatically creates or reuses a local identity and can store backend tokens for cloud history access. <br>\nMitigation: Deploy in a governed environment, rotate or revoke tokens when access changes, and clear local identity and token storage when decommissioning the skill. <br>\nRisk: Visual flushing and sweating alerts may be mistaken for clinical conclusions. <br>\nMitigation: Present results only as visual health reminders, avoid medical diagnosis claims, and direct users to professional medical evaluation when symptoms or safety concerns exist. <br>\nRisk: Lighting, tinted glass, skin-tone variation, masks, and infrared-only camera feeds can reduce reliability. <br>\nMitigation: Use color RGB DMS input with stable lighting, maintain baseline and duration checks, and review alerts before operational or employment decisions. <br>\n\n\n## Reference(s): <br>\n- [Driver flushing and sweat detection API documentation](references/api_doc.md) <br>\n- [ClawHub skill page](https://clawhub.ai/smyx-sunjinhui/skills/smyx-driver-flushing-sweat-detection-analysis) <br>\n- [Skill demo](https://lifeemergence.com/sample.html) <br>\n\n\n## Skill Output: <br>\n**Output Type(s):** [text, markdown, shell commands, configuration, guidance] <br>\n**Output Format:** [Markdown report text with JSON-style structured analysis, recommendations, and report links] <br>\n**Output Parameters:** [1D] <br>\n**Other Properties Related to Output:** [May write the returned report text to a caller-specified output file; history queries return structured cloud report records.] <br>\n\n## Skill Version(s): <br>\n1.0.5 (source: server release metadata; artifact frontmatter reports 1.0.8) <br>\n\n## Ethical Considerations: <br>\nUsers should evaluate whether this skill is appropriate for their environment, review any generated or modified files before relying on them, and apply their organization's safety, security, and compliance requirements before deployment. <br>\n\nFile v1.0.5:skills/smyx_analysis/requirements.txt\n\npydash==8.0.6\nSQLAlchemy==2.0.46\nyaml==6.0.3\n\nFile v1.0.5:skills/smyx_common/requirements.txt\n\npydash==8.0.6\nSQLAlchemy==2.0.46\nPyYAML==6.0.3\n\nArchive v1.0.4: 31 files, 41593 bytes\n\nFiles: references/api_doc.md (3051b), scripts/__init__.py (61b), scripts/config.py (700b), scripts/config.yaml (3b), scripts/skill.py (589b), scripts/smyx_driver_flushing_sweat_detection_analysis.py (3642b), skill-card.md (2974b), SKILL.md (13263b), skills/smyx_analysis/__init__.py (0b), skills/smyx_analysis/references/api_doc.md (427b), skills/smyx_analysis/requirements.txt (45b), skills/smyx_analysis/scripts/__init__.py (0b), skills/smyx_analysis/scripts/api_service.py (1509b), skills/smyx_analysis/scripts/config.py (1003b), skills/smyx_analysis/scripts/config.yaml (3b), skills/smyx_analysis/scripts/skill.py (6529b), skills/smyx_analysis/scripts/smyx_analysis.py (3833b), skills/smyx_common/__init__.py (0b), skills/smyx_common/requirements.txt (47b), skills/smyx_common/scripts/__init__.py (177b), skills/smyx_common/scripts/api_service.py (2645b), skills/smyx_common/scripts/base.py (469b), skills/smyx_common/scripts/config-dev.yaml (214b), skills/smyx_common/scripts/config-prod.yaml (0b), skills/smyx_common/scripts/config-test.yaml (256b), skills/smyx_common/scripts/config.py (24363b), skills/smyx_common/scripts/config.yaml (473b), skills/smyx_common/scripts/dao.py (18266b), skills/smyx_common/scripts/skill.py (2473b), skills/smyx_common/scripts/util.py (28776b), _meta.json (164b)\n\nFile v1.0.4:SKILL.md\n\n---\nname: \"smyx-driver-flushing-sweat-detection-analysis\"\ndescription: \"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). | 通过车载DMS摄像头实时分析驾驶员面部视频，检测面部肤色变化（潮红指数，通过RGB色空间中的红色分量比例或肤色模型）以及汗珠/反光面积（通过图像纹理和反射特征）。当潮红指数显著升高（可能提示血压升高、发热或情绪激动）或出汗区域面积超过阈值（可能提示热应激、低血糖或心脏问题）时，输出健康风险提醒，建议驾驶员停车休息或就医。\"\nversion: \"1.0.6\"\nlicense: \"MIT-0\"\n---\n\n# 🥵 Driver Facial Flushing / Sweat Abnormality Detection | 驾驶员面部潮红/出汗异常检测\n> **智能分析中枢** · 图片/视频智能分析 · 结构化报告 · 历史报告云端查询\n\n---\n\n## 🧭 技能概览 | Overview\n\n| 模块 | 内容 |\n|---|---|\n| 🏷️ 技能名称 | **驾驶员面部潮红/出汗异常检测** |\n| 🎯 核心目标 | 通过车载DMS摄像头实时分析驾驶员面部视频，检测面部肤色变化（潮红指数，通过RGB色空间中的红色分量比例或肤色模型）以及汗珠/反光面积（通过图像纹理和反射特征）。当潮红指数显著升高（可能提示血压升高、发热或情绪激动）或出汗区域面积超过阈值（可能提示热应激、低血糖或心脏问题）时，输出健康风险提醒，建议驾驶员停车休息或就医。 |\n| 🖼️ 输入类型 | 图片、视频、本地文件、网络 URL |\n| 📝 输出能力 | 结构化分析报告、识别/监测结果、建议与报告链接 |\n| 🧩 场景码 | `SMYX_DRIVER_FLUSHING_SWEAT_DETECTION_ANALYSIS` |\n\nUsing 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.\n\n通过车载DMS摄像头实时分析驾驶员面部视频，检测面部肤色变化（潮红指数，通过RGB色空间中的红色分量比例或肤色模型）以及汗珠/反光面积（通过图像纹理和反射特征）。当潮红指数显著升高（可能提示血压升高、发热或情绪激动）或出汗区域面积超过阈值（可能提示热应激、低血糖或心脏问题）时，输出健康风险提醒，建议驾驶员停车休息或就医。该技能旨在辅助驾驶员关注自身健康，避免因突发疾病引发事故。应用场景：乘用车、商用车、网约车、货运车队。系统实时监测，当检测到面部潮红或大量出汗时，通过语音提示'请注意身体状态，建议休息'或推送至车队管理平台。技能特点：驾驶员突发疾病（如心梗、中暑、低血糖）往往会导致车辆失控，引发重大事故。通过AI实时监测面部潮红和出汗异常，可早期提醒驾驶员关注自身状态，采取休息或求助措施，降低事故风险。该技能可作为DMS系统的增值功能，提升车辆主动安全水平，尤其适合营运车辆和网约车平台。\n\n## 🤖 AI 角色 | AI Role\n| 角色要点 | 说明 |\n|---|---|\n| 说明 1 | **假设你是一个专业的驾驶员健康监测 AI。你的任务是分析驾驶员面部视频，检测面部潮红指数（肤色中红色分量的变化）和出汗区域（汗珠或皮肤反光面积）。当潮红指数超过阈值或出汗面积超过预设比例时，输出健康风险提醒。不要提供医疗诊断或具体临床判断，仅输出基于视觉的异常现象提示。** |\n\n## 🎬 技能演示 | Skill Demo\n\n[▶️ 点击查看技能使用介绍](https://lifeemergence.com/sample.html)\n\n---\n\n## 🎯 任务目标 | Goals\n### 1. 🧩 技能用途\n\n基于车载 DMS 摄像头驾驶员面部视频，实时检测面部潮红指数与出汗反光面积，按阈值输出健康风险提醒\n\n### 2. 🛠️ 能力范围\n\n| 序号 | 具体能力 |\n|---:|---|\n| 1 | 驾驶员面部检测 |\n| 2 | 面部 ROI 分区（额头/双颊/鼻翼） |\n| 3 | 潮红指数计算（RGB 红色分量比 / 肤色模型偏移） |\n| 4 | 潮红面积比 |\n| 5 | 汗珠/反光面积比 |\n| 6 | 皮肤纹理粗糙度 |\n| 7 | 基线值与变化幅度 |\n| 8 | 异常等级判定 |\n| 9 | 座舱联动动作建议（voice_alert / fleet_upload / event_record） |\n\n### 3. ⚡ 触发条件\n\n| 触发类型 | 触发规则 |\n|---|---|\n| ✅ 默认触发 | **默认触发**：当用户提供车载 DMS 驾驶员面部视频 URL 或文件需要分析时，默认触发本技能进行潮红/出汗异常检测 |\n| 🔎 明确分析意图 | 当用户明确提及驾驶员健康、面部潮红、出汗异常、突发疾病、心梗预警、中暑预警、低血糖、DMS 健康监测、营运车辆健康等关键词，并且上传了视频文件 |\n| 📚 历史报告查询 | 当用户提及以下关键词时，**自动触发历史报告查询功能** ：查看驾驶员健康历史报告、潮红预警清单、出汗异常报告清单、查询历史驾驶员健康事件、显示所有驾驶员健康报告、显示车队健康诊断报告，查询驾驶员健康事件清单 |\n\n### 4. 🤖 自动行为\n\n| 自动行为 | 执行要求 |\n|---|---|\n| 📎 附件处理 | 如果用户上传了附件或者视频/图片文件，则自动保存为本地文件 |\n| ☁️ 历史报告查询 | 如果用户触发历史报告查询关键词，必须直接调用云端 API 查询，不得从本地记忆或人工汇总中获取 |\n\n#### ⚠️ 强制数据获取规则（次高优先级）\n\n> **橙色强约束：** 历史报告清单只允许从云端接口读取，不允许从本地记录、长期记忆或人工汇总中提取。\n\n必须执行：\n\n```bash\npython -m scripts.smyx_driver_flushing_sweat_detection_analysis --list\n```\n\n| 类型 | 要求 |\n|---|---|\n| ✅ 必须 | 使用 `python -m scripts.smyx_driver_flushing_sweat_detection_analysis --list` 调用 API 查询云端的历史报告数据 |\n| 🚫 严格禁止 | 从本地 `memory` 目录读取历史会话信息 |\n| 🚫 严格禁止 | 手动汇总本地记录中的报告 |\n| 🚫 严格禁止 | 从长期记忆中提取报告 |\n| ✅ 输出格式 | 必须统一从云端接口获取最新完整数据，然后以 Markdown 表格格式输出结果 |\n\n## 📦 前置准备 | Requirements\n- 依赖说明:scripts 脚本所需的依赖包及版本\n  ```\n  requests>=2.28.0\n  ```\n\n## 🚀 操作步骤 | Workflow\n### 🔐 用户身份处理（内部自动完成）\n\n> **绿色安全原则：** 用户身份参数由系统内部自动处理，**不得向用户展示、询问或要求输入任何身份标识**。\n\n执行本技能分析或历史报告查询时，脚本会自动完成身份初始化：\n\n| 场景 | 系统行为 |\n|---|---|\n| 上游系统有内部身份参数 | 由脚本静默接收并使用 |\n| 上游系统未提供内部身份参数 | 脚本会自动复用本地缺省用户 |\n| 本地缺省用户不存在 | 脚本会自动创建并在后续任务中复用 |\n| 对用户输出 | 只展示分析进度、分析结果和报告链接，不展示内部身份值 |\n\n#### 🔒 关键约束\n\n| 禁止/要求 | 说明 |\n|---|---|\n| 🚫 不得询问身份 | 不得提示用户输入用户名、手机号或任何内部身份参数 |\n| 🚫 不得暴露身份值 | 不得在回复、报告、示例、错误提示中暴露内部身份值 |\n| 🚫 不得列为用户参数 | 不得把内部身份参数列为用户需要理解或传入的参数 |\n| ✅ 自动关联报告 | 历史报告查询同样由系统内部身份自动关联，用户只需表达“查看历史报告/报告清单”等意图 |\n\n---\n\n### 🧪 标准流程 | Standard Flow\n\n| 步骤 | 阶段 | 执行动作 |\n|---:|---|---|\n| 1 | 📥 准备车载 DMS 驾驶员面部视频输入 | 提供本地文件路径或网络 URL；确保输入内容清晰、符合技能场景要求 |\n| 2 | 🔐 系统自动完成身份关联 | 无需用户输入任何身份参数；不在回复中展示内部身份值 |\n| 3 | ⚙️ 执行驾驶员面部潮红/出汗异常检测 | 调用 `-m scripts.smyx_driver_flushing_sweat_detection_analysis` 处理输入（**必须在技能根目录下运行脚本**） |\n| 4 | 📊 查看分析结果 | 接收结构化分析报告，查看识别/监测结果、风险提示、建议与报告链接 |\n\n### ⚙️ 脚本参数说明\n\n| 参数 | 含义 | 备注 |\n|---|---|---|\n| `--input` | 本地车载 DMS 驾驶员面部视频文件路径 | 适用于本地文件分析 |\n| `--url` | 网络车载 DMS 驾驶员面部视频 URL 地址（API 服务自动下载） | API 服务自动下载网络资源 |\n| `--pet-type` | 类别标识，驾驶员健康监测场景默认 `other` | 按需填写 |\n| `--list` | 显示驾驶员面部潮红/出汗异常历史分析报告列表清单（可以输入起始日期参数过滤数据范围） | 用于云端历史报告查询 |\n| `--api-url` | API 服务地址（可选，使用默认值） | 按需填写 |\n| `--detail` | 输出详细程度（basic/standard/json，默认 json） | 输出详细程度 |\n| `--output` | 结果输出文件路径（可选） | 可选 |\n\n## 🗂️ 资源索引 | Resource Index\n| 资源类型 | 路径 | 用途 | 何时读取 |\n|---|---|---|---|\n| 🐍 必要脚本 | [`scripts/smyx_driver_flushing_sweat_detection_analysis.py`](scripts/smyx_driver_flushing_sweat_detection_analysis.py) | 调用 API、执行分析或查询历史报告 | 执行分析或查询时使用 |\n| 🐍 必要脚本 | [`scripts/config.py`](scripts/config.py) | 调用 API、执行分析或查询历史报告 | 执行分析或查询时使用 |\n| 📘 领域参考 | [`references/api_doc.md`](references/api_doc.md) | 了解 API 接口规范、字段说明和错误码 | 仅在需要了解接口规范或错误码时读取 |\n\n## ⚠️ 注意事项 | Notes\n| 分类 | 注意事项 |\n|---|---|\n| 📚 文档读取 | 仅在需要时读取参考文档，保持上下文简洁 |\n| 📁 格式支持 | 输入要求：支持 mp4/avi/mov 视频，最大 10MB；**关键**：必须有彩色 RGB 通道，纯红外通道无法识别潮红 |\n| 🧑‍⚖️ 结果性质 | 检测结果仅作为驾驶员辅助健康提醒，本工具不替代体温计、血压计、血糖仪、心电图等医疗设备，更不替代医生诊断 |\n| 🔎 使用提醒 | 受光照、车窗有色膜、肤色个体差异影响较大，建议结合基线值与持续时间综合判定 |\n| 🔏 隐私合规 | 隐私合规：车载驾驶员视频涉及个人生物特征隐私，使用前需取得驾驶员/员工知情同意，车队部署应遵循当地隐私法规并妥善保管/加密相关录像 |\n| 🚫 脚本限制 | 禁止临时生成脚本，只能用技能本身的脚本 |\n| 🌐 网络地址 | 传入的网络地址参数，不需要下载本地，默认地址都是公网地址，api 服务会自动下载 |\n| 📜 报告输出 | 当显示历史分析报告清单的时候，从接口返回 json 数据中提取字段  作为超链接地址，且自动转化为如下 Markdown |\n| 📜 报告输出 | 表格输出示例 |\n\n## 🧰 使用示例 | Examples\n```bash\n# 分析本地车载 DMS 驾驶员视频\npython -m scripts.smyx_driver_flushing_sweat_detection_analysis --input /path/to/dms.mp4\n\n# 分析网络车载 DMS 驾驶员视频\npython -m scripts.smyx_driver_flushing_sweat_detection_analysis --url https://example.com/dms.mp4\n\n# 显示历史驾驶员潮红/出汗异常报告（自动触发关键词：查看驾驶员健康历史报告、潮红预警清单等）\npython -m scripts.smyx_driver_flushing_sweat_detection_analysis --list\n\n# 输出精简报告\npython -m scripts.smyx_driver_flushing_sweat_detection_analysis --input dms.mp4 --detail basic\n\n# 保存结果到文件\npython -m scripts.smyx_driver_flushing_sweat_detection_analysis --input dms.mp4 --output result.json\n```\n\nFile v1.0.4:_meta.json\n\n{\n  \"ownerId\": \"kn7cyxkr2ymf7zwsrybpedg8xx83ywrj\",\n  \"slug\": \"smyx-driver-flushing-sweat-detection-analysis\",\n  \"version\": \"1.0.4\",\n  \"publishedAt\": 1784269350592\n}\n\nFile v1.0.4:references/api_doc.md\n\n# API 接口文档\n\n此处用于存放驾驶员面部潮红/出汗异常检测 API 的接口文档，待后续补充。\n\n## 接口规范\n\n- 基础地址：由 smyx_common 配置统一管理\n- 认证方式：API Key 鉴权\n- 响应格式：JSON\n\n## 主要接口\n\n1. `/web/health-analysis/v2/start-health-analysis` - 启动驾驶员潮红/出汗异常检测任务\n2. `/web/health-analysis/v2/get-health-analysis-result` - 获取潮红/出汗分析结果\n3. `/web/health-analysis/page-health-analysis-result` - 分页查询历史异常事件\n4. `/health/order/api/getReportDetailExport?id={id}` - 导出完整报告\n\n## 场景代码\n\n- `SMYX_DRIVER_FLUSHING_SWEAT_DETECTION_ANALYSIS` - 驾驶员面部潮红/出汗异常检测\n\n## 输入约束\n\n- 摄像头：车载 DMS 摄像头，**优先使用彩色（RGB）通道**；纯红外通道无法识别潮红\n- 安装位置：方向盘上方 / A 柱 / 仪表台上方，正对驾驶员面部\n- 帧率：≥ 15 FPS；分辨率 ≥ 480p\n- 光照尽量稳定（白平衡固定），避免强逆光、车窗滤色片严重影响 RGB\n- 戴口罩会显著降低潮红面积识别可靠性\n\n## 关键观测特征\n\n- `flush_index` - 面部潮红指数（基于 RGB 红色分量比 / 肤色模型偏移，0-1）\n- `flush_area_ratio` - 潮红区域面积占面部 ROI 的比例\n- `sweat_glare_area_ratio` - 汗珠/皮肤反光面积占面部 ROI 的比例\n- `skin_texture_score` - 皮肤纹理粗糙度（受汗液/油脂反光影响）\n- `baseline_flush_index` - 当次会话起始基线潮红值（用于变化幅度判定）\n- `flush_index_delta` - 当前潮红指数相对基线的变化幅度\n\n## 默认阈值（可由调用方覆盖）\n\n- 潮红指数阈值：`flush_index > 0.6` 或 `flush_index_delta > 0.25`\n- 出汗反光面积阈值：`sweat_glare_area_ratio > 0.15`（约 15% 面部 ROI）\n- 持续时间阈值：异常状态持续超过 5 秒触发提醒\n\n## 预警类型\n\n- `facial_flushing` - 面部潮红显著升高（可能与血压升高 / 发热 / 情绪激动等相关）\n- `excessive_sweating` - 大量出汗（可能与热应激 / 低血糖 / 心脏不适等相关）\n- `combined_flush_sweat` - 潮红 + 出汗同时出现（更高优先级提醒）\n\n## 输出字段（参考）\n\n- `driver_detected` - 是否检测到驾驶员\n- `face_visible` - 面部是否可见（戴口罩/严重遮挡时为 false）\n- `flush_metrics` - 潮红相关指标（flush_index / flush_area_ratio / flush_index_delta）\n- `sweat_metrics` - 出汗相关指标（sweat_glare_area_ratio / skin_texture_score）\n- `warning_type` - 触发的预警类型\n- `warning_message` - 预警提示文本（如\"驾驶员面部潮红指数上升 0.32 且额头出汗反光面积 22%，请注意身体状态，建议就近停车休息\"）\n- `recommend_action` - 建议的座舱联动动作（voice_alert / fleet_upload / event_record）\n\n> 仅输出基于视觉的面部潮红/出汗异常现象提示，不提供血压、心脏病、中暑、低血糖等具体医学诊断；如有不适请及时就医并由专业人员评估。\n\nFile v1.0.4:skills/smyx_analysis/references/api_doc.md\n\n# API接口文档\n\n## 接口规范\n\n- 基础地址：由 smyx_common 配置统一管理\n- 认证方式：API Key 鉴权\n- 请求格式：支持文件上传\n- 响应格式：JSON\n\n## 错误码说明\n\n| 错误码 | 说明       |\n|-----|----------|\n| 400 | 请求参数错误   |\n| 401 | API密钥无效  |\n| 403 | 权限不足     |\n| 413 | 文件过大     |\n| 415 | 不支持的文件格式 |\n| 500 | 服务器内部错误  |\n\nFile v1.0.4:scripts/config.yaml\n\n{}\n\nFile v1.0.4:skills/smyx_analysis/scripts/config.yaml\n\n{}\n\nFile v1.0.4:skills/smyx_common/scripts/config-dev.yaml\n\nApiEnum:\n  base-url-open-api: \"http://192.168.1.234:9601/smyx-open-api\"\n  base-url-open-h5: \"http://192.168.1.234:4100\"\n  base-url-health: \"http://192.168.1.234:7070/jeecg-boot-xzgz\"\n\nConstantEnum:\n  is-debug: true\n\nFile v1.0.4:skills/smyx_common/scripts/config-test.yaml\n\nApiEnum:\n  base-url-open-api: \"https://livemonitortest.lifeemergence.com/smyx-open-api\"\n  base-url-open-h5: \"http://livemonitortest.lifeemergence.com\"\n  base-url-health: \"https://healthtest.lifeemergence.com/jeecg-boot-xzgz\"\n\nConstantEnum:\n  is-debug: true\n\nFile v1.0.4:skills/smyx_common/scripts/config.yaml\n\nApiEnum:\n  api-key: null\n  api-secret-key: null\n  base-url-health: https://lifeemergence.com/jeecg-boot-xzgz\n  base-url-open-api: https://open.lifeemergence.com/smyx-open-api\n  base-url-open-h5: http://livemonitor.lifeemergence.com\n  database-url: null\nConstantEnum:\n  app--id: x1a3s4nwy1s2r4se\n  current--tentant-code: XIAN_ZHAO_GAN_ZHI\n  default--skill-platform-name: ARK_CLAW\n  feishu-app--id: cli_a93d769369badcb1\n  feishu-app--secret: null\n  is-debug: false\nenv: prod\n\nFile v1.0.4:skill-card.md\n\n## Description: <br>\nAnalyzes in-cabin DMS driver face video for facial flushing and sweat/reflection indicators, then returns visual health-risk reminders and suggested rest or escalation actions. <br>\n\nThis skill is ready for commercial/non-commercial use. <br>\n\n## Publisher: <br>\n[smyx-sunjinhui](https://clawhub.ai/user/smyx-sunjinhui) <br>\n\n### License/Terms of Use: <br>\nMIT-0 <br>\n\n\n## Use Case: <br>\nExternal users, fleet operators, and developers use this skill to analyze driver face video from DMS cameras for visual indicators of facial flushing or abnormal sweating. The output is an assistive health-risk reminder and structured report, not a medical diagnosis. <br>\n\n### Deployment Geography for Use: <br>\nGlobal <br>\n\n## Known Risks and Mitigations: <br>\nRisk: Driver face video or video URLs are sent to the configured lifeemergence.com cloud service for analysis. <br>\nMitigation: Use only with informed driver or employee consent, appropriate privacy controls, and policies for retention, access, and encryption of video and reports. <br>\nRisk: The skill can create or reuse a persistent local identity and stores service tokens for cloud requests. <br>\nMitigation: Run it in an isolated workspace, restrict access to local skill data, and review or remove stored identity and token data when deprovisioning. <br>\nRisk: The security scan verdict is suspicious because sensitive biometric-style analysis is linked to persistent identities and service tokens. <br>\nMitigation: Review the skill and cloud-service trust boundary before deployment, and install it only when the data-sharing model is acceptable. <br>\nRisk: Visual flushing and sweating indicators may be affected by lighting, tinted windows, skin-tone variation, occlusion, masks, or infrared-only video. <br>\nMitigation: Treat results as assistive visual alerts, combine them with baseline and duration checks, and avoid using the skill as a sole medical or safety decision system. <br>\n\n\n## Reference(s): <br>\n- [Driver Flushing/Sweat Detection API Documentation](references/api_doc.md) <br>\n- [Skill Demo](https://lifeemergence.com/sample.html) <br>\n- [ClawHub Skill Page](https://clawhub.ai/smyx-sunjinhui/skills/smyx-driver-flushing-sweat-detection-analysis) <br>\n\n\n## Skill Output: <br>\n**Output Type(s):** [Text, Markdown, JSON, Files] <br>\n**Output Format:** [Markdown-wrapped structured JSON with report links; optionally saved to a text output file] <br>\n**Output Parameters:** [1D] <br>\n**Other Properties Related to Output:** [May include cloud report export links and historical report lists.] <br>\n\n## Skill Version(s): <br>\n1.0.4 (source: server release metadata; artifact frontmatter says 1.0.6) <br>\n\n## Ethical Considerations: <br>\nUsers should evaluate whether this skill is appropriate for their environment, review any generated or modified files before relying on them, and apply their organization's safety, security, and compliance requirements before deployment. <br>\n\nFile v1.0.4:skills/smyx_analysis/requirements.txt\n\npydash==8.0.6\nSQLAlchemy==2.0.46\nyaml==6.0.3\n\nFile v1.0.4:skills/smyx_common/requirements.txt\n\npydash==8.0.6\nSQLAlchemy==2.0.46\nPyYAML==6.0.3\n\nArchive v1.0.3: 31 files, 41569 bytes\n\nFiles: references/api_doc.md (3051b), scripts/__init__.py (61b), scripts/config.py (700b), scripts/config.yaml (3b), scripts/skill.py (589b), scripts/smyx_driver_flushing_sweat_detection_analysis.py (3642b), skill-card.md (3193b), SKILL.md (13263b), skills/smyx_analysis/__init__.py (0b), skills/smyx_analysis/references/api_doc.md (427b), skills/smyx_analysis/requirements.txt (45b), skills/smyx_analysis/scripts/__init__.py (0b), skills/smyx_analysis/scripts/api_service.py (1509b), skills/smyx_analysis/scripts/config.py (1003b), skills/smyx_analysis/scripts/config.yaml (3b), skills/smyx_analysis/scripts/skill.py (6529b), skills/smyx_analysis/scripts/smyx_analysis.py (3833b), skills/smyx_common/__init__.py (0b), skills/smyx_common/requirements.txt (47b), skills/smyx_common/scripts/__init__.py (177b), skills/smyx_common/scripts/api_service.py (2645b), skills/smyx_common/scripts/base.py (469b), skills/smyx_common/scripts/config-dev.yaml (214b), skills/smyx_common/scripts/config-prod.yaml (0b), skills/smyx_common/scripts/config-test.yaml (256b), skills/smyx_common/scripts/config.py (24363b), skills/smyx_common/scripts/config.yaml (473b), skills/smyx_common/scripts/dao.py (18266b), skills/smyx_common/scripts/skill.py (2473b), skills/smyx_common/scripts/util.py (28605b), _meta.json (164b)\n\nFile v1.0.3:SKILL.md\n\n---\nname: \"smyx-driver-flushing-sweat-detection-analysis\"\ndescription: \"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). | 通过车载DMS摄像头实时分析驾驶员面部视频，检测面部肤色变化（潮红指数，通过RGB色空间中的红色分量比例或肤色模型）以及汗珠/反光面积（通过图像纹理和反射特征）。当潮红指数显著升高（可能提示血压升高、发热或情绪激动）或出汗区域面积超过阈值（可能提示热应激、低血糖或心脏问题）时，输出健康风险提醒，建议驾驶员停车休息或就医。\"\nversion: \"1.0.4\"\nlicense: \"MIT-0\"\n---\n\n# 🥵 Driver Facial Flushing / Sweat Abnormality Detection | 驾驶员面部潮红/出汗异常检测\n> **智能分析中枢** · 图片/视频智能分析 · 结构化报告 · 历史报告云端查询\n\n---\n\n## 🧭 技能概览 | Overview\n\n| 模块 | 内容 |\n|---|---|\n| 🏷️ 技能名称 | **驾驶员面部潮红/出汗异常检测** |\n| 🎯 核心目标 | 通过车载DMS摄像头实时分析驾驶员面部视频，检测面部肤色变化（潮红指数，通过RGB色空间中的红色分量比例或肤色模型）以及汗珠/反光面积（通过图像纹理和反射特征）。当潮红指数显著升高（可能提示血压升高、发热或情绪激动）或出汗区域面积超过阈值（可能提示热应激、低血糖或心脏问题）时，输出健康风险提醒，建议驾驶员停车休息或就医。 |\n| 🖼️ 输入类型 | 图片、视频、本地文件、网络 URL |\n| 📝 输出能力 | 结构化分析报告、识别/监测结果、建议与报告链接 |\n| 🧩 场景码 | `SMYX_DRIVER_FLUSHING_SWEAT_DETECTION_ANALYSIS` |\n\nUsing 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.\n\n通过车载DMS摄像头实时分析驾驶员面部视频，检测面部肤色变化（潮红指数，通过RGB色空间中的红色分量比例或肤色模型）以及汗珠/反光面积（通过图像纹理和反射特征）。当潮红指数显著升高（可能提示血压升高、发热或情绪激动）或出汗区域面积超过阈值（可能提示热应激、低血糖或心脏问题）时，输出健康风险提醒，建议驾驶员停车休息或就医。该技能旨在辅助驾驶员关注自身健康，避免因突发疾病引发事故。应用场景：乘用车、商用车、网约车、货运车队。系统实时监测，当检测到面部潮红或大量出汗时，通过语音提示'请注意身体状态，建议休息'或推送至车队管理平台。技能特点：驾驶员突发疾病（如心梗、中暑、低血糖）往往会导致车辆失控，引发重大事故。通过AI实时监测面部潮红和出汗异常，可早期提醒驾驶员关注自身状态，采取休息或求助措施，降低事故风险。该技能可作为DMS系统的增值功能，提升车辆主动安全水平，尤其适合营运车辆和网约车平台。\n\n## 🤖 AI 角色 | AI Role\n| 角色要点 | 说明 |\n|---|---|\n| 说明 1 | **假设你是一个专业的驾驶员健康监测 AI。你的任务是分析驾驶员面部视频，检测面部潮红指数（肤色中红色分量的变化）和出汗区域（汗珠或皮肤反光面积）。当潮红指数超过阈值或出汗面积超过预设比例时，输出健康风险提醒。不要提供医疗诊断或具体临床判断，仅输出基于视觉的异常现象提示。** |\n\n## 🎬 技能演示 | Skill Demo\n\n[▶️ 点击查看技能使用介绍](https://lifeemergence.com/sample.html)\n\n---\n\n## 🎯 任务目标 | Goals\n### 1. 🧩 技能用途\n\n基于车载 DMS 摄像头驾驶员面部视频，实时检测面部潮红指数与出汗反光面积，按阈值输出健康风险提醒\n\n### 2. 🛠️ 能力范围\n\n| 序号 | 具体能力 |\n|---:|---|\n| 1 | 驾驶员面部检测 |\n| 2 | 面部 ROI 分区（额头/双颊/鼻翼） |\n| 3 | 潮红指数计算（RGB 红色分量比 / 肤色模型偏移） |\n| 4 | 潮红面积比 |\n| 5 | 汗珠/反光面积比 |\n| 6 | 皮肤纹理粗糙度 |\n| 7 | 基线值与变化幅度 |\n| 8 | 异常等级判定 |\n| 9 | 座舱联动动作建议（voice_alert / fleet_upload / event_record） |\n\n### 3. ⚡ 触发条件\n\n| 触发类型 | 触发规则 |\n|---|---|\n| ✅ 默认触发 | **默认触发**：当用户提供车载 DMS 驾驶员面部视频 URL 或文件需要分析时，默认触发本技能进行潮红/出汗异常检测 |\n| 🔎 明确分析意图 | 当用户明确提及驾驶员健康、面部潮红、出汗异常、突发疾病、心梗预警、中暑预警、低血糖、DMS 健康监测、营运车辆健康等关键词，并且上传了视频文件 |\n| 📚 历史报告查询 | 当用户提及以下关键词时，**自动触发历史报告查询功能** ：查看驾驶员健康历史报告、潮红预警清单、出汗异常报告清单、查询历史驾驶员健康事件、显示所有驾驶员健康报告、显示车队健康诊断报告，查询驾驶员健康事件清单 |\n\n### 4. 🤖 自动行为\n\n| 自动行为 | 执行要求 |\n|---|---|\n| 📎 附件处理 | 如果用户上传了附件或者视频/图片文件，则自动保存为本地文件 |\n| ☁️ 历史报告查询 | 如果用户触发历史报告查询关键词，必须直接调用云端 API 查询，不得从本地记忆或人工汇总中获取 |\n\n#### ⚠️ 强制数据获取规则（次高优先级）\n\n> **橙色强约束：** 历史报告清单只允许从云端接口读取，不允许从本地记录、长期记忆或人工汇总中提取。\n\n必须执行：\n\n```bash\npython -m scripts.smyx_driver_flushing_sweat_detection_analysis --list\n```\n\n| 类型 | 要求 |\n|---|---|\n| ✅ 必须 | 使用 `python -m scripts.smyx_driver_flushing_sweat_detection_analysis --list` 调用 API 查询云端的历史报告数据 |\n| 🚫 严格禁止 | 从本地 `memory` 目录读取历史会话信息 |\n| 🚫 严格禁止 | 手动汇总本地记录中的报告 |\n| 🚫 严格禁止 | 从长期记忆中提取报告 |\n| ✅ 输出格式 | 必须统一从云端接口获取最新完整数据，然后以 Markdown 表格格式输出结果 |\n\n## 📦 前置准备 | Requirements\n- 依赖说明:scripts 脚本所需的依赖包及版本\n  ```\n  requests>=2.28.0\n  ```\n\n## 🚀 操作步骤 | Workflow\n### 🔐 用户身份处理（内部自动完成）\n\n> **绿色安全原则：** 用户身份参数由系统内部自动处理，**不得向用户展示、询问或要求输入任何身份标识**。\n\n执行本技能分析或历史报告查询时，脚本会自动完成身份初始化：\n\n| 场景 | 系统行为 |\n|---|---|\n| 上游系统有内部身份参数 | 由脚本静默接收并使用 |\n| 上游系统未提供内部身份参数 | 脚本会自动复用本地缺省用户 |\n| 本地缺省用户不存在 | 脚本会自动创建并在后续任务中复用 |\n| 对用户输出 | 只展示分析进度、分析结果和报告链接，不展示内部身份值 |\n\n#### 🔒 关键约束\n\n| 禁止/要求 | 说明 |\n|---|---|\n| 🚫 不得询问身份 | 不得提示用户输入用户名、手机号或任何内部身份参数 |\n| 🚫 不得暴露身份值 | 不得在回复、报告、示例、错误提示中暴露内部身份值 |\n| 🚫 不得列为用户参数 | 不得把内部身份参数列为用户需要理解或传入的参数 |\n| ✅ 自动关联报告 | 历史报告查询同样由系统内部身份自动关联，用户只需表达“查看历史报告/报告清单”等意图 |\n\n---\n\n### 🧪 标准流程 | Standard Flow\n\n| 步骤 | 阶段 | 执行动作 |\n|---:|---|---|\n| 1 | 📥 准备车载 DMS 驾驶员面部视频输入 | 提供本地文件路径或网络 URL；确保输入内容清晰、符合技能场景要求 |\n| 2 | 🔐 系统自动完成身份关联 | 无需用户输入任何身份参数；不在回复中展示内部身份值 |\n| 3 | ⚙️ 执行驾驶员面部潮红/出汗异常检测 | 调用 `-m scripts.smyx_driver_flushing_sweat_detection_analysis` 处理输入（**必须在技能根目录下运行脚本**） |\n| 4 | 📊 查看分析结果 | 接收结构化分析报告，查看识别/监测结果、风险提示、建议与报告链接 |\n\n### ⚙️ 脚本参数说明\n\n| 参数 | 含义 | 备注 |\n|---|---|---|\n| `--input` | 本地车载 DMS 驾驶员面部视频文件路径 | 适用于本地文件分析 |\n| `--url` | 网络车载 DMS 驾驶员面部视频 URL 地址（API 服务自动下载） | API 服务自动下载网络资源 |\n| `--pet-type` | 类别标识，驾驶员健康监测场景默认 `other` | 按需填写 |\n| `--list` | 显示驾驶员面部潮红/出汗异常历史分析报告列表清单（可以输入起始日期参数过滤数据范围） | 用于云端历史报告查询 |\n| `--api-url` | API 服务地址（可选，使用默认值） | 按需填写 |\n| `--detail` | 输出详细程度（basic/standard/json，默认 json） | 输出详细程度 |\n| `--output` | 结果输出文件路径（可选） | 可选 |\n\n## 🗂️ 资源索引 | Resource Index\n| 资源类型 | 路径 | 用途 | 何时读取 |\n|---|---|---|---|\n| 🐍 必要脚本 | [`scripts/smyx_driver_flushing_sweat_detection_analysis.py`](scripts/smyx_driver_flushing_sweat_detection_analysis.py) | 调用 API、执行分析或查询历史报告 | 执行分析或查询时使用 |\n| 🐍 必要脚本 | [`scripts/config.py`](scripts/config.py) | 调用 API、执行分析或查询历史报告 | 执行分析或查询时使用 |\n| 📘 领域参考 | [`references/api_doc.md`](references/api_doc.md) | 了解 API 接口规范、字段说明和错误码 | 仅在需要了解接口规范或错误码时读取 |\n\n## ⚠️ 注意事项 | Notes\n| 分类 | 注意事项 |\n|---|---|\n| 📚 文档读取 | 仅在需要时读取参考文档，保持上下文简洁 |\n| 📁 格式支持 | 输入要求：支持 mp4/avi/mov 视频，最大 10MB；**关键**：必须有彩色 RGB 通道，纯红外通道无法识别潮红 |\n| 🧑‍⚖️ 结果性质 | 检测结果仅作为驾驶员辅助健康提醒，本工具不替代体温计、血压计、血糖仪、心电图等医疗设备，更不替代医生诊断 |\n| 🔎 使用提醒 | 受光照、车窗有色膜、肤色个体差异影响较大，建议结合基线值与持续时间综合判定 |\n| 🔏 隐私合规 | 隐私合规：车载驾驶员视频涉及个人生物特征隐私，使用前需取得驾驶员/员工知情同意，车队部署应遵循当地隐私法规并妥善保管/加密相关录像 |\n| 🚫 脚本限制 | 禁止临时生成脚本，只能用技能本身的脚本 |\n| 🌐 网络地址 | 传入的网络地址参数，不需要下载本地，默认地址都是公网地址，api 服务会自动下载 |\n| 📜 报告输出 | 当显示历史分析报告清单的时候，从接口返回 json 数据中提取字段  作为超链接地址，且自动转化为如下 Markdown |\n| 📜 报告输出 | 表格输出示例 |\n\n## 🧰 使用示例 | Examples\n```bash\n# 分析本地车载 DMS 驾驶员视频\npython -m scripts.smyx_driver_flushing_sweat_detection_analysis --input /path/to/dms.mp4\n\n# 分析网络车载 DMS 驾驶员视频\npython -m scripts.smyx_driver_flushing_sweat_detection_analysis --url https://example.com/dms.mp4\n\n# 显示历史驾驶员潮红/出汗异常报告（自动触发关键词：查看驾驶员健康历史报告、潮红预警清单等）\npython -m scripts.smyx_driver_flushing_sweat_detection_analysis --list\n\n# 输出精简报告\npython -m scripts.smyx_driver_flushing_sweat_detection_analysis --input dms.mp4 --detail basic\n\n# 保存结果到文件\npython -m scripts.smyx_driver_flushing_sweat_detection_analysis --input dms.mp4 --output result.json\n```\n\nFile v1.0.3:_meta.json\n\n{\n  \"ownerId\": \"kn7cyxkr2ymf7zwsrybpedg8xx83ywrj\",\n  \"slug\": \"smyx-driver-flushing-sweat-detection-analysis\",\n  \"version\": \"1.0.3\",\n  \"publishedAt\": 1783551447061\n}\n\nFile v1.0.3:references/api_doc.md\n\n# API 接口文档\n\n此处用于存放驾驶员面部潮红/出汗异常检测 API 的接口文档，待后续补充。\n\n## 接口规范\n\n- 基础地址：由 smyx_common 配置统一管理\n- 认证方式：API Key 鉴权\n- 响应格式：JSON\n\n## 主要接口\n\n1. `/web/health-analysis/v2/start-health-analysis` - 启动驾驶员潮红/出汗异常检测任务\n2. `/web/health-analysis/v2/get-health-analysis-result` - 获取潮红/出汗分析结果\n3. `/web/health-analysis/page-health-analysis-result` - 分页查询历史异常事件\n4. `/health/order/api/getReportDetailExport?id={id}` - 导出完整报告\n\n## 场景代码\n\n- `SMYX_DRIVER_FLUSHING_SWEAT_DETECTION_ANALYSIS` - 驾驶员面部潮红/出汗异常检测\n\n## 输入约束\n\n- 摄像头：车载 DMS 摄像头，**优先使用彩色（RGB）通道**；纯红外通道无法识别潮红\n- 安装位置：方向盘上方 / A 柱 / 仪表台上方，正对驾驶员面部\n- 帧率：≥ 15 FPS；分辨率 ≥ 480p\n- 光照尽量稳定（白平衡固定），避免强逆光、车窗滤色片严重影响 RGB\n- 戴口罩会显著降低潮红面积识别可靠性\n\n## 关键观测特征\n\n- `flush_index` - 面部潮红指数（基于 RGB 红色分量比 / 肤色模型偏移，0-1）\n- `flush_area_ratio` - 潮红区域面积占面部 ROI 的比例\n- `sweat_glare_area_ratio` - 汗珠/皮肤反光面积占面部 ROI 的比例\n- `skin_texture_score` - 皮肤纹理粗糙度（受汗液/油脂反光影响）\n- `baseline_flush_index` - 当次会话起始基线潮红值（用于变化幅度判定）\n- `flush_index_delta` - 当前潮红指数相对基线的变化幅度\n\n## 默认阈值（可由调用方覆盖）\n\n- 潮红指数阈值：`flush_index > 0.6` 或 `flush_index_delta > 0.25`\n- 出汗反光面积阈值：`sweat_glare_area_ratio > 0.15`（约 15% 面部 ROI）\n- 持续时间阈值：异常状态持续超过 5 秒触发提醒\n\n## 预警类型\n\n- `facial_flushing` - 面部潮红显著升高（可能与血压升高 / 发热 / 情绪激动等相关）\n- `excessive_sweating` - 大量出汗（可能与热应激 / 低血糖 / 心脏不适等相关）\n- `combined_flush_sweat` - 潮红 + 出汗同时出现（更高优先级提醒）\n\n## 输出字段（参考）\n\n- `driver_detected` - 是否检测到驾驶员\n- `face_visible` - 面部是否可见（戴口罩/严重遮挡时为 false）\n- `flush_metrics` - 潮红相关指标（flush_index / flush_area_ratio / flush_index_delta）\n- `sweat_metrics` - 出汗相关指标（sweat_glare_area_ratio / skin_texture_score）\n- `warning_type` - 触发的预警类型\n- `warning_message` - 预警提示文本（如\"驾驶员面部潮红指数上升 0.32 且额头出汗反光面积 22%，请注意身体状态，建议就近停车休息\"）\n- `recommend_action` - 建议的座舱联动动作（voice_alert / fleet_upload / event_record）\n\n> 仅输出基于视觉的面部潮红/出汗异常现象提示，不提供血压、心脏病、中暑、低血糖等具体医学诊断；如有不适请及时就医并由专业人员评估。\n\nFile v1.0.3:skills/smyx_analysis/references/api_doc.md\n\n# API接口文档\n\n## 接口规范\n\n- 基础地址：由 smyx_common 配置统一管理\n- 认证方式：API Key 鉴权\n- 请求格式：支持文件上传\n- 响应格式：JSON\n\n## 错误码说明\n\n| 错误码 | 说明       |\n|-----|----------|\n| 400 | 请求参数错误   |\n| 401 | API密钥无效  |\n| 403 | 权限不足     |\n| 413 | 文件过大     |\n| 415 | 不支持的文件格式 |\n| 500 | 服务器内部错误  |\n\nFile v1.0.3:scripts/config.yaml\n\n{}\n\nFile v1.0.3:skills/smyx_analysis/scripts/config.yaml\n\n{}\n\nFile v1.0.3:skills/smyx_common/scripts/config-dev.yaml\n\nApiEnum:\n  base-url-open-api: \"http://192.168.1.234:9601/smyx-open-api\"\n  base-url-open-h5: \"http://192.168.1.234:4100\"\n  base-url-health: \"http://192.168.1.234:7070/jeecg-boot-xzgz\"\n\nConstantEnum:\n  is-debug: true\n\nFile v1.0.3:skills/smyx_common/scripts/config-test.yaml\n\nApiEnum:\n  base-url-open-api: \"https://livemonitortest.lifeemergence.com/smyx-open-api\"\n  base-url-open-h5: \"http://livemonitortest.lifeemergence.com\"\n  base-url-health: \"https://healthtest.lifeemergence.com/jeecg-boot-xzgz\"\n\nConstantEnum:\n  is-debug: true\n\nFile v1.0.3:skills/smyx_common/scripts/config.yaml\n\nApiEnum:\n  api-key: null\n  api-secret-key: null\n  base-url-health: https://lifeemergence.com/jeecg-boot-xzgz\n  base-url-open-api: https://open.lifeemergence.com/smyx-open-api\n  base-url-open-h5: http://livemonitor.lifeemergence.com\n  database-url: null\nConstantEnum:\n  app--id: x1a3s4nwy1s2r4se\n  current--tentant-code: XIAN_ZHAO_GAN_ZHI\n  default--skill-platform-name: ARK_CLAW\n  feishu-app--id: cli_a93d769369badcb1\n  feishu-app--secret: null\n  is-debug: false\nenv: prod\n\nFile v1.0.3:skill-card.md\n\n## Description: <br>\nUsing an in-cabin DMS camera, the skill analyzes driver facial video for skin color variation and sweat or reflective-area signals, then outputs visual abnormality reminders and structured report results without providing a medical diagnosis. <br>\n\nThis skill is ready for commercial/non-commercial use. <br>\n\n## Publisher: <br>\n[smyx-sunjinhui](https://clawhub.ai/user/smyx-sunjinhui) <br>\n\n### License/Terms of Use: <br>\nMIT-0 <br>\n\n\n## Use Case: <br>\nExternal developers, vehicle safety teams, and fleet operators use this skill to analyze DMS camera video or URLs for facial flushing and abnormal sweating indicators, receive structured health-risk reminders, and query cloud-hosted historical reports. Results are visual assistance signals and should be reviewed alongside driver consent, local privacy requirements, and appropriate medical evaluation when needed. <br>\n\n### Deployment Geography for Use: <br>\nGlobal <br>\n\n## Known Risks and Mitigations: <br>\nRisk: The skill sends driver facial video, video URLs, and health-adjacent analysis data to the Life Emergence cloud service. <br>\nMitigation: Use only with informed driver or employee consent, confirm the service is appropriate for the deployment, and follow applicable privacy and data-retention requirements. <br>\nRisk: The security summary notes that the skill may create local account records and reuse identity or token state for report-history access. <br>\nMitigation: Install and run it in an isolated workspace where possible, review local state before and after use, and avoid sharing the workspace with unrelated users or tasks. <br>\nRisk: The artifact describes visual health-risk reminders that may be affected by lighting, tinted windows, skin-tone variation, masks, and RGB camera quality. <br>\nMitigation: Treat outputs as assistive visual signals, not medical diagnosis, and validate important results with appropriate sensors, clinical evaluation, or operational review. <br>\n\n\n## Reference(s): <br>\n- [Driver Facial Flushing / Sweat Abnormality Detection API Documentation](references/api_doc.md) <br>\n- [Shared Analysis API Documentation](skills/smyx_analysis/references/api_doc.md) <br>\n- [Skill Demo](https://lifeemergence.com/sample.html) <br>\n- [ClawHub Skill Page](https://clawhub.ai/smyx-sunjinhui/skills/smyx-driver-flushing-sweat-detection-analysis) <br>\n\n\n## Skill Output: <br>\n**Output Type(s):** [Analysis, API Calls, Markdown, JSON, Files, Shell commands, Guidance] <br>\n**Output Format:** [Markdown or JSON structured report text, with optional saved output file and report links] <br>\n**Output Parameters:** [1D] <br>\n**Other Properties Related to Output:** [May return cloud analysis results, historical report lists, warning messages, recommended actions, and export-report links.] <br>\n\n## Skill Version(s): <br>\n1.0.3 (source: server release metadata; artifact frontmatter reports 1.0.4) <br>\n\n## Ethical Considerations: <br>\nUsers should evaluate whether this skill is appropriate for their environment, review any generated or modified files before relying on them, and apply their organization's safety, security, and compliance requirements before deployment. <br>\n\nFile v1.0.3:skills/smyx_analysis/requirements.txt\n\npydash==8.0.6\nSQLAlchemy==2.0.46\nyaml==6.0.3\n\nFile v1.0.3:skills/smyx_common/requirements.txt\n\npydash==8.0.6\nSQLAlchemy==2.0.46\nPyYAML==6.0.3","readmeExcerpt":"Skill: Driver Facial Flushing / Sweat Abnormality Detection | 驾驶员面部潮红/出汗异常检测 Owner: smyx-sunjinhui Summary: 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). | 通过车载DMS摄像头实时分析驾驶员面部视频，检测面部肤色变化（潮红指","codeSnippets":[],"executableExamples":[{"language":"bash","snippet":"python -m scripts.smyx_driver_flushing_sweat_detection_analysis --list"},{"language":"text","snippet":"requests>=2.28.0"},{"language":"bash","snippet":"# 分析本地车载 DMS 驾驶员视频\npython -m scripts.smyx_driver_flushing_sweat_detection_analysis --input /path/to/dms.mp4\n\n# 分析网络车载 DMS 驾驶员视频\npython -m scripts.smyx_driver_flushing_sweat_detection_analysis --url https://example.com/dms.mp4\n\n# 显示历史驾驶员潮红/出汗异常报告（自动触发关键词：查看驾驶员健康历史报告、潮红预警清单等）\npython -m scripts.smyx_driver_flushing_sweat_detection_analysis --list\n\n# 输出精简报告\npython -m scripts.smyx_driver_flushing_sweat_detection_analysis --input dms.mp4 --detail basic\n\n# 保存结果到文件\npython -m scripts.smyx_driver_flushing_sweat_detection_analysis --input dms.mp4 --output result.json"},{"language":"bash","snippet":"python -m scripts.smyx_driver_flushing_sweat_detection_analysis --list"},{"language":"text","snippet":"requests>=2.28.0"},{"language":"bash","snippet":"# 分析本地车载 DMS 驾驶员视频\npython -m scripts.smyx_driver_flushing_sweat_detection_analysis --input /path/to/dms.mp4\n\n# 分析网络车载 DMS 驾驶员视频\npython -m scripts.smyx_driver_flushing_sweat_detection_analysis --url https://example.com/dms.mp4\n\n# 显示历史驾驶员潮红/出汗异常报告（自动触发关键词：查看驾驶员健康历史报告、潮红预警清单等）\npython -m scripts.smyx_driver_flushing_sweat_detection_analysis --list\n\n# 输出精简报告\npython -m scripts.smyx_driver_flushing_sweat_detection_analysis --input dms.mp4 --detail basic\n\n# 保存结果到文件\npython -m scripts.smyx_driver_flushing_sweat_detection_analysis --input dms.mp4 --output result.json"}],"parameters":null,"dependencies":[],"permissions":[],"extractedFiles":[{"path":"SKILL.md","content":"---\nname: \"smyx-driver-flushing-sweat-detection-analysis\"\ndescription: \"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). | 通过车载DMS摄像头实时分析驾驶员面部视频，检测面部肤色变化（潮红指数，通过RGB色空间中的红色分量比例或肤色模型）以及汗珠/反光面积（通过图像纹理和反射特征）。当潮红指数显著升高（可能提示血压升高、发热或情绪激动）或出汗区域面积超过阈值（可能提示热应激、低血糖或心脏问题）时，输出健康风险提醒，建议驾驶员停车休息或就医。\"\nversion: \"1.0.16\"\nlicense: \"MIT-0\"\n---\n\n# 🥵 Driver Facial Flushing / Sweat Abnormality Detection | 驾驶员面部潮红/出汗异常检测\n> **智能分析中枢** · 图片/视频智能分析 · 结构化报告 · 历史报告云端查询\n\n---\n\n## 🧭 技能概览 | Overview\n\n| 模块 | 内容 |\n|---|---|\n| 🏷️ 技能名称 | **驾驶员面部潮红/出汗异常检测** |\n| 🎯 核心目标 | 通过车载DMS摄像头实时分析驾驶员面部视频，检测面部肤色变化（潮红指数，通过RGB色空间中的红色分量比例或肤色模型）以及汗珠/反光面积（通过图像纹理和反射特征）。当潮红指数显著升高（可能提示血压升高、发热或情绪激动）或出汗区域面积超过阈值（可能提示热应激、低血糖或心脏问题）时，输出健康风险提醒，建议驾驶员停车休息或就医。 |\n| 🖼️ 输入类型 | 图片、视频、本地文件、网络 URL |\n| 📝 输出能力 | 结构化分析报告、识别/监测结果、建议与报告链接 |\n| 🧩 场景码 | `SMYX_DRIVER_FLUSHING_SWEAT_DETECTION_ANALYSIS` |\n\nUsing 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.\n\n通过车载DMS摄像头实时分析驾驶员面部视频，检测面部肤色变化（潮红指数，通过RGB色空间中的红色分量比例或肤色模型）以及汗珠/反光面积（通过图像纹理和反射特征）。当潮红指数显著升高（可能提示血压升高、发热或情绪激动）或出汗区域面积超过阈值（可能提示热应激、低血糖或心脏问题）时，输出健康风险提醒，建议驾驶员停车休息或就医。该技能旨在辅助驾驶员关注自身健康，避免因突发疾病引发事故。应用场景：乘用车、商用车、网约车、货运车队。系统实时监测，当检测到面部潮红或大量出汗时，通过语音提示'请注意身体状态，建议休息'或推送至车队管理平台。技能特点：驾驶员突发疾病（如心梗、中暑、低血糖）往往会导致车辆失控，引发重大事故。通过AI实时监测面部潮红和出汗异常，可早期提醒驾驶员关注自身状态，采取休息或求助措施，降低事故风险。该技能可作为DMS系统的增值功能，提升车辆主动安全水平，尤其适合营运车辆和网约车平台。\n\n## 🤖 AI 角色 | AI Role\n| 角色要点 | 说明 |\n|---|---|\n| 说明 1 | **假设你是一个专业的驾驶员健康监测 AI。你的任务是分析驾驶员面部视频，检测面部潮红指数（肤色中红色分量的变化）和出汗区"},{"path":"_meta.json","content":"{\n  \"ownerId\": \"kn7cyxkr2ymf7zwsrybpedg8xx83ywrj\",\n  \"slug\": \"smyx-driver-flushing-sweat-detection-analysis\",\n  \"version\": \"1.0.12\",\n  \"publishedAt\": 1791036145246\n}"},{"path":"references/api_doc.md","content":"# API 接口文档\n\n此处用于存放驾驶员面部潮红/出汗异常检测 API 的接口文档，待后续补充。\n\n## 接口规范\n\n- 基础地址：由 smyx_common 配置统一管理\n- 认证方式：API Key 鉴权\n- 响应格式：JSON\n\n## 主要接口\n\n1. `/web/health-analysis/v2/start-health-analysis` - 启动驾驶员潮红/出汗异常检测任务\n2. `/web/health-analysis/v2/get-health-analysis-result` - 获取潮红/出汗分析结果\n3. `/web/health-analysis/page-health-analysis-result` - 分页查询历史异常事件\n4. `/health/order/api/getReportDetailExport?id={id}` - 导出完整报告\n\n## 场景代码\n\n- `SMYX_DRIVER_FLUSHING_SWEAT_DETECTION_ANALYSIS` - 驾驶员面部潮红/出汗异常检测\n\n## 输入约束\n\n- 摄像头：车载 DMS 摄像头，**优先使用彩色（RGB）通道**；纯红外通道无法识别潮红\n- 安装位置：方向盘上方 / A 柱 / 仪表台上方，正对驾驶员面部\n- 帧率：≥ 15 FPS；分辨率 ≥ 480p\n- 光照尽量稳定（白平衡固定），避免强逆光、车窗滤色片严重影响 RGB\n- 戴口罩会显著降低潮红面积识别可靠性\n\n## 关键观测特征\n\n- `flush_index` - 面部潮红指数（基于 RGB 红色分量比 / 肤色模型偏移，0-1）\n- `flush_area_ratio` - 潮红区域面积占面部 ROI 的比例\n- `sweat_glare_area_ratio` - 汗珠/皮肤反光面积占面部 ROI 的比例\n- `skin_texture_score` - 皮肤纹理粗糙度（受汗液/油脂反光影响）\n- `baseline_flush_index` - 当次会话起始基线潮红值（用于变化幅度判定）\n- `flush_index_delta` - 当前潮红指数相对基线的变化幅度\n\n## 默认阈值（可由调用方覆盖）\n\n- 潮红指数阈值：`flush_index > 0.6` 或 `flush_index_delta > 0.25`\n- 出汗反光面积阈值：`sweat_glare_area_ratio > 0.15`（约 15% 面部 ROI）\n- 持续时间阈值：异常状态持续超过 5 秒触发提醒\n\n## 预警类型\n\n- `facial_flushing` - 面部潮红显著升高（可能与血压升高 / 发热 / 情绪激动等相关）\n- `excessive_sweating` - 大量出汗（可能与热应激 / 低血糖 / 心脏不适等相关）\n- `combined_flush_sweat` - 潮红 + 出汗同时出现（更高优先级提醒）\n\n## 输出字段（参考）\n\n- `driver_detected` - 是否检测到驾驶员\n- `face_visible` - 面部是否可见（戴口罩/严重遮挡时为 false）\n- `flush_metrics` - 潮红相关指标（flush_index / flush_area_ratio / flush_index_delta）\n- `sweat_metrics` - 出汗相关指标（sweat_glare_area_ratio / skin_texture_score）\n- `warning_type` - 触发的预警类型\n- `warning_message` - 预警提示文本（如\"驾驶员面部潮红指数上升 0.32 且额头出汗反光面积 22%，请注意身体状态，建议就近停车休息\"）\n- `recommend_action` - 建议的座舱联动动作（voice_alert / fleet_upload / event_record）\n\n> 仅输出基于视觉的面部潮红/出汗异常现象提示，不提供血压、心脏病、中暑、低血糖等具体医学诊断；如有不适请及时就医并由专业人员评估。"},{"path":"skills/smyx_analysis/references/api_doc.md","content":"# API接口文档\n\n## 接口规范\n\n- 基础地址：由 smyx_common 配置统一管理\n- 认证方式：API Key 鉴权\n- 请求格式：支持文件上传\n- 响应格式：JSON\n\n## 错误码说明\n\n| 错误码 | 说明       |\n|-----|----------|\n| 400 | 请求参数错误   |\n| 401 | API密钥无效  |\n| 403 | 权限不足     |\n| 413 | 文件过大     |\n| 415 | 不支持的文件格式 |\n| 500 | 服务器内部错误  |"},{"path":"scripts/config.yaml","content":"{}"}],"languages":[],"docsSourceLabel":"CLAWHUB","editorialOverview":null,"editorialQuality":{"score":100,"threshold":65,"status":"thin","wordCount":1173,"uniquenessScore":44,"reasons":["uniqueness-below-45"]}},"media":{"evidence":{"source":"no-media","verified":false,"confidence":"low","updatedAt":"2026-10-09T18:09:40.120Z","emptyReason":"No screenshots, media assets, or demo links are available."},"primaryImageUrl":null,"mediaAssetCount":0,"assets":[],"demoUrl":null},"ownerResources":{"evidence":{"source":"unclaimed","verified":false,"confidence":"low","updatedAt":"2026-10-09T18:09:40.120Z","emptyReason":"This page has not been claimed by the agent owner."},"hasCustomPage":false,"customPageUpdatedAt":null,"customLinks":[],"structuredLinks":{"docsUrl":null,"demoUrl":null,"supportUrl":null,"pricingUrl":null,"statusUrl":null},"customPage":null},"relatedAgents":{"evidence":{"source":"protocol-neighbors","verified":false,"confidence":"medium","updatedAt":"2026-10-10T10:05:28.904Z","emptyReason":null},"items":[{"id":"8ebccd8e-3863-4187-8355-c3f14e1f9edf","entityType":"agent","canonicalPath":"/agent/iofficeai-aionui","slug":"iofficeai-aionui","name":"AionUi","description":"Free, local, open-source 24/7 Cowork app and OpenClaw for Gemini CLI, Claude Code, Codex, OpenCode, Qwen Code, Goose CLI, Auggie, and more | 🌟 Star if you like it!","url":"https://github.com/iOfficeAI/AionUi","homepage":"https://www.aionui.com","source":"GITHUB_REPOS","protocols":["MCP","OPENCLAW"],"capabilities":[],"safetyScore":100,"overallRank":70,"updatedAt":"2026-10-09T19:11:12.944Z","createdAt":"2026-02-25T03:38:16.584Z","downloads":null},{"id":"b917f68a-ebff-438e-84f8-3f4b2494c0bc","entityType":"agent","canonicalPath":"/agent/activepieces-activepieces","slug":"activepieces-activepieces","name":"activepieces","description":"AI Agents & MCPs & AI Workflow Automation • (~400 MCP servers for AI agents) • AI Automation / AI Agent with MCPs • AI Workflows & AI Agents • MCPs for AI Agents","url":"https://github.com/activepieces/activepieces","homepage":"https://www.activepieces.com","source":"GITHUB_REPOS","protocols":["OPENCLAW"],"capabilities":[],"safetyScore":100,"overallRank":70,"updatedAt":"2026-04-15T02:22:12.426Z","createdAt":"2026-02-25T03:38:12.412Z","downloads":null},{"id":"5cb26759-3a39-483f-94cf-276a98c13bb8","entityType":"agent","canonicalPath":"/agent/cherryhq-cherry-studio","slug":"cherryhq-cherry-studio","name":"cherry-studio","description":"AI productivity studio with smart chat, autonomous agents, and 300+ assistants. Unified access to frontier LLMs","url":"https://github.com/CherryHQ/cherry-studio","homepage":"https://cherry-ai.com","source":"GITHUB_REPOS","protocols":["MCP","OPENCLAW"],"capabilities":[],"safetyScore":100,"overallRank":70,"updatedAt":"2026-04-11T14:38:40.986Z","createdAt":"2026-02-25T03:38:19.379Z","downloads":null},{"id":"6f6582d0-5d76-4f0f-b81d-86520247950b","entityType":"agent","canonicalPath":"/agent/copilotkit-copilotkit","slug":"copilotkit-copilotkit","name":"CopilotKit","description":"The Frontend for Agents & Generative UI. React + Angular","url":"https://github.com/CopilotKit/CopilotKit","homepage":"https://docs.copilotkit.ai","source":"GITHUB_REPOS","protocols":["OPENCLAW"],"capabilities":[],"safetyScore":100,"overallRank":70,"updatedAt":"2026-03-25T09:50:57.846Z","createdAt":"2026-02-25T03:39:14.617Z","downloads":null}],"links":{"hub":"/agent","source":"/agent/source/clawhub","protocols":[{"label":"OpenClaw","href":"/agent/protocol/openclew"}]}}}