{"id":"a844acb7-b543-4480-8a3f-ef37921aa64a","entityType":"agent","slug":"clawhub-18072937735-smyx-public-place-group-emotion-index-analy","name":"Public Place Group Emotion Index (Exhibition / Mall) | 公共场所群体情绪指数（展览/商场）","canonicalUrl":"https://www.xpersona.co/agent/clawhub-18072937735-smyx-public-place-group-emotion-index-analy","canonicalPath":"/agent/clawhub-18072937735-smyx-public-place-group-emotion-index-analy","generatedAt":"2026-10-10T08:57:46.371Z","source":"CLAWHUB","claimStatus":"UNCLAIMED","verificationTier":"NONE","summary":{"evidence":{"source":"editorial-content","verified":true,"confidence":"high","updatedAt":"2026-10-10T01:33:08.012Z","emptyReason":null},"description":"Using fixed cameras in malls, exhibition halls, scenic areas and other public places, the system analyzes facial expressions of multiple people in the scene in real time (with anonymized expression recognition only), aggregates the distribution of emotions (happy, calm, irritated, surprised, sad, fearful, etc.), and computes an overall group-emotion index (0-100; higher = more positive). | 通过商场、展览馆、景区等公共场所的固定摄像头，实时分析场景中多人的面部表情（使用匿名化表情识别），统计各类情绪（愉悦、平静、烦躁、惊讶、悲伤等）的分布比例，计算整体情绪指数（0-100，数值越高代表群体情绪越积极）。该技能可帮助运营方了解顾客满意度、优化服务布局，或用于公共安全预警（如烦躁情绪比例过高可能预示冲突风险）。 Skill: Public Place Group Emotion Index (Exhibition / Mall) | 公共场所群体情绪指数（展览/商场） Owner: 18072937735 Summary: Using fixed cameras in malls, exhibition halls, scenic areas and other public places, the system analyzes facial expressions of multiple people in the scene in real time (with anonymized expression recognition only), aggregates the distribution of emotions (happy, calm, irritated, surprised, sad, fearful, etc.)","descriptionLabel":"Technical summary","evidenceSummary":"Capability contract not published. No trust telemetry is available yet. 1.8K downloads reported by the source. Last updated 10/10/2026.","installCommand":"clawhub skill install s17f8q65zg3y98t86jdg1177g583whq8:smyx-public-place-group-emotion-index-analysis","sourceUrl":"https://clawhub.ai/18072937735/smyx-public-place-group-emotion-index-analysis","homepage":"https://clawhub.ai/18072937735/skills/smyx-public-place-group-emotion-index-analysis","primaryLinks":[{"label":"View on ClawHub","url":"https://clawhub.ai/18072937735/smyx-public-place-group-emotion-index-analysis","kind":"source"},{"label":"Homepage","url":"https://clawhub.ai/18072937735/skills/smyx-public-place-group-emotion-index-analysis","kind":"homepage"}],"safetyScore":84,"overallRank":62,"popularityScore":65,"trustScore":null,"claimedByName":null,"isOwner":false,"seoDescription":"Using fixed cameras in malls, exhibition halls, scenic areas and other public places, the system analyzes facial expressions of multiple people in the scene in "},"coverage":{"evidence":{"source":"public-profile","verified":false,"confidence":"medium","updatedAt":"2026-10-10T01:33:08.012Z","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-10T01:33:08.012Z","emptyReason":null},"stars":null,"forks":null,"downloads":1804,"packageName":null,"latestVersion":"1.0.13","tractionLabel":"1.8K downloads"},"release":{"evidence":{"source":"CLAWHUB","verified":false,"confidence":"medium","updatedAt":"2026-10-10T01:33:08.012Z","emptyReason":null},"lastUpdatedAt":"2026-10-10T01:33:08.012Z","lastCrawledAt":"2026-10-10T01:33:08.012Z","lastIndexedAt":null,"nextCrawlAt":"2026-10-11T01:33:08.012Z","lastVerifiedAt":null,"highlights":[{"version":"1.0.13","createdAt":"2026-10-03T17:10:25.773Z","changelog":"- Updated version to 1.0.17. - SKILL.md: Revised metadata with new version number; minor documentation or formatting corrections. - Removed obsolete file: skill-card.md. - No changes to core skill workflow or features.","fileCount":31,"zipByteSize":42265},{"version":"1.0.12","createdAt":"2026-09-16T06:05:33.510Z","changelog":"- Updated SKILL.md: revised skill version to 1.0.14 and updated metadata. - Removed redundant file: skill-card.md no longer included. - No core functionality or logic changes; documentation and packaging update only.","fileCount":31,"zipByteSize":42486},{"version":"1.0.11","createdAt":"2026-08-26T20:00:34.701Z","changelog":"- Updated version to 1.0.11. - Removed the file `skill-card.md` from the project. - Made minor documentation and meta updates in `SKILL.md`.","fileCount":31,"zipByteSize":42405},{"version":"1.0.10","createdAt":"2026-08-19T02:32:29.142Z","changelog":"- Removed the skill-card.md file from the project. - No functional changes to the skill or code; documentation/component cleanup only.","fileCount":31,"zipByteSize":42535},{"version":"1.0.9","createdAt":"2026-08-16T05:59:27.799Z","changelog":"- Updated version to 1.0.10. - SKILL.md revised: version bump, minor wording, and formatting changes. - Removed redundant documentation file (skill-card.md). - No changes to functional logic or APIs.","fileCount":31,"zipByteSize":42617},{"version":"1.0.8","createdAt":"2026-08-02T19:29:29.792Z","changelog":"# smyx-public-place-group-emotion-index-analysis v1.0.8 Changelog - Updated version metadata in SKILL.md to 1.0.8. - Removed the redundant skill-card.md documentation file. - No changes to features, usage, workflow, or capabilities. - Documentation is now streamlined with reduced duplication.","fileCount":31,"zipByteSize":42699},{"version":"1.0.7","createdAt":"2026-07-30T19:33:29.398Z","changelog":"- Bumped version to 1.0.7. - Updated SKILL.md with current descriptions and details. - Removed the skill-card.md file. - No changes to feature set or technical workflow.","fileCount":31,"zipByteSize":42531},{"version":"1.0.6","createdAt":"2026-07-14T03:22:30.943Z","changelog":"**Version 1.0.6 Changelog** - Refactored user identity handling: now performed internally, removing prompts for usernames or phone numbers. - Updated documentation to reflect the fully automatic, non-interactive acquisition of user identity parameters. - Simplified the user workflow by eliminating any requirement for manual open-id input or feedback. - Enhanced the skill description and instructions for greater clarity and conciseness. - Removed obsolete files: `scripts/api_service.py` and `skill-card.md`. - Improved scripts for cleaner identity association and more robust report querying.","fileCount":31,"zipByteSize":42597}]},"execution":{"evidence":{"source":"CLAWHUB","verified":false,"confidence":"low","updatedAt":null,"emptyReason":"No published capability contract is available yet."},"installCommand":"clawhub skill install s17f8q65zg3y98t86jdg1177g583whq8:smyx-public-place-group-emotion-index-analysis","setupComplexity":"low","setupSteps":["Setup complexity is classified as HIGH. You must provision dedicated cloud infrastructure or an isolated VM. Do not run this directly on your local workstation.","Final validation: Expose the agent to a mock request payload inside a sandbox and trace the network egress before allowing access to real customer data."],"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-18072937735-smyx-public-place-group-emotion-index-analy/snapshot","contractUrl":"https://www.xpersona.co/api/v1/agents/clawhub-18072937735-smyx-public-place-group-emotion-index-analy/contract","trustUrl":"https://www.xpersona.co/api/v1/agents/clawhub-18072937735-smyx-public-place-group-emotion-index-analy/trust"},"curlExamples":["curl -s \"https://www.xpersona.co/api/v1/agents/clawhub-18072937735-smyx-public-place-group-emotion-index-analy/snapshot\"","curl -s \"https://www.xpersona.co/api/v1/agents/clawhub-18072937735-smyx-public-place-group-emotion-index-analy/contract\"","curl -s \"https://www.xpersona.co/api/v1/agents/clawhub-18072937735-smyx-public-place-group-emotion-index-analy/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-10T08:57:46.364Z"}},"retryPolicy":{"maxAttempts":3,"backoffMs":[500,1500,3500],"retryableConditions":["HTTP_429","HTTP_503","NETWORK_TIMEOUT"]}},"endpoints":{"dossierUrl":"https://www.xpersona.co/api/v1/agents/clawhub-18072937735-smyx-public-place-group-emotion-index-analy/dossier","snapshotUrl":"https://www.xpersona.co/api/v1/agents/clawhub-18072937735-smyx-public-place-group-emotion-index-analy/snapshot","contractUrl":"https://www.xpersona.co/api/v1/agents/clawhub-18072937735-smyx-public-place-group-emotion-index-analy/contract","trustUrl":"https://www.xpersona.co/api/v1/agents/clawhub-18072937735-smyx-public-place-group-emotion-index-analy/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":"high","updatedAt":"2026-10-10T01:33:08.012Z","emptyReason":null},"readme":"Skill: Public Place Group Emotion Index (Exhibition / Mall) | 公共场所群体情绪指数（展览/商场）\n\nOwner: 18072937735\n\nSummary: Using fixed cameras in malls, exhibition halls, scenic areas and other public places, the system analyzes facial expressions of multiple people in the scene in real time (with anonymized expression recognition only), aggregates the distribution of emotions (happy, calm, irritated, surprised, sad, fearful, etc.), and computes an overall group-emotion index (0-100; higher = more positive). | 通过商场、展览馆、景区等公共场所的固定摄像头，实时分析场景中多人的面部表情（使用匿名化表情识别），统计各类情绪（愉悦、平静、烦躁、惊讶、悲伤等）的分布比例，计算整体情绪指数（0-100，数值越高代表群体情绪越积极）。该技能可帮助运营方了解顾客满意度、优化服务布局，或用于公共安全预警（如烦躁情绪比例过高可能预示冲突风险）。\n\nTags: latest:1.0.13\n\nVersion history:\n\nv1.0.13 | 2026-10-03T17:10:25.773Z | auto\n\n- Updated version to 1.0.17.\n- SKILL.md: Revised metadata with new version number; minor documentation or formatting corrections.\n- Removed obsolete file: skill-card.md.\n- No changes to core skill workflow or features.\n\nv1.0.12 | 2026-09-16T06:05:33.510Z | auto\n\n- Updated SKILL.md: revised skill version to 1.0.14 and updated metadata.\n- Removed redundant file: skill-card.md no longer included.\n- No core functionality or logic changes; documentation and packaging update only.\n\nv1.0.11 | 2026-08-26T20:00:34.701Z | auto\n\n- Updated version to 1.0.11.\n- Removed the file `skill-card.md` from the project.\n- Made minor documentation and meta updates in `SKILL.md`.\n\nv1.0.10 | 2026-08-19T02:32:29.142Z | auto\n\n- Removed the skill-card.md file from the project.\n- No functional changes to the skill or code; documentation/component cleanup only.\n\nv1.0.9 | 2026-08-16T05:59:27.799Z | auto\n\n- Updated version to 1.0.10.\n- SKILL.md revised: version bump, minor wording, and formatting changes.\n- Removed redundant documentation file (skill-card.md).\n- No changes to functional logic or APIs.\n\nv1.0.8 | 2026-08-02T19:29:29.792Z | auto\n\n# smyx-public-place-group-emotion-index-analysis v1.0.8 Changelog\n\n- Updated version metadata in SKILL.md to 1.0.8.\n- Removed the redundant skill-card.md documentation file.\n- No changes to features, usage, workflow, or capabilities.  \n- Documentation is now streamlined with reduced duplication.\n\nv1.0.7 | 2026-07-30T19:33:29.398Z | auto\n\n- Bumped version to 1.0.7.\n- Updated SKILL.md with current descriptions and details.\n- Removed the skill-card.md file.\n- No changes to feature set or technical workflow.\n\nv1.0.6 | 2026-07-14T03:22:30.943Z | auto\n\n**Version 1.0.6 Changelog**\n\n- Refactored user identity handling: now performed internally, removing prompts for usernames or phone numbers.\n- Updated documentation to reflect the fully automatic, non-interactive acquisition of user identity parameters.\n- Simplified the user workflow by eliminating any requirement for manual open-id input or feedback.\n- Enhanced the skill description and instructions for greater clarity and conciseness.\n- Removed obsolete files: `scripts/api_service.py` and `skill-card.md`.\n- Improved scripts for cleaner identity association and more robust report querying.\n\nv1.0.5 | 2026-07-06T16:40:39.140Z | auto\n\n**Major update: Adds strict open-id acquisition, authentication, and data access control for all analysis actions.**\n\n- Enforces a 4-step open-id retrieval and validation process before running any group-emotion analysis or report query.\n- Requires open-id to be present from config files or explicit user input; analysis will not run until obtained.\n- Prohibits use of default/dummy open-id and disables local data fallback—cloud API access only for historical reports.\n- Updates scripts and config handling for strengthened authentication and reporting compliance.\n- Improves documentation for scenario readiness, user privacy, operation workflow, and error handling.\n\nv1.0.4 | 2026-07-06T16:22:27.698Z | auto\n\n- Version updated to 1.0.4.\n- Documentation updates in SKILL.md.\n- Obsolete file skill-card.md removed.\n- No changes to core logic or feature set.\n\nv1.0.3 | 2026-07-01T18:14:35.658Z | auto\n\n- Streamlined and clarified documentation, especially around user identity handling—now fully automatic and never shown or requested from users.\n- Enhanced instructions for history report querying: enforced cloud API usage only, with strict prohibition of local or manual data sources.\n- Simplified workflow; users only provide video/image input, with all authentication and report association done internally.\n- Improved resource indexing and parameter tables for easier reference.\n- Removed redundant or legacy files (e.g., scripts/api_service.py, skill-card.md).\n\nv1.0.2 | 2026-06-21T21:59:24.914Z | auto\n\n- Updated version to 1.0.2.\n- Documentation refined: SKILL.md updated with no changes to the skill’s features or usage.\n- Removed redundant file: skill-card.md.\n- No changes to skill logic, interface, or API; this is a documentation and cleanup update.\n\nv1.0.1 | 2026-06-17T21:18:23.947Z | auto\n\nVersion 1.0.1\n\n- Updated workflow and configuration file paths for open-id retrieval, prioritizing scripts/config.yaml in the skill directory.\n- Added license information to SKILL.md.\n- Clarified documentation to simplify and condense instructions, especially open-id acquisition and key constraints.\n- Enhanced and clarified the process for displaying historical report lists, including Markdown output format requirements.\n- Removed the redundant skill-card.md file.\n\nv1.0.0 | 2026-05-27T06:00:14.819Z | auto\n\nsmyx-public-place-group-emotion-index-analysis 1.0.0 – Initial Release\n\n- Introduces real-time, anonymized group emotion analysis for public places (malls, exhibitions, scenic spots) using fixed cameras.\n- Computes distribution of six emotions and generates a group-emotion index (0-100) to gauge overall crowd sentiment.\n- Provides actionable operations and safety suggestions based on emotion ratios, supporting better management decisions.\n- Strict privacy protection: no personal identification, storage, or tracking—fully anonymous aggregation only.\n- Integrates open-id validation before any analysis; enforces historical data retrieval rules from the cloud.\n- Designed for easy integration with existing security or business analytics systems.\n\nArchive index:\n\nArchive v1.0.13: 31 files, 42265 bytes\n\nFiles: references/api_doc.md (4507b), scripts/__init__.py (71b), scripts/config.py (710b), scripts/config.yaml (3b), scripts/skill.py (598b), scripts/smyx_public_place_group_emotion_index_analysis.py (3673b), skill-card.md (2163b), SKILL.md (14300b), 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 (166b)\n\nFile v1.0.13:SKILL.md\n\n---\nname: \"smyx-public-place-group-emotion-index-analysis\"\ndescription: \"Using fixed cameras in malls, exhibition halls, scenic areas and other public places, the system analyzes facial expressions of multiple people in the scene in real time (with anonymized expression recognition only), aggregates the distribution of emotions (happy, calm, irritated, surprised, sad, fearful, etc.), and computes an overall group-emotion index (0-100; higher = more positive). | 通过商场、展览馆、景区等公共场所的固定摄像头，实时分析场景中多人的面部表情（使用匿名化表情识别），统计各类情绪（愉悦、平静、烦躁、惊讶、悲伤等）的分布比例，计算整体情绪指数（0-100，数值越高代表群体情绪越积极）。该技能可帮助运营方了解顾客满意度、优化服务布局，或用于公共安全预警（如烦躁情绪比例过高可能预示冲突风险）。\"\nversion: \"1.0.17\"\nlicense: \"MIT-0\"\n---\n\n# 👥 Public Place Group Emotion Index (Exhibition / Mall) | 公共场所群体情绪指数（展览/商场）\n> **智能分析中枢** · 图片/视频智能分析 · 结构化报告 · 历史报告云端查询\n\n---\n\n## 🧭 技能概览 | Overview\n\n| 模块 | 内容 |\n|---|---|\n| 🏷️ 技能名称 | **公共场所群体情绪指数（展览/商场）** |\n| 🎯 核心目标 | 通过商场、展览馆、景区等公共场所的固定摄像头，实时分析场景中多人的面部表情（使用匿名化表情识别），统计各类情绪（愉悦、平静、烦躁、惊讶、悲伤等）的分布比例，计算整体情绪指数（0-100，数值越高代表群体情绪越积极）。该技能可帮助运营方了解顾客满意度、优化服务布局，或用于公共安全预警（如烦躁情绪比例过高可能预示冲突风险）。 |\n| 🖼️ 输入类型 | 图片、视频、本地文件、网络 URL |\n| 📝 输出能力 | 结构化分析报告、识别/监测结果、建议与报告链接 |\n| 🧩 场景码 | `SMYX_PUBLIC_PLACE_GROUP_EMOTION_INDEX_ANALYSIS` |\n\nUsing fixed cameras in malls, exhibition halls, scenic areas and other public places, the system analyzes facial expressions of multiple people in the scene in real time (with anonymized expression recognition only), aggregates the distribution of emotions (happy, calm, irritated, surprised, sad, fearful, etc.), and computes an overall group-emotion index (0-100; higher = more positive). This skill helps operators understand customer satisfaction, optimize service layout, or trigger public-safety warnings (e.g., a high irritation ratio may indicate conflict risk). Application scenarios: shopping malls, exhibition halls, museums, theme parks, airport waiting halls. The system periodically generates group-emotion reports to support management decisions. Skill features: understanding customer emotions enables malls to promptly adjust services (e.g., open more checkouts, improve air conditioning, optimize traffic flow) and boost satisfaction; for exhibitions, it assesses exhibit appeal; for public safety, it warns against group irritation that may escalate into conflict. AI anonymous analysis delivers valuable insights while protecting privacy and is an essential capability of smart malls and smart scenic areas. Can be integrated into existing security systems or business-analytics platforms.\n\n通过商场、展览馆、景区等公共场所的固定摄像头，实时分析场景中多人的面部表情（使用匿名化表情识别），统计各类情绪（愉悦、平静、烦躁、惊讶、悲伤等）的分布比例，计算整体情绪指数（0-100，数值越高代表群体情绪越积极）。该技能可帮助运营方了解顾客满意度、优化服务布局，或用于公共安全预警（如烦躁情绪比例过高可能预示冲突风险）。应用场景：购物中心、展览馆、博物馆、主题公园、机场候机厅。系统定期生成群体情绪报告，辅助管理决策。技能特点：了解顾客情绪能帮助商场及时调整服务（如增加收银台、改善空调、优化动线），提升满意度；对展览馆可评估展品吸引力；对公共安全可预警群体暴躁可能引发的冲突。通过AI匿名分析，在保护隐私的前提下获取有价值的数据洞察，是智慧商场、智慧景区的重要功能。该技能可集成到现有安防系统或商业分析平台中。\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基于商场/展览馆/景区/机场/博物馆/主题公园等公共场所固定摄像头视频，匿名统计 6 类情绪分布 + 群体情绪指数（0-100）+ 按区域输出指数 → 输出运营优化建议（收银/空调/动线/展品吸引力）与公共安全预警（烦躁占比过高可能预示冲突风险）\n\n### 2. 🛠️ 能力范围\n\n| 序号 | 具体能力 |\n|---:|---|\n| 1 | 匿名人脸表情检测（**不做身份识别/比对/跟踪**） |\n| 2 | 6 类情绪分类（happy / calm / irritated / surprised / sad / fearful） |\n| 3 | 积极/消极/烦躁比例计算 |\n| 4 | 人群密度估计 |\n| 5 | 平均停留时长估计 |\n| 6 | 区域 ROI 划分与区域级情绪指数（region_breakdown） |\n| 7 | 与上一时间窗对比 |\n| 8 | 4 档情绪等级判定（positive ≥ 70 / neutral 50-69 / low 30-49 / negative < 30 或烦躁 > 25%） |\n| 9 | 最小样本保护（face_detected_count < 5 输出 insufficient_sample） |\n| 10 | 运营优化与安全预警双通道建议 |\n| 11 | 区域级情绪指数热力图 |\n\n### 3. ⚡ 触发条件\n\n| 触发类型 | 触发规则 |\n|---|---|\n| ✅ 默认触发 | **默认触发**：当用户提供商场/展览馆/景区等公共场所固定摄像头视频 URL 或文件需要分析时，默认触发本技能进行公共场所群体情绪指数分析 |\n| 🔎 明确分析意图 | 当用户明确提及商场顾客情绪、展品吸引力、景区满意度、群体暴躁、安全预警、智慧商场、智慧景区、客流情绪洞察等关键词，并且上传了视频文件 |\n| 📚 历史报告查询 | 当用户提及以下关键词时，**自动触发历史报告查询功能** ：查看群体情绪历史报告、群体情绪指数报告清单、商场/展览/景区情绪报告清单、查询历史群体情绪记录、显示所有群体情绪分析报告、显示客流情绪洞察报告，查询群体情绪预警清单 |\n\n### 4. 🤖 自动行为\n\n| 自动行为 | 执行要求 |\n|---|---|\n| 📎 附件处理 | 如果用户上传了附件或者视频/图片文件，则自动保存为本地文件 |\n| ☁️ 历史报告查询 | 如果用户触发历史报告查询关键词，必须直接调用云端 API 查询，不得从本地记忆或人工汇总中获取 |\n\n#### ⚠️ 强制数据获取规则（次高优先级）\n\n> **橙色强约束：** 历史报告清单只允许从云端接口读取，不允许从本地记录、长期记忆或人工汇总中提取。\n\n必须执行：\n\n```bash\npython -m scripts.smyx_public_place_group_emotion_index_analysis --list\n```\n\n| 类型 | 要求 |\n|---|---|\n| ✅ 必须 | 使用 `python -m scripts.smyx_public_place_group_emotion_index_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 | 📥 准备公共场所固定摄像头视频输入 | 提供本地文件路径或网络 URL；确保输入内容清晰、符合技能场景要求 |\n| 2 | 🔐 系统自动完成身份关联 | 无需用户输入任何身份参数；不在回复中展示内部身份值 |\n| 3 | ⚙️ 执行公共场所群体情绪指数分析 | 调用 `-m scripts.smyx_public_place_group_emotion_index_analysis` 处理输入（**必须在技能根目录下运行脚本**） |\n| 4 | 📊 查看分析结果 | 接收结构化分析报告，查看识别/监测结果、风险提示、建议与报告链接 |\n\n### ⚙️ 脚本参数说明\n\n| 参数 | 含义 | 备注 |\n|---|---|---|\n| `--input` | 本地公共场所固定摄像头视频文件路径 | 适用于本地文件分析 |\n| `--url` | 网络公共场所固定摄像头视频 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_public_place_group_emotion_index_analysis.py`](scripts/smyx_public_place_group_emotion_index_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；**关键**：能拍到顾客正面或斜侧脸、覆盖目标区域 |\n| 🔎 使用提醒 | 戴口罩、戴墨镜、低头看手机、背对摄像头等情形会显著降低可识别人脸数，建议在指标中标注 `face_detected_count` 以便解读 |\n| 🔎 使用提醒 | 短时局部表情（如顾客接电话短暂皱眉）不应单独触发负面预警，建议使用时间窗均值 |\n| 🔎 使用提醒 | 最小样本保护：`face_detected_count < 5` 时输出 `insufficient_sample`，**禁止**发布群体指数 |\n| 🔎 使用提醒 | 红线约束：**禁止**人脸识别 / 人脸比对 / 身份绑定 / 跨摄像头跟踪；**禁止**长期存储顾客原始视频或人脸特征向量；**禁止**将群体情绪用于针对个体顾客的差异化定价或服务歧视 |\n| 🔎 使用提醒 | 合规要点：部署场所必须以**显著标识**告知公众使用了匿名情绪分析摄像头，并提供咨询联系方式；数据保存期限建议 ≤ 30 天，仅保留聚合指标 |\n| 🧑‍⚖️ 结果性质 | 安全预警仅作为人工值守的辅助参考，**禁止**单纯依据情绪指数自动触发警报或干预 |\n| 🚫 脚本限制 | 禁止临时生成脚本，只能用技能本身的脚本 |\n| 🌐 网络地址 | 传入的网络地址参数，不需要下载本地，默认地址都是公网地址，api 服务会自动下载 |\n| 📜 报告输出 | 当显示历史分析报告清单的时候，从接口返回 json 数据中提取字段  作为超链接地址，且自动转化为如下 Markdown |\n| 📜 报告输出 | 表格输出示例 |\n\n## 🧰 使用示例 | Examples\n```bash\n# 分析本地公共场所视频\npython -m scripts.smyx_public_place_group_emotion_index_analysis --input /path/to/mall.mp4\n\n# 分析网络公共场所视频\npython -m scripts.smyx_public_place_group_emotion_index_analysis --url https://example.com/mall.mp4\n\n# 显示历史公共场所群体情绪指数报告（自动触发关键词：查看群体情绪历史报告、群体情绪指数报告清单等）\npython -m scripts.smyx_public_place_group_emotion_index_analysis --list\n\n# 输出精简报告\npython -m scripts.smyx_public_place_group_emotion_index_analysis --input mall.mp4 --detail basic\n\n# 保存结果到文件\npython -m scripts.smyx_public_place_group_emotion_index_analysis --input mall.mp4 --output result.json\n```\n\nFile v1.0.13:_meta.json\n\n{\n  \"ownerId\": \"kn7e2caqj7pnsvr9r7t8zenghs83xw7n\",\n  \"slug\": \"smyx-public-place-group-emotion-index-analysis\",\n  \"version\": \"1.0.13\",\n  \"publishedAt\": 1791047425773\n}\n\nFile v1.0.13: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_PUBLIC_PLACE_GROUP_EMOTION_INDEX_ANALYSIS` - 公共场所群体情绪指数（展览/商场）\n\n## 输入约束\n\n- 摄像头：商场出入口 / 收银区 / 主动线 / 展厅 / 候机厅 / 售票处等公共场所高位固定摄像头，能拍到顾客**正面或斜侧脸**\n- 帧率 ≥ 5 FPS（推荐 10 FPS）；分辨率 ≥ 720p；光照稳定避免逆光\n- 视频时长建议 ≥ 10 分钟，覆盖完整客流时段，过短样本无法稳定计算群体指数\n- ROI 标定：可按区域划分多个子区域（如入口 / 收银 / 展品 A / 展品 B）以输出区域级情绪指数\n- 多视角部署时建议每个区域至少 1 路摄像头\n- **强匿名约束**：仅做匿名表情聚合统计，**禁止**人脸识别 / 人脸比对 / 身份绑定 / 跨摄像头跟踪\n\n## 关键观测信号\n\n- `face_detected_count` - 当前帧检测到的人脸数\n- `emotion_distribution` - 6 类情绪分布（happy / calm / irritated / surprised / sad / fearful 占比）\n- `positive_ratio` - 积极情绪占比（happy + calm）\n- `negative_ratio` - 消极情绪占比（irritated + sad + fearful）\n- `irritation_ratio` - 烦躁情绪占比（**安全预警关键指标**）\n- `group_emotion_index` - 群体情绪指数（0-100，数值越高代表群体情绪越积极）\n- `crowd_density_estimate` - 人群密度估计（参考指标，与烦躁占比联合判定）\n- `dwell_time_estimate_sec` - 平均停留时长估计（展品/区域吸引力参考）\n\n## 阈值与等级\n\n- `≥ 70` - 群体情绪积极（positive）\n- `50-69` - 群体情绪平稳（neutral）\n- `30-49` - 群体情绪低落（low）→ 建议优化服务\n- `< 30` 或 `irritation_ratio > 25%` - 群体情绪偏负面（negative）→ 推送运营优化或安全预警\n- 最小样本保护：`face_detected_count < 5` 时输出 `insufficient_sample`，不发布群体指数\n\n## 输出字段（参考）\n\n- `time_window` / `place_type`（mall / exhibition / scenic_area / airport / museum / theme_park / other）\n- `face_detected_count` / `crowd_density_estimate` / `dwell_time_estimate_sec`\n- `emotion_distribution` / `positive_ratio` / `negative_ratio` / `irritation_ratio`\n- `group_emotion_index` / `emotion_level` (positive / neutral / low / negative)\n- `region_breakdown` - 区域级情绪指数数组（[{region_name, group_emotion_index, irritation_ratio, ...}]）\n- `trend_vs_last_window` - 与上一时间窗变化（delta_pct）\n- `alert_type` - 提醒类型（operation_optimize / safety_warning / improving / normal）\n- `alert_level` - 提醒级别（info / notice / warning）\n- `operation_suggestion` - 运营建议（如\"收银区烦躁占比 32%、平均停留 4 分钟，建议增开 1 个收银台\"）\n- `safety_suggestion` - 安全建议（如\"入口区域烦躁占比 38% 且密度偏高，建议增派 1 名安保安抚分流\"）\n- `emotion_heatmap_image_url` - 情绪指数区域热力图 URL（伪彩色叠加在场景平面图）\n\n## 强制约束与红线\n\n- ❌ **禁止**进行人脸识别 / 人脸比对 / 顾客身份绑定 / 跨摄像头身份跟踪\n- ❌ **禁止**长期存储顾客原始视频或可识别人脸特征向量\n- ❌ **禁止**将群体情绪结果用于针对个体顾客的差异化定价或服务歧视\n- ✅ 仅输出**区域级匿名聚合**指标，作为运营优化与安全预警辅助参考\n- ✅ 部署场所必须以**显著标识**告知公众使用了匿名情绪分析摄像头，并提供咨询联系方式\n- ✅ 数据保存期限建议 ≤ 30 天，仅保留聚合指标，不保留原始视频\n\n> 仅输出基于视觉的群体情绪聚合统计与运营/安全辅助参考，**不构成对任何个体顾客的情绪诊断或行为评价**；任何针对个体的服务调整必须经过当事人本人主动反馈与同意。\n\nFile v1.0.13: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.13:scripts/config.yaml\n\n{}\n\nFile v1.0.13:skills/smyx_analysis/scripts/config.yaml\n\n{}\n\nFile v1.0.13: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.13: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.13: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.13:skill-card.md\n\n## Description:\n\nAnalyzes public-venue camera videos to summarize group facial-expression distributions and a group-emotion index, with operational suggestions and report links.\n\nThis skill is ready for commercial/non-commercial use.\n\n## Publisher:\n\n[18072937735](https://clawhub.ai/user/18072937735)\n\n### License/Terms of Use:\n\nMIT-0\n\n## Use Case:\n\nVenue operators and their developers use the skill to review aggregate emotion indicators from public-space videos and access historical reports for service planning and human-reviewed safety awareness.\n\n### Deployment Geography for Use:\n\nGlobal\n\n## Known Risks and Mitigations:\n\nRisk: Public-camera footage or video URLs are sent to an external service.\n\nMitigation: Use only authorized footage; provide appropriate venue notice and review consent, retention, and access controls before use.\n\nRisk: The skill can create or reuse a cloud-linked identity and store a local token, affecting access to reports.\n\nMitigation: Review report ownership and local token access; do not disclose internal identity values.\n\nRisk: Group-emotion scores can be over-interpreted as evidence about individuals or safety.\n\nMitigation: Require human review before interventions and avoid individual profiling or discriminatory use.\n\n## Reference(s):\n\n- [ClawHub skill listing](https://clawhub.ai/18072937735/skills/smyx-public-place-group-emotion-index-analysis)\n- [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, JSON]\n\n**Output Format:** [Structured analysis report or Markdown table of historical reports; JSON output is supported]\n\n**Output Parameters:** [1D]\n\n**Other Properties Related to Output:** [Includes aggregate emotion indicators, recommendations, and report links when available.]\n\n## Skill Version(s):\n\n1.0.13 (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.13:skills/smyx_analysis/requirements.txt\n\npydash==8.0.6\nSQLAlchemy==2.0.46\nyaml==6.0.3\n\nFile v1.0.13:skills/smyx_common/requirements.txt\n\npydash==8.0.6\nSQLAlchemy==2.0.46\nPyYAML==6.0.3\n\nArchive v1.0.12: 31 files, 42486 bytes\n\nFiles: references/api_doc.md (4507b), scripts/__init__.py (71b), scripts/config.py (710b), scripts/config.yaml (3b), scripts/skill.py (598b), scripts/smyx_public_place_group_emotion_index_analysis.py (3673b), skill-card.md (2799b), SKILL.md (14300b), 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 (166b)\n\nFile v1.0.12:SKILL.md\n\n---\nname: \"smyx-public-place-group-emotion-index-analysis\"\ndescription: \"Using fixed cameras in malls, exhibition halls, scenic areas and other public places, the system analyzes facial expressions of multiple people in the scene in real time (with anonymized expression recognition only), aggregates the distribution of emotions (happy, calm, irritated, surprised, sad, fearful, etc.), and computes an overall group-emotion index (0-100; higher = more positive). | 通过商场、展览馆、景区等公共场所的固定摄像头，实时分析场景中多人的面部表情（使用匿名化表情识别），统计各类情绪（愉悦、平静、烦躁、惊讶、悲伤等）的分布比例，计算整体情绪指数（0-100，数值越高代表群体情绪越积极）。该技能可帮助运营方了解顾客满意度、优化服务布局，或用于公共安全预警（如烦躁情绪比例过高可能预示冲突风险）。\"\nversion: \"1.0.14\"\nlicense: \"MIT-0\"\n---\n\n# 👥 Public Place Group Emotion Index (Exhibition / Mall) | 公共场所群体情绪指数（展览/商场）\n> **智能分析中枢** · 图片/视频智能分析 · 结构化报告 · 历史报告云端查询\n\n---\n\n## 🧭 技能概览 | Overview\n\n| 模块 | 内容 |\n|---|---|\n| 🏷️ 技能名称 | **公共场所群体情绪指数（展览/商场）** |\n| 🎯 核心目标 | 通过商场、展览馆、景区等公共场所的固定摄像头，实时分析场景中多人的面部表情（使用匿名化表情识别），统计各类情绪（愉悦、平静、烦躁、惊讶、悲伤等）的分布比例，计算整体情绪指数（0-100，数值越高代表群体情绪越积极）。该技能可帮助运营方了解顾客满意度、优化服务布局，或用于公共安全预警（如烦躁情绪比例过高可能预示冲突风险）。 |\n| 🖼️ 输入类型 | 图片、视频、本地文件、网络 URL |\n| 📝 输出能力 | 结构化分析报告、识别/监测结果、建议与报告链接 |\n| 🧩 场景码 | `SMYX_PUBLIC_PLACE_GROUP_EMOTION_INDEX_ANALYSIS` |\n\nUsing fixed cameras in malls, exhibition halls, scenic areas and other public places, the system analyzes facial expressions of multiple people in the scene in real time (with anonymized expression recognition only), aggregates the distribution of emotions (happy, calm, irritated, surprised, sad, fearful, etc.), and computes an overall group-emotion index (0-100; higher = more positive). This skill helps operators understand customer satisfaction, optimize service layout, or trigger public-safety warnings (e.g., a high irritation ratio may indicate conflict risk). Application scenarios: shopping malls, exhibition halls, museums, theme parks, airport waiting halls. The system periodically generates group-emotion reports to support management decisions. Skill features: understanding customer emotions enables malls to promptly adjust services (e.g., open more checkouts, improve air conditioning, optimize traffic flow) and boost satisfaction; for exhibitions, it assesses exhibit appeal; for public safety, it warns against group irritation that may escalate into conflict. AI anonymous analysis delivers valuable insights while protecting privacy and is an essential capability of smart malls and smart scenic areas. Can be integrated into existing security systems or business-analytics platforms.\n\n通过商场、展览馆、景区等公共场所的固定摄像头，实时分析场景中多人的面部表情（使用匿名化表情识别），统计各类情绪（愉悦、平静、烦躁、惊讶、悲伤等）的分布比例，计算整体情绪指数（0-100，数值越高代表群体情绪越积极）。该技能可帮助运营方了解顾客满意度、优化服务布局，或用于公共安全预警（如烦躁情绪比例过高可能预示冲突风险）。应用场景：购物中心、展览馆、博物馆、主题公园、机场候机厅。系统定期生成群体情绪报告，辅助管理决策。技能特点：了解顾客情绪能帮助商场及时调整服务（如增加收银台、改善空调、优化动线），提升满意度；对展览馆可评估展品吸引力；对公共安全可预警群体暴躁可能引发的冲突。通过AI匿名分析，在保护隐私的前提下获取有价值的数据洞察，是智慧商场、智慧景区的重要功能。该技能可集成到现有安防系统或商业分析平台中。\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基于商场/展览馆/景区/机场/博物馆/主题公园等公共场所固定摄像头视频，匿名统计 6 类情绪分布 + 群体情绪指数（0-100）+ 按区域输出指数 → 输出运营优化建议（收银/空调/动线/展品吸引力）与公共安全预警（烦躁占比过高可能预示冲突风险）\n\n### 2. 🛠️ 能力范围\n\n| 序号 | 具体能力 |\n|---:|---|\n| 1 | 匿名人脸表情检测（**不做身份识别/比对/跟踪**） |\n| 2 | 6 类情绪分类（happy / calm / irritated / surprised / sad / fearful） |\n| 3 | 积极/消极/烦躁比例计算 |\n| 4 | 人群密度估计 |\n| 5 | 平均停留时长估计 |\n| 6 | 区域 ROI 划分与区域级情绪指数（region_breakdown） |\n| 7 | 与上一时间窗对比 |\n| 8 | 4 档情绪等级判定（positive ≥ 70 / neutral 50-69 / low 30-49 / negative < 30 或烦躁 > 25%） |\n| 9 | 最小样本保护（face_detected_count < 5 输出 insufficient_sample） |\n| 10 | 运营优化与安全预警双通道建议 |\n| 11 | 区域级情绪指数热力图 |\n\n### 3. ⚡ 触发条件\n\n| 触发类型 | 触发规则 |\n|---|---|\n| ✅ 默认触发 | **默认触发**：当用户提供商场/展览馆/景区等公共场所固定摄像头视频 URL 或文件需要分析时，默认触发本技能进行公共场所群体情绪指数分析 |\n| 🔎 明确分析意图 | 当用户明确提及商场顾客情绪、展品吸引力、景区满意度、群体暴躁、安全预警、智慧商场、智慧景区、客流情绪洞察等关键词，并且上传了视频文件 |\n| 📚 历史报告查询 | 当用户提及以下关键词时，**自动触发历史报告查询功能** ：查看群体情绪历史报告、群体情绪指数报告清单、商场/展览/景区情绪报告清单、查询历史群体情绪记录、显示所有群体情绪分析报告、显示客流情绪洞察报告，查询群体情绪预警清单 |\n\n### 4. 🤖 自动行为\n\n| 自动行为 | 执行要求 |\n|---|---|\n| 📎 附件处理 | 如果用户上传了附件或者视频/图片文件，则自动保存为本地文件 |\n| ☁️ 历史报告查询 | 如果用户触发历史报告查询关键词，必须直接调用云端 API 查询，不得从本地记忆或人工汇总中获取 |\n\n#### ⚠️ 强制数据获取规则（次高优先级）\n\n> **橙色强约束：** 历史报告清单只允许从云端接口读取，不允许从本地记录、长期记忆或人工汇总中提取。\n\n必须执行：\n\n```bash\npython -m scripts.smyx_public_place_group_emotion_index_analysis --list\n```\n\n| 类型 | 要求 |\n|---|---|\n| ✅ 必须 | 使用 `python -m scripts.smyx_public_place_group_emotion_index_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 | 📥 准备公共场所固定摄像头视频输入 | 提供本地文件路径或网络 URL；确保输入内容清晰、符合技能场景要求 |\n| 2 | 🔐 系统自动完成身份关联 | 无需用户输入任何身份参数；不在回复中展示内部身份值 |\n| 3 | ⚙️ 执行公共场所群体情绪指数分析 | 调用 `-m scripts.smyx_public_place_group_emotion_index_analysis` 处理输入（**必须在技能根目录下运行脚本**） |\n| 4 | 📊 查看分析结果 | 接收结构化分析报告，查看识别/监测结果、风险提示、建议与报告链接 |\n\n### ⚙️ 脚本参数说明\n\n| 参数 | 含义 | 备注 |\n|---|---|---|\n| `--input` | 本地公共场所固定摄像头视频文件路径 | 适用于本地文件分析 |\n| `--url` | 网络公共场所固定摄像头视频 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_public_place_group_emotion_index_analysis.py`](scripts/smyx_public_place_group_emotion_index_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；**关键**：能拍到顾客正面或斜侧脸、覆盖目标区域 |\n| 🔎 使用提醒 | 戴口罩、戴墨镜、低头看手机、背对摄像头等情形会显著降低可识别人脸数，建议在指标中标注 `face_detected_count` 以便解读 |\n| 🔎 使用提醒 | 短时局部表情（如顾客接电话短暂皱眉）不应单独触发负面预警，建议使用时间窗均值 |\n| 🔎 使用提醒 | 最小样本保护：`face_detected_count < 5` 时输出 `insufficient_sample`，**禁止**发布群体指数 |\n| 🔎 使用提醒 | 红线约束：**禁止**人脸识别 / 人脸比对 / 身份绑定 / 跨摄像头跟踪；**禁止**长期存储顾客原始视频或人脸特征向量；**禁止**将群体情绪用于针对个体顾客的差异化定价或服务歧视 |\n| 🔎 使用提醒 | 合规要点：部署场所必须以**显著标识**告知公众使用了匿名情绪分析摄像头，并提供咨询联系方式；数据保存期限建议 ≤ 30 天，仅保留聚合指标 |\n| 🧑‍⚖️ 结果性质 | 安全预警仅作为人工值守的辅助参考，**禁止**单纯依据情绪指数自动触发警报或干预 |\n| 🚫 脚本限制 | 禁止临时生成脚本，只能用技能本身的脚本 |\n| 🌐 网络地址 | 传入的网络地址参数，不需要下载本地，默认地址都是公网地址，api 服务会自动下载 |\n| 📜 报告输出 | 当显示历史分析报告清单的时候，从接口返回 json 数据中提取字段  作为超链接地址，且自动转化为如下 Markdown |\n| 📜 报告输出 | 表格输出示例 |\n\n## 🧰 使用示例 | Examples\n```bash\n# 分析本地公共场所视频\npython -m scripts.smyx_public_place_group_emotion_index_analysis --input /path/to/mall.mp4\n\n# 分析网络公共场所视频\npython -m scripts.smyx_public_place_group_emotion_index_analysis --url https://example.com/mall.mp4\n\n# 显示历史公共场所群体情绪指数报告（自动触发关键词：查看群体情绪历史报告、群体情绪指数报告清单等）\npython -m scripts.smyx_public_place_group_emotion_index_analysis --list\n\n# 输出精简报告\npython -m scripts.smyx_public_place_group_emotion_index_analysis --input mall.mp4 --detail basic\n\n# 保存结果到文件\npython -m scripts.smyx_public_place_group_emotion_index_analysis --input mall.mp4 --output result.json\n```\n\nFile v1.0.12:_meta.json\n\n{\n  \"ownerId\": \"kn7e2caqj7pnsvr9r7t8zenghs83xw7n\",\n  \"slug\": \"smyx-public-place-group-emotion-index-analysis\",\n  \"version\": \"1.0.12\",\n  \"publishedAt\": 1789538733510\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_PUBLIC_PLACE_GROUP_EMOTION_INDEX_ANALYSIS` - 公共场所群体情绪指数（展览/商场）\n\n## 输入约束\n\n- 摄像头：商场出入口 / 收银区 / 主动线 / 展厅 / 候机厅 / 售票处等公共场所高位固定摄像头，能拍到顾客**正面或斜侧脸**\n- 帧率 ≥ 5 FPS（推荐 10 FPS）；分辨率 ≥ 720p；光照稳定避免逆光\n- 视频时长建议 ≥ 10 分钟，覆盖完整客流时段，过短样本无法稳定计算群体指数\n- ROI 标定：可按区域划分多个子区域（如入口 / 收银 / 展品 A / 展品 B）以输出区域级情绪指数\n- 多视角部署时建议每个区域至少 1 路摄像头\n- **强匿名约束**：仅做匿名表情聚合统计，**禁止**人脸识别 / 人脸比对 / 身份绑定 / 跨摄像头跟踪\n\n## 关键观测信号\n\n- `face_detected_count` - 当前帧检测到的人脸数\n- `emotion_distribution` - 6 类情绪分布（happy / calm / irritated / surprised / sad / fearful 占比）\n- `positive_ratio` - 积极情绪占比（happy + calm）\n- `negative_ratio` - 消极情绪占比（irritated + sad + fearful）\n- `irritation_ratio` - 烦躁情绪占比（**安全预警关键指标**）\n- `group_emotion_index` - 群体情绪指数（0-100，数值越高代表群体情绪越积极）\n- `crowd_density_estimate` - 人群密度估计（参考指标，与烦躁占比联合判定）\n- `dwell_time_estimate_sec` - 平均停留时长估计（展品/区域吸引力参考）\n\n## 阈值与等级\n\n- `≥ 70` - 群体情绪积极（positive）\n- `50-69` - 群体情绪平稳（neutral）\n- `30-49` - 群体情绪低落（low）→ 建议优化服务\n- `< 30` 或 `irritation_ratio > 25%` - 群体情绪偏负面（negative）→ 推送运营优化或安全预警\n- 最小样本保护：`face_detected_count < 5` 时输出 `insufficient_sample`，不发布群体指数\n\n## 输出字段（参考）\n\n- `time_window` / `place_type`（mall / exhibition / scenic_area / airport / museum / theme_park / other）\n- `face_detected_count` / `crowd_density_estimate` / `dwell_time_estimate_sec`\n- `emotion_distribution` / `positive_ratio` / `negative_ratio` / `irritation_ratio`\n- `group_emotion_index` / `emotion_level` (positive / neutral / low / negative)\n- `region_breakdown` - 区域级情绪指数数组（[{region_name, group_emotion_index, irritation_ratio, ...}]）\n- `trend_vs_last_window` - 与上一时间窗变化（delta_pct）\n- `alert_type` - 提醒类型（operation_optimize / safety_warning / improving / normal）\n- `alert_level` - 提醒级别（info / notice / warning）\n- `operation_suggestion` - 运营建议（如\"收银区烦躁占比 32%、平均停留 4 分钟，建议增开 1 个收银台\"）\n- `safety_suggestion` - 安全建议（如\"入口区域烦躁占比 38% 且密度偏高，建议增派 1 名安保安抚分流\"）\n- `emotion_heatmap_image_url` - 情绪指数区域热力图 URL（伪彩色叠加在场景平面图）\n\n## 强制约束与红线\n\n- ❌ **禁止**进行人脸识别 / 人脸比对 / 顾客身份绑定 / 跨摄像头身份跟踪\n- ❌ **禁止**长期存储顾客原始视频或可识别人脸特征向量\n- ❌ **禁止**将群体情绪结果用于针对个体顾客的差异化定价或服务歧视\n- ✅ 仅输出**区域级匿名聚合**指标，作为运营优化与安全预警辅助参考\n- ✅ 部署场所必须以**显著标识**告知公众使用了匿名情绪分析摄像头，并提供咨询联系方式\n- ✅ 数据保存期限建议 ≤ 30 天，仅保留聚合指标，不保留原始视频\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: dev\n\nFile v1.0.12:skill-card.md\n\n## Description:\n\nAnalyzes public-place camera images or video to produce anonymous group-level emotion distributions, a 0-100 group emotion index, regional breakdowns, and operational or safety suggestions.\n\nThis skill is ready for commercial/non-commercial use.\n\n## Publisher:\n\n[18072937735](https://clawhub.ai/user/18072937735)\n\n### License/Terms of Use:\n\nMIT-0\n\n## Use Case:\n\nVenue operators, safety teams, and developers use this skill to analyze authorized public-place footage for anonymous group-level emotion trends, customer-experience signals, and human-reviewed operational or safety recommendations.\n\n### Deployment Geography for Use:\n\nGlobal\n\n## Known Risks and Mitigations:\n\nRisk: Public-camera footage is processed through configured cloud APIs.\n\nMitigation: Use only authorized footage, confirm public notice and legal basis, and limit retained data to approved aggregate reports.\n\nRisk: The server security summary flags unsafe HTTP/debug defaults in configuration.\n\nMitigation: Review configuration before installation and replace test or HTTP endpoints with approved HTTPS production endpoints.\n\nRisk: The server security summary flags silent local identity creation, stored tokens, and local identity database use.\n\nMitigation: Review local storage and access controls, rotate or remove tokens according to policy, and avoid exposing identity values in reports.\n\nRisk: Group emotion outputs could be misused for individual decisions or automated interventions.\n\nMitigation: Use outputs only as anonymous group-level decision support with human review; do not use them for identity recognition, tracking, pricing, or individual treatment.\n\n## Reference(s):\n\n- [ClawHub skill page](https://clawhub.ai/18072937735/skills/smyx-public-place-group-emotion-index-analysis)\n- [Publisher profile](https://clawhub.ai/user/18072937735)\n- [API documentation](artifact/references/api_doc.md)\n- [Shared analysis API documentation](artifact/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 report text with optional saved output file and report links]\n\n**Output Parameters:** [1D]\n\n**Other Properties Related to Output:** [Outputs aggregate emotion metrics, region summaries, suggestions, and historical report listings from configured cloud APIs.]\n\n## Skill Version(s):\n\n1.0.12 (source: server release metadata; artifact frontmatter: 1.0.14)\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, 42405 bytes\n\nFiles: references/api_doc.md (4507b), scripts/__init__.py (71b), scripts/config.py (710b), scripts/config.yaml (3b), scripts/skill.py (598b), scripts/smyx_public_place_group_emotion_index_analysis.py (3673b), skill-card.md (2507b), SKILL.md (14300b), 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 (166b)\n\nFile v1.0.11:SKILL.md\n\n---\nname: \"smyx-public-place-group-emotion-index-analysis\"\ndescription: \"Using fixed cameras in malls, exhibition halls, scenic areas and other public places, the system analyzes facial expressions of multiple people in the scene in real time (with anonymized expression recognition only), aggregates the distribution of emotions (happy, calm, irritated, surprised, sad, fearful, etc.), and computes an overall group-emotion index (0-100; higher = more positive). | 通过商场、展览馆、景区等公共场所的固定摄像头，实时分析场景中多人的面部表情（使用匿名化表情识别），统计各类情绪（愉悦、平静、烦躁、惊讶、悲伤等）的分布比例，计算整体情绪指数（0-100，数值越高代表群体情绪越积极）。该技能可帮助运营方了解顾客满意度、优化服务布局，或用于公共安全预警（如烦躁情绪比例过高可能预示冲突风险）。\"\nversion: \"1.0.11\"\nlicense: \"MIT-0\"\n---\n\n# 👥 Public Place Group Emotion Index (Exhibition / Mall) | 公共场所群体情绪指数（展览/商场）\n> **智能分析中枢** · 图片/视频智能分析 · 结构化报告 · 历史报告云端查询\n\n---\n\n## 🧭 技能概览 | Overview\n\n| 模块 | 内容 |\n|---|---|\n| 🏷️ 技能名称 | **公共场所群体情绪指数（展览/商场）** |\n| 🎯 核心目标 | 通过商场、展览馆、景区等公共场所的固定摄像头，实时分析场景中多人的面部表情（使用匿名化表情识别），统计各类情绪（愉悦、平静、烦躁、惊讶、悲伤等）的分布比例，计算整体情绪指数（0-100，数值越高代表群体情绪越积极）。该技能可帮助运营方了解顾客满意度、优化服务布局，或用于公共安全预警（如烦躁情绪比例过高可能预示冲突风险）。 |\n| 🖼️ 输入类型 | 图片、视频、本地文件、网络 URL |\n| 📝 输出能力 | 结构化分析报告、识别/监测结果、建议与报告链接 |\n| 🧩 场景码 | `SMYX_PUBLIC_PLACE_GROUP_EMOTION_INDEX_ANALYSIS` |\n\nUsing fixed cameras in malls, exhibition halls, scenic areas and other public places, the system analyzes facial expressions of multiple people in the scene in real time (with anonymized expression recognition only), aggregates the distribution of emotions (happy, calm, irritated, surprised, sad, fearful, etc.), and computes an overall group-emotion index (0-100; higher = more positive). This skill helps operators understand customer satisfaction, optimize service layout, or trigger public-safety warnings (e.g., a high irritation ratio may indicate conflict risk). Application scenarios: shopping malls, exhibition halls, museums, theme parks, airport waiting halls. The system periodically generates group-emotion reports to support management decisions. Skill features: understanding customer emotions enables malls to promptly adjust services (e.g., open more checkouts, improve air conditioning, optimize traffic flow) and boost satisfaction; for exhibitions, it assesses exhibit appeal; for public safety, it warns against group irritation that may escalate into conflict. AI anonymous analysis delivers valuable insights while protecting privacy and is an essential capability of smart malls and smart scenic areas. Can be integrated into existing security systems or business-analytics platforms.\n\n通过商场、展览馆、景区等公共场所的固定摄像头，实时分析场景中多人的面部表情（使用匿名化表情识别），统计各类情绪（愉悦、平静、烦躁、惊讶、悲伤等）的分布比例，计算整体情绪指数（0-100，数值越高代表群体情绪越积极）。该技能可帮助运营方了解顾客满意度、优化服务布局，或用于公共安全预警（如烦躁情绪比例过高可能预示冲突风险）。应用场景：购物中心、展览馆、博物馆、主题公园、机场候机厅。系统定期生成群体情绪报告，辅助管理决策。技能特点：了解顾客情绪能帮助商场及时调整服务（如增加收银台、改善空调、优化动线），提升满意度；对展览馆可评估展品吸引力；对公共安全可预警群体暴躁可能引发的冲突。通过AI匿名分析，在保护隐私的前提下获取有价值的数据洞察，是智慧商场、智慧景区的重要功能。该技能可集成到现有安防系统或商业分析平台中。\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基于商场/展览馆/景区/机场/博物馆/主题公园等公共场所固定摄像头视频，匿名统计 6 类情绪分布 + 群体情绪指数（0-100）+ 按区域输出指数 → 输出运营优化建议（收银/空调/动线/展品吸引力）与公共安全预警（烦躁占比过高可能预示冲突风险）\n\n### 2. 🛠️ 能力范围\n\n| 序号 | 具体能力 |\n|---:|---|\n| 1 | 匿名人脸表情检测（**不做身份识别/比对/跟踪**） |\n| 2 | 6 类情绪分类（happy / calm / irritated / surprised / sad / fearful） |\n| 3 | 积极/消极/烦躁比例计算 |\n| 4 | 人群密度估计 |\n| 5 | 平均停留时长估计 |\n| 6 | 区域 ROI 划分与区域级情绪指数（region_breakdown） |\n| 7 | 与上一时间窗对比 |\n| 8 | 4 档情绪等级判定（positive ≥ 70 / neutral 50-69 / low 30-49 / negative < 30 或烦躁 > 25%） |\n| 9 | 最小样本保护（face_detected_count < 5 输出 insufficient_sample） |\n| 10 | 运营优化与安全预警双通道建议 |\n| 11 | 区域级情绪指数热力图 |\n\n### 3. ⚡ 触发条件\n\n| 触发类型 | 触发规则 |\n|---|---|\n| ✅ 默认触发 | **默认触发**：当用户提供商场/展览馆/景区等公共场所固定摄像头视频 URL 或文件需要分析时，默认触发本技能进行公共场所群体情绪指数分析 |\n| 🔎 明确分析意图 | 当用户明确提及商场顾客情绪、展品吸引力、景区满意度、群体暴躁、安全预警、智慧商场、智慧景区、客流情绪洞察等关键词，并且上传了视频文件 |\n| 📚 历史报告查询 | 当用户提及以下关键词时，**自动触发历史报告查询功能** ：查看群体情绪历史报告、群体情绪指数报告清单、商场/展览/景区情绪报告清单、查询历史群体情绪记录、显示所有群体情绪分析报告、显示客流情绪洞察报告，查询群体情绪预警清单 |\n\n### 4. 🤖 自动行为\n\n| 自动行为 | 执行要求 |\n|---|---|\n| 📎 附件处理 | 如果用户上传了附件或者视频/图片文件，则自动保存为本地文件 |\n| ☁️ 历史报告查询 | 如果用户触发历史报告查询关键词，必须直接调用云端 API 查询，不得从本地记忆或人工汇总中获取 |\n\n#### ⚠️ 强制数据获取规则（次高优先级）\n\n> **橙色强约束：** 历史报告清单只允许从云端接口读取，不允许从本地记录、长期记忆或人工汇总中提取。\n\n必须执行：\n\n```bash\npython -m scripts.smyx_public_place_group_emotion_index_analysis --list\n```\n\n| 类型 | 要求 |\n|---|---|\n| ✅ 必须 | 使用 `python -m scripts.smyx_public_place_group_emotion_index_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 | 📥 准备公共场所固定摄像头视频输入 | 提供本地文件路径或网络 URL；确保输入内容清晰、符合技能场景要求 |\n| 2 | 🔐 系统自动完成身份关联 | 无需用户输入任何身份参数；不在回复中展示内部身份值 |\n| 3 | ⚙️ 执行公共场所群体情绪指数分析 | 调用 `-m scripts.smyx_public_place_group_emotion_index_analysis` 处理输入（**必须在技能根目录下运行脚本**） |\n| 4 | 📊 查看分析结果 | 接收结构化分析报告，查看识别/监测结果、风险提示、建议与报告链接 |\n\n### ⚙️ 脚本参数说明\n\n| 参数 | 含义 | 备注 |\n|---|---|---|\n| `--input` | 本地公共场所固定摄像头视频文件路径 | 适用于本地文件分析 |\n| `--url` | 网络公共场所固定摄像头视频 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_public_place_group_emotion_index_analysis.py`](scripts/smyx_public_place_group_emotion_index_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；**关键**：能拍到顾客正面或斜侧脸、覆盖目标区域 |\n| 🔎 使用提醒 | 戴口罩、戴墨镜、低头看手机、背对摄像头等情形会显著降低可识别人脸数，建议在指标中标注 `face_detected_count` 以便解读 |\n| 🔎 使用提醒 | 短时局部表情（如顾客接电话短暂皱眉）不应单独触发负面预警，建议使用时间窗均值 |\n| 🔎 使用提醒 | 最小样本保护：`face_detected_count < 5` 时输出 `insufficient_sample`，**禁止**发布群体指数 |\n| 🔎 使用提醒 | 红线约束：**禁止**人脸识别 / 人脸比对 / 身份绑定 / 跨摄像头跟踪；**禁止**长期存储顾客原始视频或人脸特征向量；**禁止**将群体情绪用于针对个体顾客的差异化定价或服务歧视 |\n| 🔎 使用提醒 | 合规要点：部署场所必须以**显著标识**告知公众使用了匿名情绪分析摄像头，并提供咨询联系方式；数据保存期限建议 ≤ 30 天，仅保留聚合指标 |\n| 🧑‍⚖️ 结果性质 | 安全预警仅作为人工值守的辅助参考，**禁止**单纯依据情绪指数自动触发警报或干预 |\n| 🚫 脚本限制 | 禁止临时生成脚本，只能用技能本身的脚本 |\n| 🌐 网络地址 | 传入的网络地址参数，不需要下载本地，默认地址都是公网地址，api 服务会自动下载 |\n| 📜 报告输出 | 当显示历史分析报告清单的时候，从接口返回 json 数据中提取字段  作为超链接地址，且自动转化为如下 Markdown |\n| 📜 报告输出 | 表格输出示例 |\n\n## 🧰 使用示例 | Examples\n```bash\n# 分析本地公共场所视频\npython -m scripts.smyx_public_place_group_emotion_index_analysis --input /path/to/mall.mp4\n\n# 分析网络公共场所视频\npython -m scripts.smyx_public_place_group_emotion_index_analysis --url https://example.com/mall.mp4\n\n# 显示历史公共场所群体情绪指数报告（自动触发关键词：查看群体情绪历史报告、群体情绪指数报告清单等）\npython -m scripts.smyx_public_place_group_emotion_index_analysis --list\n\n# 输出精简报告\npython -m scripts.smyx_public_place_group_emotion_index_analysis --input mall.mp4 --detail basic\n\n# 保存结果到文件\npython -m scripts.smyx_public_place_group_emotion_index_analysis --input mall.mp4 --output result.json\n```\n\nFile v1.0.11:_meta.json\n\n{\n  \"ownerId\": \"kn7e2caqj7pnsvr9r7t8zenghs83xw7n\",\n  \"slug\": \"smyx-public-place-group-emotion-index-analysis\",\n  \"version\": \"1.0.11\",\n  \"publishedAt\": 1787774434701\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_PUBLIC_PLACE_GROUP_EMOTION_INDEX_ANALYSIS` - 公共场所群体情绪指数（展览/商场）\n\n## 输入约束\n\n- 摄像头：商场出入口 / 收银区 / 主动线 / 展厅 / 候机厅 / 售票处等公共场所高位固定摄像头，能拍到顾客**正面或斜侧脸**\n- 帧率 ≥ 5 FPS（推荐 10 FPS）；分辨率 ≥ 720p；光照稳定避免逆光\n- 视频时长建议 ≥ 10 分钟，覆盖完整客流时段，过短样本无法稳定计算群体指数\n- ROI 标定：可按区域划分多个子区域（如入口 / 收银 / 展品 A / 展品 B）以输出区域级情绪指数\n- 多视角部署时建议每个区域至少 1 路摄像头\n- **强匿名约束**：仅做匿名表情聚合统计，**禁止**人脸识别 / 人脸比对 / 身份绑定 / 跨摄像头跟踪\n\n## 关键观测信号\n\n- `face_detected_count` - 当前帧检测到的人脸数\n- `emotion_distribution` - 6 类情绪分布（happy / calm / irritated / surprised / sad / fearful 占比）\n- `positive_ratio` - 积极情绪占比（happy + calm）\n- `negative_ratio` - 消极情绪占比（irritated + sad + fearful）\n- `irritation_ratio` - 烦躁情绪占比（**安全预警关键指标**）\n- `group_emotion_index` - 群体情绪指数（0-100，数值越高代表群体情绪越积极）\n- `crowd_density_estimate` - 人群密度估计（参考指标，与烦躁占比联合判定）\n- `dwell_time_estimate_sec` - 平均停留时长估计（展品/区域吸引力参考）\n\n## 阈值与等级\n\n- `≥ 70` - 群体情绪积极（positive）\n- `50-69` - 群体情绪平稳（neutral）\n- `30-49` - 群体情绪低落（low）→ 建议优化服务\n- `< 30` 或 `irritation_ratio > 25%` - 群体情绪偏负面（negative）→ 推送运营优化或安全预警\n- 最小样本保护：`face_detected_count < 5` 时输出 `insufficient_sample`，不发布群体指数\n\n## 输出字段（参考）\n\n- `time_window` / `place_type`（mall / exhibition / scenic_area / airport / museum / theme_park / other）\n- `face_detected_count` / `crowd_density_estimate` / `dwell_time_estimate_sec`\n- `emotion_distribution` / `positive_ratio` / `negative_ratio` / `irritation_ratio`\n- `group_emotion_index` / `emotion_level` (positive / neutral / low / negative)\n- `region_breakdown` - 区域级情绪指数数组（[{region_name, group_emotion_index, irritation_ratio, ...}]）\n- `trend_vs_last_window` - 与上一时间窗变化（delta_pct）\n- `alert_type` - 提醒类型（operation_optimize / safety_warning / improving / normal）\n- `alert_level` - 提醒级别（info / notice / warning）\n- `operation_suggestion` - 运营建议（如\"收银区烦躁占比 32%、平均停留 4 分钟，建议增开 1 个收银台\"）\n- `safety_suggestion` - 安全建议（如\"入口区域烦躁占比 38% 且密度偏高，建议增派 1 名安保安抚分流\"）\n- `emotion_heatmap_image_url` - 情绪指数区域热力图 URL（伪彩色叠加在场景平面图）\n\n## 强制约束与红线\n\n- ❌ **禁止**进行人脸识别 / 人脸比对 / 顾客身份绑定 / 跨摄像头身份跟踪\n- ❌ **禁止**长期存储顾客原始视频或可识别人脸特征向量\n- ❌ **禁止**将群体情绪结果用于针对个体顾客的差异化定价或服务歧视\n- ✅ 仅输出**区域级匿名聚合**指标，作为运营优化与安全预警辅助参考\n- ✅ 部署场所必须以**显著标识**告知公众使用了匿名情绪分析摄像头，并提供咨询联系方式\n- ✅ 数据保存期限建议 ≤ 30 天，仅保留聚合指标，不保留原始视频\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: dev\n\nFile v1.0.11:skill-card.md\n\n## Description:\n\nUsing fixed cameras in malls, exhibition halls, scenic areas and other public places, the skill analyzes anonymous group facial-expression signals, summarizes emotion distribution, and computes a group emotion index for operational insight and safety awareness.\n\nThis skill is ready for commercial/non-commercial use.\n\n## Publisher:\n\n[18072937735](https://clawhub.ai/user/18072937735)\n\n### License/Terms of Use:\n\nMIT-0\n\n## Use Case:\n\nFacility operators, security teams, and analytics developers use this skill to process public-place camera video or image inputs and produce anonymous, aggregate emotion metrics, regional breakdowns, operational suggestions, safety guidance, and historical report listings.\n\n### Deployment Geography for Use:\n\nGlobal\n\n## Known Risks and Mitigations:\n\nRisk: Public-camera emotion analysis may be unlawful or inappropriate without notice, consent handling, and a valid operating basis.\n\nMitigation: Use only in approved locations with visible notice, documented governance, and human review of any operational or safety response.\n\nRisk: Media files or URLs are sent to a configured remote service for analysis.\n\nMitigation: Confirm the remote service, retention policy, access controls, and data-transfer approvals before deployment.\n\nRisk: The skill silently creates or reuses identity data and stores tokens in a sensitive workflow.\n\nMitigation: Remove or formally govern silent account creation, local persistence, and token storage before using it in anonymous-only deployments.\n\n## Reference(s):\n\n- [ClawHub skill page](https://clawhub.ai/18072937735/skills/smyx-public-place-group-emotion-index-analysis)\n- [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, guidance]\n\n**Output Format:** [Markdown and JSON-formatted text with analysis results, recommendations, and report links]\n\n**Output Parameters:** [1D]\n\n**Other Properties Related to Output:** [May include aggregate emotion distributions, group emotion index, regional breakdowns, alert levels, heatmap/report URLs, or historical report tables.]\n\n## Skill Version(s):\n\n1.0.11 (source: frontmatter and server release evidence)\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, 42535 bytes\n\nFiles: references/api_doc.md (4507b), scripts/__init__.py (71b), scripts/config.py (710b), scripts/config.yaml (3b), scripts/skill.py (598b), scripts/smyx_public_place_group_emotion_index_analysis.py (3673b), skill-card.md (2731b), SKILL.md (14300b), 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 (166b)\n\nFile v1.0.10:SKILL.md\n\n---\nname: \"smyx-public-place-group-emotion-index-analysis\"\ndescription: \"Using fixed cameras in malls, exhibition halls, scenic areas and other public places, the system analyzes facial expressions of multiple people in the scene in real time (with anonymized expression recognition only), aggregates the distribution of emotions (happy, calm, irritated, surprised, sad, fearful, etc.), and computes an overall group-emotion index (0-100; higher = more positive). | 通过商场、展览馆、景区等公共场所的固定摄像头，实时分析场景中多人的面部表情（使用匿名化表情识别），统计各类情绪（愉悦、平静、烦躁、惊讶、悲伤等）的分布比例，计算整体情绪指数（0-100，数值越高代表群体情绪越积极）。该技能可帮助运营方了解顾客满意度、优化服务布局，或用于公共安全预警（如烦躁情绪比例过高可能预示冲突风险）。\"\nversion: \"1.0.10\"\nlicense: \"MIT-0\"\n---\n\n# 👥 Public Place Group Emotion Index (Exhibition / Mall) | 公共场所群体情绪指数（展览/商场）\n> **智能分析中枢** · 图片/视频智能分析 · 结构化报告 · 历史报告云端查询\n\n---\n\n## 🧭 技能概览 | Overview\n\n| 模块 | 内容 |\n|---|---|\n| 🏷️ 技能名称 | **公共场所群体情绪指数（展览/商场）** |\n| 🎯 核心目标 | 通过商场、展览馆、景区等公共场所的固定摄像头，实时分析场景中多人的面部表情（使用匿名化表情识别），统计各类情绪（愉悦、平静、烦躁、惊讶、悲伤等）的分布比例，计算整体情绪指数（0-100，数值越高代表群体情绪越积极）。该技能可帮助运营方了解顾客满意度、优化服务布局，或用于公共安全预警（如烦躁情绪比例过高可能预示冲突风险）。 |\n| 🖼️ 输入类型 | 图片、视频、本地文件、网络 URL |\n| 📝 输出能力 | 结构化分析报告、识别/监测结果、建议与报告链接 |\n| 🧩 场景码 | `SMYX_PUBLIC_PLACE_GROUP_EMOTION_INDEX_ANALYSIS` |\n\nUsing fixed cameras in malls, exhibition halls, scenic areas and other public places, the system analyzes facial expressions of multiple people in the scene in real time (with anonymized expression recognition only), aggregates the distribution of emotions (happy, calm, irritated, surprised, sad, fearful, etc.), and computes an overall group-emotion index (0-100; higher = more positive). This skill helps operators understand customer satisfaction, optimize service layout, or trigger public-safety warnings (e.g., a high irritation ratio may indicate conflict risk). Application scenarios: shopping malls, exhibition halls, museums, theme parks, airport waiting halls. The system periodically generates group-emotion reports to support management decisions. Skill features: understanding customer emotions enables malls to promptly adjust services (e.g., open more checkouts, improve air conditioning, optimize traffic flow) and boost satisfaction; for exhibitions, it assesses exhibit appeal; for public safety, it warns against group irritation that may escalate into conflict. AI anonymous analysis delivers valuable insights while protecting privacy and is an essential capability of smart malls and smart scenic areas. Can be integrated into existing security systems or business-analytics platforms.\n\n通过商场、展览馆、景区等公共场所的固定摄像头，实时分析场景中多人的面部表情（使用匿名化表情识别），统计各类情绪（愉悦、平静、烦躁、惊讶、悲伤等）的分布比例，计算整体情绪指数（0-100，数值越高代表群体情绪越积极）。该技能可帮助运营方了解顾客满意度、优化服务布局，或用于公共安全预警（如烦躁情绪比例过高可能预示冲突风险）。应用场景：购物中心、展览馆、博物馆、主题公园、机场候机厅。系统定期生成群体情绪报告，辅助管理决策。技能特点：了解顾客情绪能帮助商场及时调整服务（如增加收银台、改善空调、优化动线），提升满意度；对展览馆可评估展品吸引力；对公共安全可预警群体暴躁可能引发的冲突。通过AI匿名分析，在保护隐私的前提下获取有价值的数据洞察，是智慧商场、智慧景区的重要功能。该技能可集成到现有安防系统或商业分析平台中。\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基于商场/展览馆/景区/机场/博物馆/主题公园等公共场所固定摄像头视频，匿名统计 6 类情绪分布 + 群体情绪指数（0-100）+ 按区域输出指数 → 输出运营优化建议（收银/空调/动线/展品吸引力）与公共安全预警（烦躁占比过高可能预示冲突风险）\n\n### 2. 🛠️ 能力范围\n\n| 序号 | 具体能力 |\n|---:|---|\n| 1 | 匿名人脸表情检测（**不做身份识别/比对/跟踪**） |\n| 2 | 6 类情绪分类（happy / calm / irritated / surprised / sad / fearful） |\n| 3 | 积极/消极/烦躁比例计算 |\n| 4 | 人群密度估计 |\n| 5 | 平均停留时长估计 |\n| 6 | 区域 ROI 划分与区域级情绪指数（region_breakdown） |\n| 7 | 与上一时间窗对比 |\n| 8 | 4 档情绪等级判定（positive ≥ 70 / neutral 50-69 / low 30-49 / negative < 30 或烦躁 > 25%） |\n| 9 | 最小样本保护（face_detected_count < 5 输出 insufficient_sample） |\n| 10 | 运营优化与安全预警双通道建议 |\n| 11 | 区域级情绪指数热力图 |\n\n### 3. ⚡ 触发条件\n\n| 触发类型 | 触发规则 |\n|---|---|\n| ✅ 默认触发 | **默认触发**：当用户提供商场/展览馆/景区等公共场所固定摄像头视频 URL 或文件需要分析时，默认触发本技能进行公共场所群体情绪指数分析 |\n| 🔎 明确分析意图 | 当用户明确提及商场顾客情绪、展品吸引力、景区满意度、群体暴躁、安全预警、智慧商场、智慧景区、客流情绪洞察等关键词，并且上传了视频文件 |\n| 📚 历史报告查询 | 当用户提及以下关键词时，**自动触发历史报告查询功能** ：查看群体情绪历史报告、群体情绪指数报告清单、商场/展览/景区情绪报告清单、查询历史群体情绪记录、显示所有群体情绪分析报告、显示客流情绪洞察报告，查询群体情绪预警清单 |\n\n### 4. 🤖 自动行为\n\n| 自动行为 | 执行要求 |\n|---|---|\n| 📎 附件处理 | 如果用户上传了附件或者视频/图片文件，则自动保存为本地文件 |\n| ☁️ 历史报告查询 | 如果用户触发历史报告查询关键词，必须直接调用云端 API 查询，不得从本地记忆或人工汇总中获取 |\n\n#### ⚠️ 强制数据获取规则（次高优先级）\n\n> **橙色强约束：** 历史报告清单只允许从云端接口读取，不允许从本地记录、长期记忆或人工汇总中提取。\n\n必须执行：\n\n```bash\npython -m scripts.smyx_public_place_group_emotion_index_analysis --list\n```\n\n| 类型 | 要求 |\n|---|---|\n| ✅ 必须 | 使用 `python -m scripts.smyx_public_place_group_emotion_index_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 | 📥 准备公共场所固定摄像头视频输入 | 提供本地文件路径或网络 URL；确保输入内容清晰、符合技能场景要求 |\n| 2 | 🔐 系统自动完成身份关联 | 无需用户输入任何身份参数；不在回复中展示内部身份值 |\n| 3 | ⚙️ 执行公共场所群体情绪指数分析 | 调用 `-m scripts.smyx_public_place_group_emotion_index_analysis` 处理输入（**必须在技能根目录下运行脚本**） |\n| 4 | 📊 查看分析结果 | 接收结构化分析报告，查看识别/监测结果、风险提示、建议与报告链接 |\n\n### ⚙️ 脚本参数说明\n\n| 参数 | 含义 | 备注 |\n|---|---|---|\n| `--input` | 本地公共场所固定摄像头视频文件路径 | 适用于本地文件分析 |\n| `--url` | 网络公共场所固定摄像头视频 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_public_place_group_emotion_index_analysis.py`](scripts/smyx_public_place_group_emotion_index_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；**关键**：能拍到顾客正面或斜侧脸、覆盖目标区域 |\n| 🔎 使用提醒 | 戴口罩、戴墨镜、低头看手机、背对摄像头等情形会显著降低可识别人脸数，建议在指标中标注 `face_detected_count` 以便解读 |\n| 🔎 使用提醒 | 短时局部表情（如顾客接电话短暂皱眉）不应单独触发负面预警，建议使用时间窗均值 |\n| 🔎 使用提醒 | 最小样本保护：`face_detected_count < 5` 时输出 `insufficient_sample`，**禁止**发布群体指数 |\n| 🔎 使用提醒 | 红线约束：**禁止**人脸识别 / 人脸比对 / 身份绑定 / 跨摄像头跟踪；**禁止**长期存储顾客原始视频或人脸特征向量；**禁止**将群体情绪用于针对个体顾客的差异化定价或服务歧视 |\n| 🔎 使用提醒 | 合规要点：部署场所必须以**显著标识**告知公众使用了匿名情绪分析摄像头，并提供咨询联系方式；数据保存期限建议 ≤ 30 天，仅保留聚合指标 |\n| 🧑‍⚖️ 结果性质 | 安全预警仅作为人工值守的辅助参考，**禁止**单纯依据情绪指数自动触发警报或干预 |\n| 🚫 脚本限制 | 禁止临时生成脚本，只能用技能本身的脚本 |\n| 🌐 网络地址 | 传入的网络地址参数，不需要下载本地，默认地址都是公网地址，api 服务会自动下载 |\n| 📜 报告输出 | 当显示历史分析报告清单的时候，从接口返回 json 数据中提取字段  作为超链接地址，且自动转化为如下 Markdown |\n| 📜 报告输出 | 表格输出示例 |\n\n## 🧰 使用示例 | Examples\n```bash\n# 分析本地公共场所视频\npython -m scripts.smyx_public_place_group_emotion_index_analysis --input /path/to/mall.mp4\n\n# 分析网络公共场所视频\npython -m scripts.smyx_public_place_group_emotion_index_analysis --url https://example.com/mall.mp4\n\n# 显示历史公共场所群体情绪指数报告（自动触发关键词：查看群体情绪历史报告、群体情绪指数报告清单等）\npython -m scripts.smyx_public_place_group_emotion_index_analysis --list\n\n# 输出精简报告\npython -m scripts.smyx_public_place_group_emotion_index_analysis --input mall.mp4 --detail basic\n\n# 保存结果到文件\npython -m scripts.smyx_public_place_group_emotion_index_analysis --input mall.mp4 --output result.json\n```\n\nFile v1.0.10:_meta.json\n\n{\n  \"ownerId\": \"kn7e2caqj7pnsvr9r7t8zenghs83xw7n\",\n  \"slug\": \"smyx-public-place-group-emotion-index-analysis\",\n  \"version\": \"1.0.10\",\n  \"publishedAt\": 1787106749142\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_PUBLIC_PLACE_GROUP_EMOTION_INDEX_ANALYSIS` - 公共场所群体情绪指数（展览/商场）\n\n## 输入约束\n\n- 摄像头：商场出入口 / 收银区 / 主动线 / 展厅 / 候机厅 / 售票处等公共场所高位固定摄像头，能拍到顾客**正面或斜侧脸**\n- 帧率 ≥ 5 FPS（推荐 10 FPS）；分辨率 ≥ 720p；光照稳定避免逆光\n- 视频时长建议 ≥ 10 分钟，覆盖完整客流时段，过短样本无法稳定计算群体指数\n- ROI 标定：可按区域划分多个子区域（如入口 / 收银 / 展品 A / 展品 B）以输出区域级情绪指数\n- 多视角部署时建议每个区域至少 1 路摄像头\n- **强匿名约束**：仅做匿名表情聚合统计，**禁止**人脸识别 / 人脸比对 / 身份绑定 / 跨摄像头跟踪\n\n## 关键观测信号\n\n- `face_detected_count` - 当前帧检测到的人脸数\n- `emotion_distribution` - 6 类情绪分布（happy / calm / irritated / surprised / sad / fearful 占比）\n- `positive_ratio` - 积极情绪占比（happy + calm）\n- `negative_ratio` - 消极情绪占比（irritated + sad + fearful）\n- `irritation_ratio` - 烦躁情绪占比（**安全预警关键指标**）\n- `group_emotion_index` - 群体情绪指数（0-100，数值越高代表群体情绪越积极）\n- `crowd_density_estimate` - 人群密度估计（参考指标，与烦躁占比联合判定）\n- `dwell_time_estimate_sec` - 平均停留时长估计（展品/区域吸引力参考）\n\n## 阈值与等级\n\n- `≥ 70` - 群体情绪积极（positive）\n- `50-69` - 群体情绪平稳（neutral）\n- `30-49` - 群体情绪低落（low）→ 建议优化服务\n- `< 30` 或 `irritation_ratio > 25%` - 群体情绪偏负面（negative）→ 推送运营优化或安全预警\n- 最小样本保护：`face_detected_count < 5` 时输出 `insufficient_sample`，不发布群体指数\n\n## 输出字段（参考）\n\n- `time_window` / `place_type`（mall / exhibition / scenic_area / airport / museum / theme_park / other）\n- `face_detected_count` / `crowd_density_estimate` / `dwell_time_estimate_sec`\n- `emotion_distribution` / `positive_ratio` / `negative_ratio` / `irritation_ratio`\n- `group_emotion_index` / `emotion_level` (positive / neutral / low / negative)\n- `region_breakdown` - 区域级情绪指数数组（[{region_name, group_emotion_index, irritation_ratio, ...}]）\n- `trend_vs_last_window` - 与上一时间窗变化（delta_pct）\n- `alert_type` - 提醒类型（operation_optimize / safety_warning / improving / normal）\n- `alert_level` - 提醒级别（info / notice / warning）\n- `operation_suggestion` - 运营建议（如\"收银区烦躁占比 32%、平均停留 4 分钟，建议增开 1 个收银台\"）\n- `safety_suggestion` - 安全建议（如\"入口区域烦躁占比 38% 且密度偏高，建议增派 1 名安保安抚分流\"）\n- `emotion_heatmap_image_url` - 情绪指数区域热力图 URL（伪彩色叠加在场景平面图）\n\n## 强制约束与红线\n\n- ❌ **禁止**进行人脸识别 / 人脸比对 / 顾客身份绑定 / 跨摄像头身份跟踪\n- ❌ **禁止**长期存储顾客原始视频或可识别人脸特征向量\n- ❌ **禁止**将群体情绪结果用于针对个体顾客的差异化定价或服务歧视\n- ✅ 仅输出**区域级匿名聚合**指标，作为运营优化与安全预警辅助参考\n- ✅ 部署场所必须以**显著标识**告知公众使用了匿名情绪分析摄像头，并提供咨询联系方式\n- ✅ 数据保存期限建议 ≤ 30 天，仅保留聚合指标，不保留原始视频\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\nAnalyzes public-place camera images or videos to produce anonymous group-level emotion distributions, a 0-100 group emotion index, operating suggestions, safety-warning guidance, and report links.\n\nThis skill is ready for commercial/non-commercial use.\n\n## Publisher:\n\n[18072937735](https://clawhub.ai/user/18072937735)\n\n### License/Terms of Use:\n\nMIT-0\n\n## Use Case:\n\nExternal operators, developers, and venue analytics teams use this skill to analyze fixed-camera footage from malls, exhibitions, scenic areas, airports, museums, and similar public places. It supports aggregate customer-satisfaction monitoring, service-layout optimization, and human-reviewed public-safety triage.\n\n### Deployment Geography for Use:\n\nGlobal\n\n## Known Risks and Mitigations:\n\nRisk: Public-place footage and account-related identifiers are sent to the provider's cloud service.\n\nMitigation: Use only in deployments with clear public notice, consent or other lawful basis, documented retention limits, and approval for cloud processing of camera footage.\n\nRisk: The skill creates or reuses local identity state and stores token/profile data.\n\nMitigation: Before deployment, identify the local data directory, restrict file permissions, define token/profile rotation and deletion procedures, and periodically review generated account records.\n\nRisk: Group emotion and safety-warning outputs can be misused as deterministic judgments about individuals or automatic interventions.\n\nMitigation: Keep outputs at aggregate venue or region level, prohibit individual pricing or service discrimination, and require human review before operational or safety actions.\n\n## Reference(s):\n\n- [Public Place Group Emotion Index API Documentation](artifact/references/api_doc.md)\n- [Skill Demo](https://lifeemergence.com/sample.html)\n- [ClawHub Skill Page](https://clawhub.ai/18072937735/skills/smyx-public-place-group-emotion-index-analysis)\n\n## Skill Output:\n\n**Output Type(s):** [text, markdown, code, shell commands, configuration, guidance]\n\n**Output Format:** [Markdown or JSON-style structured report text]\n\n**Output Parameters:** [1D]\n\n**Other Properties Related to Output:** [May include emotion distributions, group emotion index, regional breakdowns, operational suggestions, safety suggestions, heatmap/report links, historical report tables, and optional local output files.]\n\n## Skill Version(s):\n\n1.0.10 (source: SKILL.md frontmatter and ClawHub release evidence)\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, 42617 bytes\n\nFiles: references/api_doc.md (4507b), scripts/__init__.py (71b), scripts/config.py (710b), scripts/config.yaml (3b), scripts/skill.py (598b), scripts/smyx_public_place_group_emotion_index_analysis.py (3673b), skill-card.md (2973b), SKILL.md (14300b), 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.9:SKILL.md\n\n---\nname: \"smyx-public-place-group-emotion-index-analysis\"\ndescription: \"Using fixed cameras in malls, exhibition halls, scenic areas and other public places, the system analyzes facial expressions of multiple people in the scene in real time (with anonymized expression recognition only), aggregates the distribution of emotions (happy, calm, irritated, surprised, sad, fearful, etc.), and computes an overall group-emotion index (0-100; higher = more positive). | 通过商场、展览馆、景区等公共场所的固定摄像头，实时分析场景中多人的面部表情（使用匿名化表情识别），统计各类情绪（愉悦、平静、烦躁、惊讶、悲伤等）的分布比例，计算整体情绪指数（0-100，数值越高代表群体情绪越积极）。该技能可帮助运营方了解顾客满意度、优化服务布局，或用于公共安全预警（如烦躁情绪比例过高可能预示冲突风险）。\"\nversion: \"1.0.10\"\nlicense: \"MIT-0\"\n---\n\n# 👥 Public Place Group Emotion Index (Exhibition / Mall) | 公共场所群体情绪指数（展览/商场）\n> **智能分析中枢** · 图片/视频智能分析 · 结构化报告 · 历史报告云端查询\n\n---\n\n## 🧭 技能概览 | Overview\n\n| 模块 | 内容 |\n|---|---|\n| 🏷️ 技能名称 | **公共场所群体情绪指数（展览/商场）** |\n| 🎯 核心目标 | 通过商场、展览馆、景区等公共场所的固定摄像头，实时分析场景中多人的面部表情（使用匿名化表情识别），统计各类情绪（愉悦、平静、烦躁、惊讶、悲伤等）的分布比例，计算整体情绪指数（0-100，数值越高代表群体情绪越积极）。该技能可帮助运营方了解顾客满意度、优化服务布局，或用于公共安全预警（如烦躁情绪比例过高可能预示冲突风险）。 |\n| 🖼️ 输入类型 | 图片、视频、本地文件、网络 URL |\n| 📝 输出能力 | 结构化分析报告、识别/监测结果、建议与报告链接 |\n| 🧩 场景码 | `SMYX_PUBLIC_PLACE_GROUP_EMOTION_INDEX_ANALYSIS` |\n\nUsing fixed cameras in malls, exhibition halls, scenic areas and other public places, the system analyzes facial expressions of multiple people in the scene in real time (with anonymized expression recognition only), aggregates the distribution of emotions (happy, calm, irritated, surprised, sad, fearful, etc.), and computes an overall group-emotion index (0-100; higher = more positive). This skill helps operators understand customer satisfaction, optimize service layout, or trigger public-safety warnings (e.g., a high irritation ratio may indicate conflict risk). Application scenarios: shopping malls, exhibition halls, museums, theme parks, airport waiting halls. The system periodically generates group-emotion reports to support management decisions. Skill features: understanding customer emotions enables malls to promptly adjust services (e.g., open more checkouts, improve air conditioning, optimize traffic flow) and boost satisfaction; for exhibitions, it assesses exhibit appeal; for public safety, it warns against group irritation that may escalate into conflict. AI anonymous analysis delivers valuable insights while protecting privacy and is an essential capability of smart malls and smart scenic areas. Can be integrated into existing security systems or business-analytics platforms.\n\n通过商场、展览馆、景区等公共场所的固定摄像头，实时分析场景中多人的面部表情（使用匿名化表情识别），统计各类情绪（愉悦、平静、烦躁、惊讶、悲伤等）的分布比例，计算整体情绪指数（0-100，数值越高代表群体情绪越积极）。该技能可帮助运营方了解顾客满意度、优化服务布局，或用于公共安全预警（如烦躁情绪比例过高可能预示冲突风险）。应用场景：购物中心、展览馆、博物馆、主题公园、机场候机厅。系统定期生成群体情绪报告，辅助管理决策。技能特点：了解顾客情绪能帮助商场及时调整服务（如增加收银台、改善空调、优化动线），提升满意度；对展览馆可评估展品吸引力；对公共安全可预警群体暴躁可能引发的冲突。通过AI匿名分析，在保护隐私的前提下获取有价值的数据洞察，是智慧商场、智慧景区的重要功能。该技能可集成到现有安防系统或商业分析平台中。\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基于商场/展览馆/景区/机场/博物馆/主题公园等公共场所固定摄像头视频，匿名统计 6 类情绪分布 + 群体情绪指数（0-100）+ 按区域输出指数 → 输出运营优化建议（收银/空调/动线/展品吸引力）与公共安全预警（烦躁占比过高可能预示冲突风险）\n\n### 2. 🛠️ 能力范围\n\n| 序号 | 具体能力 |\n|---:|---|\n| 1 | 匿名人脸表情检测（**不做身份识别/比对/跟踪**） |\n| 2 | 6 类情绪分类（happy / calm / irritated / surprised / sad / fearful） |\n| 3 | 积极/消极/烦躁比例计算 |\n| 4 | 人群密度估计 |\n| 5 | 平均停留时长估计 |\n| 6 | 区域 ROI 划分与区域级情绪指数（region_breakdown） |\n| 7 | 与上一时间窗对比 |\n| 8 | 4 档情绪等级判定（positive ≥ 70 / neutral 50-69 / low 30-49 / negative < 30 或烦躁 > 25%） |\n| 9 | 最小样本保护（face_detected_count < 5 输出 insufficient_sample） |\n| 10 | 运营优化与安全预警双通道建议 |\n| 11 | 区域级情绪指数热力图 |\n\n### 3. ⚡ 触发条件\n\n| 触发类型 | 触发规则 |\n|---|---|\n| ✅ 默认触发 | **默认触发**：当用户提供商场/展览馆/景区等公共场所固定摄像头视频 URL 或文件需要分析时，默认触发本技能进行公共场所群体情绪指数分析 |\n| 🔎 明确分析意图 | 当用户明确提及商场顾客情绪、展品吸引力、景区满意度、群体暴躁、安全预警、智慧商场、智慧景区、客流情绪洞察等关键词，并且上传了视频文件 |\n| 📚 历史报告查询 | 当用户提及以下关键词时，**自动触发历史报告查询功能** ：查看群体情绪历史报告、群体情绪指数报告清单、商场/展览/景区情绪报告清单、查询历史群体情绪记录、显示所有群体情绪分析报告、显示客流情绪洞察报告，查询群体情绪预警清单 |\n\n### 4. 🤖 自动行为\n\n| 自动行为 | 执行要求 |\n|---|---|\n| 📎 附件处理 | 如果用户上传了附件或者视频/图片文件，则自动保存为本地文件 |\n| ☁️ 历史报告查询 | 如果用户触发历史报告查询关键词，必须直接调用云端 API 查询，不得从本地记忆或人工汇总中获取 |\n\n#### ⚠️ 强制数据获取规则（次高优先级）\n\n> **橙色强约束：** 历史报告清单只允许从云端接口读取，不允许从本地记录、长期记忆或人工汇总中提取。\n\n必须执行：\n\n```bash\npython -m scripts.smyx_public_place_group_emotion_index_analysis --list\n```\n\n| 类型 | 要求 |\n|---|---|\n| ✅ 必须 | 使用 `python -m scripts.smyx_public_place_group_emotion_index_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 | 📥 准备公共场所固定摄像头视频输入 | 提供本地文件路径或网络 URL；确保输入内容清晰、符合技能场景要求 |\n| 2 | 🔐 系统自动完成身份关联 | 无需用户输入任何身份参数；不在回复中展示内部身份值 |\n| 3 | ⚙️ 执行公共场所群体情绪指数分析 | 调用 `-m scripts.smyx_public_place_group_emotion_index_analysis` 处理输入（**必须在技能根目录下运行脚本**） |\n| 4 | 📊 查看分析结果 | 接收结构化分析报告，查看识别/监测结果、风险提示、建议与报告链接 |\n\n### ⚙️ 脚本参数说明\n\n| 参数 | 含义 | 备注 |\n|---|---|---|\n| `--input` | 本地公共场所固定摄像头视频文件路径 | 适用于本地文件分析 |\n| `--url` | 网络公共场所固定摄像头视频 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_public_place_group_emotion_index_analysis.py`](scripts/smyx_public_place_group_emotion_index_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；**关键**：能拍到顾客正面或斜侧脸、覆盖目标区域 |\n| 🔎 使用提醒 | 戴口罩、戴墨镜、低头看手机、背对摄像头等情形会显著降低可识别人脸数，建议在指标中标注 `face_detected_count` 以便解读 |\n| 🔎 使用提醒 | 短时局部表情（如顾客接电话短暂皱眉）不应单独触发负面预警，建议使用时间窗均值 |\n| 🔎 使用提醒 | 最小样本保护：`face_detected_count < 5` 时输出 `insufficient_sample`，**禁止**发布群体指数 |\n| 🔎 使用提醒 | 红线约束：**禁止**人脸识别 / 人脸比对 / 身份绑定 / 跨摄像头跟踪；**禁止**长期存储顾客原始视频或人脸特征向量；**禁止**将群体情绪用于针对个体顾客的差异化定价或服务歧视 |\n| 🔎 使用提醒 | 合规要点：部署场所必须以**显著标识**告知公众使用了匿名情绪分析摄像头，并提供咨询联系方式；数据保存期限建议 ≤ 30 天，仅保留聚合指标 |\n| 🧑‍⚖️ 结果性质 | 安全预警仅作为人工值守的辅助参考，**禁止**单纯依据情绪指数自动触发警报或干预 |\n| 🚫 脚本限制 | 禁止临时生成脚本，只能用技能本身的脚本 |\n| 🌐 网络地址 | 传入的网络地址参数，不需要下载本地，默认地址都是公网地址，api 服务会自动下载 |\n| 📜 报告输出 | 当显示历史分析报告清单的时候，从接口返回 json 数据中提取字段  作为超链接地址，且自动转化为如下 Markdown |\n| 📜 报告输出 | 表格输出示例 |\n\n## 🧰 使用示例 | Examples\n```bash\n# 分析本地公共场所视频\npython -m scripts.smyx_public_place_group_emotion_index_analysis --input /path/to/mall.mp4\n\n# 分析网络公共场所视频\npython -m scripts.smyx_public_place_group_emotion_index_analysis --url https://example.com/mall.mp4\n\n# 显示历史公共场所群体情绪指数报告（自动触发关键词：查看群体情绪历史报告、群体情绪指数报告清单等）\npython -m scripts.smyx_public_place_group_emotion_index_analysis --list\n\n# 输出精简报告\npython -m scripts.smyx_public_place_group_emotion_index_analysis --input mall.mp4 --detail basic\n\n# 保存结果到文件\npython -m scripts.smyx_public_place_group_emotion_index_analysis --input mall.mp4 --output result.json\n```\n\nFile v1.0.9:_meta.json\n\n{\n  \"ownerId\": \"kn7e2caqj7pnsvr9r7t8zenghs83xw7n\",\n  \"slug\": \"smyx-public-place-group-emotion-index-analysis\",\n  \"version\": \"1.0.9\",\n  \"publishedAt\": 1786859967799\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_PUBLIC_PLACE_GROUP_EMOTION_INDEX_ANALYSIS` - 公共场所群体情绪指数（展览/商场）\n\n## 输入约束\n\n- 摄像头：商场出入口 / 收银区 / 主动线 / 展厅 / 候机厅 / 售票处等公共场所高位固定摄像头，能拍到顾客**正面或斜侧脸**\n- 帧率 ≥ 5 FPS（推荐 10 FPS）；分辨率 ≥ 720p；光照稳定避免逆光\n- 视频时长建议 ≥ 10 分钟，覆盖完整客流时段，过短样本无法稳定计算群体指数\n- ROI 标定：可按区域划分多个子区域（如入口 / 收银 / 展品 A / 展品 B）以输出区域级情绪指数\n- 多视角部署时建议每个区域至少 1 路摄像头\n- **强匿名约束**：仅做匿名表情聚合统计，**禁止**人脸识别 / 人脸比对 / 身份绑定 / 跨摄像头跟踪\n\n## 关键观测信号\n\n- `face_detected_count` - 当前帧检测到的人脸数\n- `emotion_distribution` - 6 类情绪分布（happy / calm / irritated / surprised / sad / fearful 占比）\n- `positive_ratio` - 积极情绪占比（happy + calm）\n- `negative_ratio` - 消极情绪占比（irritated + sad + fearful）\n- `irritation_ratio` - 烦躁情绪占比（**安全预警关键指标**）\n- `group_emotion_index` - 群体情绪指数（0-100，数值越高代表群体情绪越积极）\n- `crowd_density_estimate` - 人群密度估计（参考指标，与烦躁占比联合判定）\n- `dwell_time_estimate_sec` - 平均停留时长估计（展品/区域吸引力参考）\n\n## 阈值与等级\n\n- `≥ 70` - 群体情绪积极（positive）\n- `50-69` - 群体情绪平稳（neutral）\n- `30-49` - 群体情绪低落（low）→ 建议优化服务\n- `< 30` 或 `irritation_ratio > 25%` - 群体情绪偏负面（negative）→ 推送运营优化或安全预警\n- 最小样本保护：`face_detected_count < 5` 时输出 `insufficient_sample`，不发布群体指数\n\n## 输出字段（参考）\n\n- `time_window` / `place_type`（mall / exhibition / scenic_area / airport / museum / theme_park / other）\n- `face_detected_count` / `crowd_density_estimate` / `dwell_time_estimate_sec`\n- `emotion_distribution` / `positive_ratio` / `negative_ratio` / `irritation_ratio`\n- `group_emotion_index` / `emotion_level` (positive / neutral / low / negative)\n- `region_breakdown` - 区域级情绪指数数组（[{region_name, group_emotion_index, irritation_ratio, ...}]）\n- `trend_vs_last_window` - 与上一时间窗变化（delta_pct）\n- `alert_type` - 提醒类型（operation_optimize / safety_warning / improving / normal）\n- `alert_level` - 提醒级别（info / notice / warning）\n- `operation_suggestion` - 运营建议（如\"收银区烦躁占比 32%、平均停留 4 分钟，建议增开 1 个收银台\"）\n- `safety_suggestion` - 安全建议（如\"入口区域烦躁占比 38% 且密度偏高，建议增派 1 名安保安抚分流\"）\n- `emotion_heatmap_image_url` - 情绪指数区域热力图 URL（伪彩色叠加在场景平面图）\n\n## 强制约束与红线\n\n- ❌ **禁止**进行人脸识别 / 人脸比对 / 顾客身份绑定 / 跨摄像头身份跟踪\n- ❌ **禁止**长期存储顾客原始视频或可识别人脸特征向量\n- ❌ **禁止**将群体情绪结果用于针对个体顾客的差异化定价或服务歧视\n- ✅ 仅输出**区域级匿名聚合**指标，作为运营优化与安全预警辅助参考\n- ✅ 部署场所必须以**显著标识**告知公众使用了匿名情绪分析摄像头，并提供咨询联系方式\n- ✅ 数据保存期限建议 ≤ 30 天，仅保留聚合指标，不保留原始视频\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\nUsing fixed cameras in malls, exhibition halls, scenic areas and other public places, the system analyzes facial expressions of multiple people in the scene in real time with anonymized expression recognition, aggregates emotion distribution, and computes an overall group-emotion index from 0 to 100.\n\nThis skill is ready for commercial/non-commercial use.\n\n## Publisher:\n\n[18072937735](https://clawhub.ai/user/18072937735)\n\n### License/Terms of Use:\n\nMIT-0\n\n## Use Case:\n\nExternal operators, venue teams, and developers use this skill to analyze public-place video or image inputs for anonymous group-level emotion distribution, regional emotion indexes, operational suggestions, and safety-warning guidance. It is intended for malls, exhibitions, scenic areas, airports, museums, and similar public venues where aggregate customer or crowd sentiment can inform staffing, layout, and monitoring decisions.\n\n### Deployment Geography for Use:\n\nGlobal\n\n## Known Risks and Mitigations:\n\nRisk: Public-place video, video URLs, derived reports, workspace-linked identity values, and authentication metadata may be sent to external LifeEmergence services.\n\nMitigation: Deploy only after confirming data-sharing approvals, public notice, retention limits, and contractual controls for the configured external services.\n\nRisk: Persistent local report, account, identity, or token state may conflict with user expectations created by anonymous-analysis wording.\n\nMitigation: Review local state handling before installation, restrict access to generated state files, and document what identifiers or tokens are retained.\n\nRisk: Group emotion outputs can be misused for individual decisions or automated interventions.\n\nMitigation: Use outputs only as aggregate operational guidance, keep human review in the loop, and prohibit identity matching, tracking, discrimination, or individual-level service changes.\n\n## Reference(s):\n\n- [API documentation](artifact/references/api_doc.md)\n- [ClawHub skill page](https://clawhub.ai/18072937735/skills/smyx-public-place-group-emotion-index-analysis)\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 and JSON-style analysis reports with metrics, recommendations, and report links]\n\n**Output Parameters:** [1D]\n\n**Other Properties Related to Output:** [Outputs may include group emotion distribution, index values, region breakdowns, warning levels, operational suggestions, safety suggestions, and optional saved report files.]\n\n## Skill Version(s):\n\n1.0.9 (source: server release metadata; artifact frontmatter states 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.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, 42699 bytes\n\nFiles: references/api_doc.md (4507b), scripts/__init__.py (71b), scripts/config.py (710b), scripts/config.yaml (3b), scripts/skill.py (598b), scripts/smyx_public_place_group_emotion_index_analysis.py (3673b), skill-card.md (3260b), SKILL.md (14299b), 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.8:SKILL.md\n\n---\nname: \"smyx-public-place-group-emotion-index-analysis\"\ndescription: \"Using fixed cameras in malls, exhibition halls, scenic areas and other public places, the system analyzes facial expressions of multiple people in the scene in real time (with anonymized expression recognition only), aggregates the distribution of emotions (happy, calm, irritated, surprised, sad, fearful, etc.), and computes an overall group-emotion index (0-100; higher = more positive). | 通过商场、展览馆、景区等公共场所的固定摄像头，实时分析场景中多人的面部表情（使用匿名化表情识别），统计各类情绪（愉悦、平静、烦躁、惊讶、悲伤等）的分布比例，计算整体情绪指数（0-100，数值越高代表群体情绪越积极）。该技能可帮助运营方了解顾客满意度、优化服务布局，或用于公共安全预警（如烦躁情绪比例过高可能预示冲突风险）。\"\nversion: \"1.0.8\"\nlicense: \"MIT-0\"\n---\n\n# 👥 Public Place Group Emotion Index (Exhibition / Mall) | 公共场所群体情绪指数（展览/商场）\n> **智能分析中枢** · 图片/视频智能分析 · 结构化报告 · 历史报告云端查询\n\n---\n\n## 🧭 技能概览 | Overview\n\n| 模块 | 内容 |\n|---|---|\n| 🏷️ 技能名称 | **公共场所群体情绪指数（展览/商场）** |\n| 🎯 核心目标 | 通过商场、展览馆、景区等公共场所的固定摄像头，实时分析场景中多人的面部表情（使用匿名化表情识别），统计各类情绪（愉悦、平静、烦躁、惊讶、悲伤等）的分布比例，计算整体情绪指数（0-100，数值越高代表群体情绪越积极）。该技能可帮助运营方了解顾客满意度、优化服务布局，或用于公共安全预警（如烦躁情绪比例过高可能预示冲突风险）。 |\n| 🖼️ 输入类型 | 图片、视频、本地文件、网络 URL |\n| 📝 输出能力 | 结构化分析报告、识别/监测结果、建议与报告链接 |\n| 🧩 场景码 | `SMYX_PUBLIC_PLACE_GROUP_EMOTION_INDEX_ANALYSIS` |\n\nUsing fixed cameras in malls, exhibition halls, scenic areas and other public places, the system analyzes facial expressions of multiple people in the scene in real time (with anonymized expression recognition only), aggregates the distribution of emotions (happy, calm, irritated, surprised, sad, fearful, etc.), and computes an overall group-emotion index (0-100; higher = more positive). This skill helps operators understand customer satisfaction, optimize service layout, or trigger public-safety warnings (e.g., a high irritation ratio may indicate conflict risk). Application scenarios: shopping malls, exhibition halls, museums, theme parks, airport waiting halls. The system periodically generates group-emotion reports to support management decisions. Skill features: understanding customer emotions enables malls to promptly adjust services (e.g., open more checkouts, improve air conditioning, optimize traffic flow) and boost satisfaction; for exhibitions, it assesses exhibit appeal; for public safety, it warns against group irritation that may escalate into conflict. AI anonymous analysis delivers valuable insights while protecting privacy and is an essential capability of smart malls and smart scenic areas. Can be integrated into existing security systems or business-analytics platforms.\n\n通过商场、展览馆、景区等公共场所的固定摄像头，实时分析场景中多人的面部表情（使用匿名化表情识别），统计各类情绪（愉悦、平静、烦躁、惊讶、悲伤等）的分布比例，计算整体情绪指数（0-100，数值越高代表群体情绪越积极）。该技能可帮助运营方了解顾客满意度、优化服务布局，或用于公共安全预警（如烦躁情绪比例过高可能预示冲突风险）。应用场景：购物中心、展览馆、博物馆、主题公园、机场候机厅。系统定期生成群体情绪报告，辅助管理决策。技能特点：了解顾客情绪能帮助商场及时调整服务（如增加收银台、改善空调、优化动线），提升满意度；对展览馆可评估展品吸引力；对公共安全可预警群体暴躁可能引发的冲突。通过AI匿名分析，在保护隐私的前提下获取有价值的数据洞察，是智慧商场、智慧景区的重要功能。该技能可集成到现有安防系统或商业分析平台中。\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基于商场/展览馆/景区/机场/博物馆/主题公园等公共场所固定摄像头视频，匿名统计 6 类情绪分布 + 群体情绪指数（0-100）+ 按区域输出指数 → 输出运营优化建议（收银/空调/动线/展品吸引力）与公共安全预警（烦躁占比过高可能预示冲突风险）\n\n### 2. 🛠️ 能力范围\n\n| 序号 | 具体能力 |\n|---:|---|\n| 1 | 匿名人脸表情检测（**不做身份识别/比对/跟踪**） |\n| 2 | 6 类情绪分类（happy / calm / irritated / surprised / sad / fearful） |\n| 3 | 积极/消极/烦躁比例计算 |\n| 4 | 人群密度估计 |\n| 5 | 平均停留时长估计 |\n| 6 | 区域 ROI 划分与区域级情绪指数（region_breakdown） |\n| 7 | 与上一时间窗对比 |\n| 8 | 4 档情绪等级判定（positive ≥ 70 / neutral 50-69 / low 30-49 / negative < 30 或烦躁 > 25%） |\n| 9 | 最小样本保护（face_detected_count < 5 输出 insufficient_sample） |\n| 10 | 运营优化与安全预警双通道建议 |\n| 11 | 区域级情绪指数热力图 |\n\n### 3. ⚡ 触发条件\n\n| 触发类型 | 触发规则 |\n|---|---|\n| ✅ 默认触发 | **默认触发**：当用户提供商场/展览馆/景区等公共场所固定摄像头视频 URL 或文件需要分析时，默认触发本技能进行公共场所群体情绪指数分析 |\n| 🔎 明确分析意图 | 当用户明确提及商场顾客情绪、展品吸引力、景区满意度、群体暴躁、安全预警、智慧商场、智慧景区、客流情绪洞察等关键词，并且上传了视频文件 |\n| 📚 历史报告查询 | 当用户提及以下关键词时，**自动触发历史报告查询功能** ：查看群体情绪历史报告、群体情绪指数报告清单、商场/展览/景区情绪报告清单、查询历史群体情绪记录、显示所有群体情绪分析报告、显示客流情绪洞察报告，查询群体情绪预警清单 |\n\n### 4. 🤖 自动行为\n\n| 自动行为 | 执行要求 |\n|---|---|\n| 📎 附件处理 | 如果用户上传了附件或者视频/图片文件，则自动保存为本地文件 |\n| ☁️ 历史报告查询 | 如果用户触发历史报告查询关键词，必须直接调用云端 API 查询，不得从本地记忆或人工汇总中获取 |\n\n#### ⚠️ 强制数据获取规则（次高优先级）\n\n> **橙色强约束：** 历史报告清单只允许从云端接口读取，不允许从本地记录、长期记忆或人工汇总中提取。\n\n必须执行：\n\n```bash\npython -m scripts.smyx_public_place_group_emotion_index_analysis --list\n```\n\n| 类型 | 要求 |\n|---|---|\n| ✅ 必须 | 使用 `python -m scripts.smyx_public_place_group_emotion_index_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 | 📥 准备公共场所固定摄像头视频输入 | 提供本地文件路径或网络 URL；确保输入内容清晰、符合技能场景要求 |\n| 2 | 🔐 系统自动完成身份关联 | 无需用户输入任何身份参数；不在回复中展示内部身份值 |\n| 3 | ⚙️ 执行公共场所群体情绪指数分析 | 调用 `-m scripts.smyx_public_place_group_emotion_index_analysis` 处理输入（**必须在技能根目录下运行脚本**） |\n| 4 | 📊 查看分析结果 | 接收结构化分析报告，查看识别/监测结果、风险提示、建议与报告链接 |\n\n### ⚙️ 脚本参数说明\n\n| 参数 | 含义 | 备注 |\n|---|---|---|\n| `--input` | 本地公共场所固定摄像头视频文件路径 | 适用于本地文件分析 |\n| `--url` | 网络公共场所固定摄像头视频 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_public_place_group_emotion_index_analysis.py`](scripts/smyx_public_place_group_emotion_index_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；**关键**：能拍到顾客正面或斜侧脸、覆盖目标区域 |\n| 🔎 使用提醒 | 戴口罩、戴墨镜、低头看手机、背对摄像头等情形会显著降低可识别人脸数，建议在指标中标注 `face_detected_count` 以便解读 |\n| 🔎 使用提醒 | 短时局部表情（如顾客接电话短暂皱眉）不应单独触发负面预警，建议使用时间窗均值 |\n| 🔎 使用提醒 | 最小样本保护：`face_detected_count < 5` 时输出 `insufficient_sample`，**禁止**发布群体指数 |\n| 🔎 使用提醒 | 红线约束：**禁止**人脸识别 / 人脸比对 / 身份绑定 / 跨摄像头跟踪；**禁止**长期存储顾客原始视频或人脸特征向量；**禁止**将群体情绪用于针对个体顾客的差异化定价或服务歧视 |\n| 🔎 使用提醒 | 合规要点：部署场所必须以**显著标识**告知公众使用了匿名情绪分析摄像头，并提供咨询联系方式；数据保存期限建议 ≤ 30 天，仅保留聚合指标 |\n| 🧑‍⚖️ 结果性质 | 安全预警仅作为人工值守的辅助参考，**禁止**单纯依据情绪指数自动触发警报或干预 |\n| 🚫 脚本限制 | 禁止临时生成脚本，只能用技能本身的脚本 |\n| 🌐 网络地址 | 传入的网络地址参数，不需要下载本地，默认地址都是公网地址，api 服务会自动下载 |\n| 📜 报告输出 | 当显示历史分析报告清单的时候，从接口返回 json 数据中提取字段  作为超链接地址，且自动转化为如下 Markdown |\n| 📜 报告输出 | 表格输出示例 |\n\n## 🧰 使用示例 | Examples\n```bash\n# 分析本地公共场所视频\npython -m scripts.smyx_public_place_group_emotion_index_analysis --input /path/to/mall.mp4\n\n# 分析网络公共场所视频\npython -m scripts.smyx_public_place_group_emotion_index_analysis --url https://example.com/mall.mp4\n\n# 显示历史公共场所群体情绪指数报告（自动触发关键词：查看群体情绪历史报告、群体情绪指数报告清单等）\npython -m scripts.smyx_public_place_group_emotion_index_analysis --list\n\n# 输出精简报告\npython -m scripts.smyx_public_place_group_emotion_index_analysis --input mall.mp4 --detail basic\n\n# 保存结果到文件\npython -m scripts.smyx_public_place_group_emotion_index_analysis --input mall.mp4 --output result.json\n```\n\nFile v1.0.8:_meta.json\n\n{\n  \"ownerId\": \"kn7e2caqj7pnsvr9r7t8zenghs83xw7n\",\n  \"slug\": \"smyx-public-place-group-emotion-index-analysis\",\n  \"version\": \"1.0.8\",\n  \"publishedAt\": 1785698969792\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_PUBLIC_PLACE_GROUP_EMOTION_INDEX_ANALYSIS` - 公共场所群体情绪指数（展览/商场）\n\n## 输入约束\n\n- 摄像头：商场出入口 / 收银区 / 主动线 / 展厅 / 候机厅 / 售票处等公共场所高位固定摄像头，能拍到顾客**正面或斜侧脸**\n- 帧率 ≥ 5 FPS（推荐 10 FPS）；分辨率 ≥ 720p；光照稳定避免逆光\n- 视频时长建议 ≥ 10 分钟，覆盖完整客流时段，过短样本无法稳定计算群体指数\n- ROI 标定：可按区域划分多个子区域（如入口 / 收银 / 展品 A / 展品 B）以输出区域级情绪指数\n- 多视角部署时建议每个区域至少 1 路摄像头\n- **强匿名约束**：仅做匿名表情聚合统计，**禁止**人脸识别 / 人脸比对 / 身份绑定 / 跨摄像头跟踪\n\n## 关键观测信号\n\n- `face_detected_count` - 当前帧检测到的人脸数\n- `emotion_distribution` - 6 类情绪分布（happy / calm / irritated / surprised / sad / fearful 占比）\n- `positive_ratio` - 积极情绪占比（happy + calm）\n- `negative_ratio` - 消极情绪占比（irritated + sad + fearful）\n- `irritation_ratio` - 烦躁情绪占比（**安全预警关键指标**）\n- `group_emotion_index` - 群体情绪指数（0-100，数值越高代表群体情绪越积极）\n- `crowd_density_estimate` - 人群密度估计（参考指标，与烦躁占比联合判定）\n- `dwell_time_estimate_sec` - 平均停留时长估计（展品/区域吸引力参考）\n\n## 阈值与等级\n\n- `≥ 70` - 群体情绪积极（positive）\n- `50-69` - 群体情绪平稳（neutral）\n- `30-49` - 群体情绪低落（low）→ 建议优化服务\n- `< 30` 或 `irritation_ratio > 25%` - 群体情绪偏负面（negative）→ 推送运营优化或安全预警\n- 最小样本保护：`face_detected_count < 5` 时输出 `insufficient_sample`，不发布群体指数\n\n## 输出字段（参考）\n\n- `time_window` / `place_type`（mall / exhibition / scenic_area / airport / museum / theme_park / other）\n- `face_detected_count` / `crowd_density_estimate` / `dwell_time_estimate_sec`\n- `emotion_distribution` / `positive_ratio` / `negative_ratio` / `irritation_ratio`\n- `group_emotion_index` / `emotion_level` (positive / neutral / low / negative)\n- `region_breakdown` - 区域级情绪指数数组（[{region_name, group_emotion_index, irritation_ratio, ...}]）\n- `trend_vs_last_window` - 与上一时间窗变化（delta_pct）\n- `alert_type` - 提醒类型（operation_optimize / safety_warning / improving / normal）\n- `alert_level` - 提醒级别（info / notice / warning）\n- `operation_suggestion` - 运营建议（如\"收银区烦躁占比 32%、平均停留 4 分钟，建议增开 1 个收银台\"）\n- `safety_suggestion` - 安全建议（如\"入口区域烦躁占比 38% 且密度偏高，建议增派 1 名安保安抚分流\"）\n- `emotion_heatmap_image_url` - 情绪指数区域热力图 URL（伪彩色叠加在场景平面图）\n\n## 强制约束与红线\n\n- ❌ **禁止**进行人脸识别 / 人脸比对 / 顾客身份绑定 / 跨摄像头身份跟踪\n- ❌ **禁止**长期存储顾客原始视频或可识别人脸特征向量\n- ❌ **禁止**将群体情绪结果用于针对个体顾客的差异化定价或服务歧视\n- ✅ 仅输出**区域级匿名聚合**指标，作为运营优化与安全预警辅助参考\n- ✅ 部署场所必须以**显著标识**告知公众使用了匿名情绪分析摄像头，并提供咨询联系方式\n- ✅ 数据保存期限建议 ≤ 30 天，仅保留聚合指标，不保留原始视频\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: prod\n\nFile v1.0.8:skill-card.md\n\n## Description: <br>\nAnalyzes fixed-camera public-place image or video inputs to produce anonymous group-level emotion distributions, a 0-100 group emotion index, operational suggestions, public-safety advisory signals, and report links. <br>\n\nThis skill is ready for commercial/non-commercial use. <br>\n\n## Publisher: <br>\n[18072937735](https://clawhub.ai/user/18072937735) <br>\n\n### License/Terms of Use: <br>\nMIT-0 <br>\n\n\n## Use Case: <br>\nExternal operators, developers, and venue analytics teams can use this skill to analyze authorized mall, exhibition, scenic-area, airport, museum, or theme-park footage for anonymous aggregate emotion trends. The outputs support customer-satisfaction monitoring, service-layout optimization, and human-reviewed safety awareness. <br>\n\n### Deployment Geography for Use: <br>\nGlobal <br>\n\n## Known Risks and Mitigations: <br>\nRisk: Public-camera media and group emotion analysis may involve sensitive public-place data and affected bystanders. <br>\nMitigation: Use only footage the operator is authorized to analyze, post clear public notice, provide a contact path, and retain only aggregate metrics for a limited period. <br>\nRisk: The skill sends analysis requests to the publisher's cloud service and can query cloud-hosted historical reports. <br>\nMitigation: Review the publisher, cloud endpoint configuration, data handling terms, and retention controls before using production footage. <br>\nRisk: The skill creates or reuses an internal account identity and stores tokens locally. <br>\nMitigation: Run it in an isolated workspace, protect local data directories, rotate or remove tokens when access is no longer needed, and avoid sharing the workspace with untrusted users. <br>\nRisk: Emotion-index results can be misleading when samples are small, occluded, low quality, or interpreted as individual emotion judgments. <br>\nMitigation: Treat outputs as aggregate advisory signals, require human review for interventions, enforce minimum sample handling, and do not use results for individual pricing, discrimination, identity tracking, or automated enforcement. <br>\n\n\n## Reference(s): <br>\n- [ClawHub skill page](https://clawhub.ai/18072937735/skills/smyx-public-place-group-emotion-index-analysis) <br>\n- [Skill demo](https://lifeemergence.com/sample.html) <br>\n- [Public place group emotion API documentation](artifact/references/api_doc.md) <br>\n- [Analysis API documentation](artifact/skills/smyx_analysis/references/api_doc.md) <br>\n\n\n## Skill Output: <br>\n**Output Type(s):** [text, markdown, shell commands, configuration, guidance] <br>\n**Output Format:** [Markdown and JSON structured analysis report] <br>\n**Output Parameters:** [1D] <br>\n**Other Properties Related to Output:** [May include group emotion distributions, group emotion index, region breakdowns, recommendations, historical report tables, and report export links.] <br>\n\n## Skill Version(s): <br>\n1.0.8 (source: frontmatter and server release metadata) <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.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, 42531 bytes\n\nFiles: references/api_doc.md (4507b), scripts/__init__.py (71b), scripts/config.py (710b), scripts/config.yaml (3b), scripts/skill.py (598b), scripts/smyx_public_place_group_emotion_index_analysis.py (3673b), skill-card.md (3021b), SKILL.md (14299b), 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.7:SKILL.md\n\n---\nname: \"smyx-public-place-group-emotion-index-analysis\"\ndescription: \"Using fixed cameras in malls, exhibition halls, scenic areas and other public places, the system analyzes facial expressions of multiple people in the scene in real time (with anonymized expression recognition only), aggregates the distribution of emotions (happy, calm, irritated, surprised, sad, fearful, etc.), and computes an overall group-emotion index (0-100; higher = more positive). | 通过商场、展览馆、景区等公共场所的固定摄像头，实时分析场景中多人的面部表情（使用匿名化表情识别），统计各类情绪（愉悦、平静、烦躁、惊讶、悲伤等）的分布比例，计算整体情绪指数（0-100，数值越高代表群体情绪越积极）。该技能可帮助运营方了解顾客满意度、优化服务布局，或用于公共安全预警（如烦躁情绪比例过高可能预示冲突风险）。\"\nversion: \"1.0.7\"\nlicense: \"MIT-0\"\n---\n\n# 👥 Public Place Group Emotion Index (Exhibition / Mall) | 公共场所群体情绪指数（展览/商场）\n> **智能分析中枢** · 图片/视频智能分析 · 结构化报告 · 历史报告云端查询\n\n---\n\n## 🧭 技能概览 | Overview\n\n| 模块 | 内容 |\n|---|---|\n| 🏷️ 技能名称 | **公共场所群体情绪指数（展览/商场）** |\n| 🎯 核心目标 | 通过商场、展览馆、景区等公共场所的固定摄像头，实时分析场景中多人的面部表情（使用匿名化表情识别），统计各类情绪（愉悦、平静、烦躁、惊讶、悲伤等）的分布比例，计算整体情绪指数（0-100，数值越高代表群体情绪越积极）。该技能可帮助运营方了解顾客满意度、优化服务布局，或用于公共安全预警（如烦躁情绪比例过高可能预示冲突风险）。 |\n| 🖼️ 输入类型 | 图片、视频、本地文件、网络 URL |\n| 📝 输出能力 | 结构化分析报告、识别/监测结果、建议与报告链接 |\n| 🧩 场景码 | `SMYX_PUBLIC_PLACE_GROUP_EMOTION_INDEX_ANALYSIS` |\n\nUsing fixed cameras in malls, exhibition halls, scenic areas and other public places, the system analyzes facial expressions of multiple people in the scene in real time (with anonymized expression recognition only), aggregates the distribution of emotions (happy, calm, irritated, surprised, sad, fearful, etc.), and computes an overall group-emotion index (0-100; higher = more positive). This skill helps operators understand customer satisfaction, optimize service layout, or trigger public-safety warnings (e.g., a high irritation ratio may indicate conflict risk). Application scenarios: shopping malls, exhibition halls, museums, theme parks, airport waiting halls. The system periodically generates group-emotion reports to support management decisions. Skill features: understanding customer emotions enables malls to promptly adjust services (e.g., open more checkouts, improve air conditioning, optimize traffic flow) and boost satisfaction; for exhibitions, it assesses exhibit appeal; for public safety, it warns against group irritation that may escalate into conflict. AI anonymous analysis delivers valuable insights while protecting privacy and is an essential capability of smart malls and smart scenic areas. Can be integrated into existing security systems or business-analytics platforms.\n\n通过商场、展览馆、景区等公共场所的固定摄像头，实时分析场景中多人的面部表情（使用匿名化表情识别），统计各类情绪（愉悦、平静、烦躁、惊讶、悲伤等）的分布比例，计算整体情绪指数（0-100，数值越高代表群体情绪越积极）。该技能可帮助运营方了解顾客满意度、优化服务布局，或用于公共安全预警（如烦躁情绪比例过高可能预示冲突风险）。应用场景：购物中心、展览馆、博物馆、主题公园、机场候机厅。系统定期生成群体情绪报告，辅助管理决策。技能特点：了解顾客情绪能帮助商场及时调整服务（如增加收银台、改善空调、优化动线），提升满意度；对展览馆可评估展品吸引力；对公共安全可预警群体暴躁可能引发的冲突。通过AI匿名分析，在保护隐私的前提下获取有价值的数据洞察，是智慧商场、智慧景区的重要功能。该技能可集成到现有安防系统或商业分析平台中。\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基于商场/展览馆/景区/机场/博物馆/主题公园等公共场所固定摄像头视频，匿名统计 6 类情绪分布 + 群体情绪指数（0-100）+ 按区域输出指数 → 输出运营优化建议（收银/空调/动线/展品吸引力）与公共安全预警（烦躁占比过高可能预示冲突风险）\n\n### 2. 🛠️ 能力范围\n\n| 序号 | 具体能力 |\n|---:|---|\n| 1 | 匿名人脸表情检测（**不做身份识别/比对/跟踪**） |\n| 2 | 6 类情绪分类（happy / calm / irritated / surprised / sad / fearful） |\n| 3 | 积极/消极/烦躁比例计算 |\n| 4 | 人群密度估计 |\n| 5 | 平均停留时长估计 |\n| 6 | 区域 ROI 划分与区域级情绪指数（region_breakdown） |\n| 7 | 与上一时间窗对比 |\n| 8 | 4 档情绪等级判定（positive ≥ 70 / neutral 50-69 / low 30-49 / negative < 30 或烦躁 > 25%） |\n| 9 | 最小样本保护（face_detected_count < 5 输出 insufficient_sample） |\n| 10 | 运营优化与安全预警双通道建议 |\n| 11 | 区域级情绪指数热力图 |\n\n### 3. ⚡ 触发条件\n\n| 触发类型 | 触发规则 |\n|---|---|\n| ✅ 默认触发 | **默认触发**：当用户提供商场/展览馆/景区等公共场所固定摄像头视频 URL 或文件需要分析时，默认触发本技能进行公共场所群体情绪指数分析 |\n| 🔎 明确分析意图 | 当用户明确提及商场顾客情绪、展品吸引力、景区满意度、群体暴躁、安全预警、智慧商场、智慧景区、客流情绪洞察等关键词，并且上传了视频文件 |\n| 📚 历史报告查询 | 当用户提及以下关键词时，**自动触发历史报告查询功能** ：查看群体情绪历史报告、群体情绪指数报告清单、商场/展览/景区情绪报告清单、查询历史群体情绪记录、显示所有群体情绪分析报告、显示客流情绪洞察报告，查询群体情绪预警清单 |\n\n### 4. 🤖 自动行为\n\n| 自动行为 | 执行要求 |\n|---|---|\n| 📎 附件处理 | 如果用户上传了附件或者视频/图片文件，则自动保存为本地文件 |\n| ☁️ 历史报告查询 | 如果用户触发历史报告查询关键词，必须直接调用云端 API 查询，不得从本地记忆或人工汇总中获取 |\n\n#### ⚠️ 强制数据获取规则（次高优先级）\n\n> **橙色强约束：** 历史报告清单只允许从云端接口读取，不允许从本地记录、长期记忆或人工汇总中提取。\n\n必须执行：\n\n```bash\npython -m scripts.smyx_public_place_group_emotion_index_analysis --list\n```\n\n| 类型 | 要求 |\n|---|---|\n| ✅ 必须 | 使用 `python -m scripts.smyx_public_place_group_emotion_index_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 | 📥 准备公共场所固定摄像头视频输入 | 提供本地文件路径或网络 URL；确保输入内容清晰、符合技能场景要求 |\n| 2 | 🔐 系统自动完成身份关联 | 无需用户输入任何身份参数；不在回复中展示内部身份值 |\n| 3 | ⚙️ 执行公共场所群体情绪指数分析 | 调用 `-m scripts.smyx_public_place_group_emotion_index_analysis` 处理输入（**必须在技能根目录下运行脚本**） |\n| 4 | 📊 查看分析结果 | 接收结构化分析报告，查看识别/监测结果、风险提示、建议与报告链接 |\n\n### ⚙️ 脚本参数说明\n\n| 参数 | 含义 | 备注 |\n|---|---|---|\n| `--input` | 本地公共场所固定摄像头视频文件路径 | 适用于本地文件分析 |\n| `--url` | 网络公共场所固定摄像头视频 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_public_place_group_emotion_index_analysis.py`](scripts/smyx_public_place_group_emotion_index_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；**关键**：能拍到顾客正面或斜侧脸、覆盖目标区域 |\n| 🔎 使用提醒 | 戴口罩、戴墨镜、低头看手机、背对摄像头等情形会显著降低可识别人脸数，建议在指标中标注 `face_detected_count` 以便解读 |\n| 🔎 使用提醒 | 短时局部表情（如顾客接电话短暂皱眉）不应单独触发负面预警，建议使用时间窗均值 |\n| 🔎 使用提醒 | 最小样本保护：`face_detected_count < 5` 时输出 `insufficient_sample`，**禁止**发布群体指数 |\n| 🔎 使用提醒 | 红线约束：**禁止**人脸识别 / 人脸比对 / 身份绑定 / 跨摄像头跟踪；**禁止**长期存储顾客原始视频或人脸特征向量；**禁止**将群体情绪用于针对个体顾客的差异化定价或服务歧视 |\n| 🔎 使用提醒 | 合规要点：部署场所必须以**显著标识**告知公众使用了匿名情绪分析摄像头，并提供咨询联系方式；数据保存期限建议 ≤ 30 天，仅保留聚合指标 |\n| 🧑‍⚖️ 结果性质 | 安全预警仅作为人工值守的辅助参考，**禁止**单纯依据情绪指数自动触发警报或干预 |\n| 🚫 脚本限制 | 禁止临时生成脚本，只能用技能本身的脚本 |\n| 🌐 网络地址 | 传入的网络地址参数，不需要下载本地，默认地址都是公网地址，api 服务会自动下载 |\n| 📜 报告输出 | 当显示历史分析报告清单的时候，从接口返回 json 数据中提取字段  作为超链接地址，且自动转化为如下 Markdown |\n| 📜 报告输出 | 表格输出示例 |\n\n## 🧰 使用示例 | Examples\n```bash\n# 分析本地公共场所视频\npython -m scripts.smyx_public_place_group_emotion_index_analysis --input /path/to/mall.mp4\n\n# 分析网络公共场所视频\npython -m scripts.smyx_public_place_group_emotion_index_analysis --url https://example.com/mall.mp4\n\n# 显示历史公共场所群体情绪指数报告（自动触发关键词：查看群体情绪历史报告、群体情绪指数报告清单等）\npython -m scripts.smyx_public_place_group_emotion_index_analysis --list\n\n# 输出精简报告\npython -m scripts.smyx_public_place_group_emotion_index_analysis --input mall.mp4 --detail basic\n\n# 保存结果到文件\npython -m scripts.smyx_public_place_group_emotion_index_analysis --input mall.mp4 --output result.json\n```\n\nFile v1.0.7:_meta.json\n\n{\n  \"ownerId\": \"kn7e2caqj7pnsvr9r7t8zenghs83xw7n\",\n  \"slug\": \"smyx-public-place-group-emotion-index-analysis\",\n  \"version\": \"1.0.7\",\n  \"publishedAt\": 1785440009398\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_PUBLIC_PLACE_GROUP_EMOTION_INDEX_ANALYSIS` - 公共场所群体情绪指数（展览/商场）\n\n## 输入约束\n\n- 摄像头：商场出入口 / 收银区 / 主动线 / 展厅 / 候机厅 / 售票处等公共场所高位固定摄像头，能拍到顾客**正面或斜侧脸**\n- 帧率 ≥ 5 FPS（推荐 10 FPS）；分辨率 ≥ 720p；光照稳定避免逆光\n- 视频时长建议 ≥ 10 分钟，覆盖完整客流时段，过短样本无法稳定计算群体指数\n- ROI 标定：可按区域划分多个子区域（如入口 / 收银 / 展品 A / 展品 B）以输出区域级情绪指数\n- 多视角部署时建议每个区域至少 1 路摄像头\n- **强匿名约束**：仅做匿名表情聚合统计，**禁止**人脸识别 / 人脸比对 / 身份绑定 / 跨摄像头跟踪\n\n## 关键观测信号\n\n- `face_detected_count` - 当前帧检测到的人脸数\n- `emotion_distribution` - 6 类情绪分布（happy / calm / irritated / surprised / sad / fearful 占比）\n- `positive_ratio` - 积极情绪占比（happy + calm）\n- `negative_ratio` - 消极情绪占比（irritated + sad + fearful）\n- `irritation_ratio` - 烦躁情绪占比（**安全预警关键指标**）\n- `group_emotion_index` - 群体情绪指数（0-100，数值越高代表群体情绪越积极）\n- `crowd_density_estimate` - 人群密度估计（参考指标，与烦躁占比联合判定）\n- `dwell_time_estimate_sec` - 平均停留时长估计（展品/区域吸引力参考）\n\n## 阈值与等级\n\n- `≥ 70` - 群体情绪积极（positive）\n- `50-69` - 群体情绪平稳（neutral）\n- `30-49` - 群体情绪低落（low）→ 建议优化服务\n- `< 30` 或 `irritation_ratio > 25%` - 群体情绪偏负面（negative）→ 推送运营优化或安全预警\n- 最小样本保护：`face_detected_count < 5` 时输出 `insufficient_sample`，不发布群体指数\n\n## 输出字段（参考）\n\n- `time_window` / `place_type`（mall / exhibition / scenic_area / airport / museum / theme_park / other）\n- `face_detected_count` / `crowd_density_estimate` / `dwell_time_estimate_sec`\n- `emotion_distribution` / `positive_ratio` / `negative_ratio` / `irritation_ratio`\n- `group_emotion_index` / `emotion_level` (positive / neutral / low / negative)\n- `region_breakdown` - 区域级情绪指数数组（[{region_name, group_emotion_index, irritation_ratio, ...}]）\n- `trend_vs_last_window` - 与上一时间窗变化（delta_pct）\n- `alert_type` - 提醒类型（operation_optimize / safety_warning / improving / normal）\n- `alert_level` - 提醒级别（info / notice / warning）\n- `operation_suggestion` - 运营建议（如\"收银区烦躁占比 32%、平均停留 4 分钟，建议增开 1 个收银台\"）\n- `safety_suggestion` - 安全建议（如\"入口区域烦躁占比 38% 且密度偏高，建议增派 1 名安保安抚分流\"）\n- `emotion_heatmap_image_url` - 情绪指数区域热力图 URL（伪彩色叠加在场景平面图）\n\n## 强制约束与红线\n\n- ❌ **禁止**进行人脸识别 / 人脸比对 / 顾客身份绑定 / 跨摄像头身份跟踪\n- ❌ **禁止**长期存储顾客原始视频或可识别人脸特征向量\n- ❌ **禁止**将群体情绪结果用于针对个体顾客的差异化定价或服务歧视\n- ✅ 仅输出**区域级匿名聚合**指标，作为运营优化与安全预警辅助参考\n- ✅ 部署场所必须以**显著标识**告知公众使用了匿名情绪分析摄像头，并提供咨询联系方式\n- ✅ 数据保存期限建议 ≤ 30 天，仅保留聚合指标，不保留原始视频\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: prod\n\nFile v1.0.7:skill-card.md\n\n## Description: <br>\nThis skill analyzes fixed-camera public-place image or video inputs to produce anonymized group-level facial-expression statistics, a 0-100 group emotion index, operational suggestions, safety warnings, and report links. <br>\n\nThis skill is ready for commercial/non-commercial use. <br>\n\n## Publisher: <br>\n[18072937735](https://clawhub.ai/user/18072937735) <br>\n\n### License/Terms of Use: <br>\nMIT-0 <br>\n\n\n## Use Case: <br>\nOperators and developers use this skill to analyze public-place camera footage from malls, exhibition halls, scenic areas, airports, museums, and theme parks. It returns group emotion distributions, region-level emotion indices, operational recommendations, safety-warning context, and historical report lookups for management review. <br>\n\n### Deployment Geography for Use: <br>\nGlobal <br>\n\n## Known Risks and Mitigations: <br>\nRisk: The security evidence says the skill sends video or video URLs to a remote service. <br>\nMitigation: Use only with legal authority, operator approval, posted public notice, and approved handling rules for camera footage and report data. <br>\nRisk: The security evidence says reports are linked to an internally managed user identity and local database state may be created. <br>\nMitigation: Review local state before deployment, restrict access to report history, and define a deletion process for credentials, identities, and reports. <br>\nRisk: The security evidence says backend tokens may be stored. <br>\nMitigation: Install only in controlled environments, rotate credentials as needed, and remove stored tokens when the skill is no longer in use. <br>\nRisk: The skill supports public-place emotion analysis from camera footage, which can affect privacy and safety decisions. <br>\nMitigation: Use results as group-level decision support only, avoid individual decisions or automated intervention, and require human review for safety responses. <br>\n\n\n## Reference(s): <br>\n- [Skill API Documentation](references/api_doc.md) <br>\n- [Skill Demo](https://lifeemergence.com/sample.html) <br>\n- [ClawHub Skill Page](https://clawhub.ai/18072937735/skills/smyx-public-place-group-emotion-index-analysis) <br>\n\n\n## Skill Output: <br>\n**Output Type(s):** [text, markdown, JSON, shell commands, guidance] <br>\n**Output Format:** [Markdown or JSON analysis report with report links and optional saved output file] <br>\n**Output Parameters:** [1D] <br>\n**Other Properties Related to Output:** [Outputs may include group emotion distributions, a 0-100 emotion index, region breakdowns, heatmap links, operational suggestions, safety suggestions, and historical report tables.] <br>\n\n## Skill Version(s): <br>\n1.0.7 (source: frontmatter and server release evidence) <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.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, 42597 bytes\n\nFiles: references/api_doc.md (4507b), scripts/__init__.py (71b), scripts/config.py (710b), scripts/config.yaml (3b), scripts/skill.py (598b), scripts/smyx_public_place_group_emotion_index_analysis.py (3673b), skill-card.md (2974b), SKILL.md (14299b), 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.6:SKILL.md\n\n---\nname: \"smyx-public-place-group-emotion-index-analysis\"\ndescription: \"Using fixed cameras in malls, exhibition halls, scenic areas and other public places, the system analyzes facial expressions of multiple people in the scene in real time (with anonymized expression recognition only), aggregates the distribution of emotions (happy, calm, irritated, surprised, sad, fearful, etc.), and computes an overall group-emotion index (0-100; higher = more positive). | 通过商场、展览馆、景区等公共场所的固定摄像头，实时分析场景中多人的面部表情（使用匿名化表情识别），统计各类情绪（愉悦、平静、烦躁、惊讶、悲伤等）的分布比例，计算整体情绪指数（0-100，数值越高代表群体情绪越积极）。该技能可帮助运营方了解顾客满意度、优化服务布局，或用于公共安全预警（如烦躁情绪比例过高可能预示冲突风险）。\"\nversion: \"1.0.5\"\nlicense: \"MIT-0\"\n---\n\n# 👥 Public Place Group Emotion Index (Exhibition / Mall) | 公共场所群体情绪指数（展览/商场）\n> **智能分析中枢** · 图片/视频智能分析 · 结构化报告 · 历史报告云端查询\n\n---\n\n## 🧭 技能概览 | Overview\n\n| 模块 | 内容 |\n|---|---|\n| 🏷️ 技能名称 | **公共场所群体情绪指数（展览/商场）** |\n| 🎯 核心目标 | 通过商场、展览馆、景区等公共场所的固定摄像头，实时分析场景中多人的面部表情（使用匿名化表情识别），统计各类情绪（愉悦、平静、烦躁、惊讶、悲伤等）的分布比例，计算整体情绪指数（0-100，数值越高代表群体情绪越积极）。该技能可帮助运营方了解顾客满意度、优化服务布局，或用于公共安全预警（如烦躁情绪比例过高可能预示冲突风险）。 |\n| 🖼️ 输入类型 | 图片、视频、本地文件、网络 URL |\n| 📝 输出能力 | 结构化分析报告、识别/监测结果、建议与报告链接 |\n| 🧩 场景码 | `SMYX_PUBLIC_PLACE_GROUP_EMOTION_INDEX_ANALYSIS` |\n\nUsing fixed cameras in malls, exhibition halls, scenic areas and other public places, the system analyzes facial expressions of multiple people in the scene in real time (with anonymized expression recognition only), aggregates the distribution of emotions (happy, calm, irritated, surprised, sad, fearful, etc.), and computes an overall group-emotion index (0-100; higher = more positive). This skill helps operators understand customer satisfaction, optimize service layout, or trigger public-safety warnings (e.g., a high irritation ratio may indicate conflict risk). Application scenarios: shopping malls, exhibition halls, museums, theme parks, airport waiting halls. The system periodically generates group-emotion reports to support management decisions. Skill features: understanding customer emotions enables malls to promptly adjust services (e.g., open more checkouts, improve air conditioning, optimize traffic flow) and boost satisfaction; for exhibitions, it assesses exhibit appeal; for public safety, it warns against group irritation that may escalate into conflict. AI anonymous analysis delivers valuable insights while protecting privacy and is an essential capability of smart malls and smart scenic areas. Can be integrated into existing security systems or business-analytics platforms.\n\n通过商场、展览馆、景区等公共场所的固定摄像头，实时分析场景中多人的面部表情（使用匿名化表情识别），统计各类情绪（愉悦、平静、烦躁、惊讶、悲伤等）的分布比例，计算整体情绪指数（0-100，数值越高代表群体情绪越积极）。该技能可帮助运营方了解顾客满意度、优化服务布局，或用于公共安全预警（如烦躁情绪比例过高可能预示冲突风险）。应用场景：购物中心、展览馆、博物馆、主题公园、机场候机厅。系统定期生成群体情绪报告，辅助管理决策。技能特点：了解顾客情绪能帮助商场及时调整服务（如增加收银台、改善空调、优化动线），提升满意度；对展览馆可评估展品吸引力；对公共安全可预警群体暴躁可能引发的冲突。通过AI匿名分析，在保护隐私的前提下获取有价值的数据洞察，是智慧商场、智慧景区的重要功能。该技能可集成到现有安防系统或商业分析平台中。\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基于商场/展览馆/景区/机场/博物馆/主题公园等公共场所固定摄像头视频，匿名统计 6 类情绪分布 + 群体情绪指数（0-100）+ 按区域输出指数 → 输出运营优化建议（收银/空调/动线/展品吸引力）与公共安全预警（烦躁占比过高可能预示冲突风险）\n\n### 2. 🛠️ 能力范围\n\n| 序号 | 具体能力 |\n|---:|---|\n| 1 | 匿名人脸表情检测（**不做身份识别/比对/跟踪**） |\n| 2 | 6 类情绪分类（happy / calm / irritated / surprised / sad / fearful） |\n| 3 | 积极/消极/烦躁比例计算 |\n| 4 | 人群密度估计 |\n| 5 | 平均停留时长估计 |\n| 6 | 区域 ROI 划分与区域级情绪指数（region_breakdown） |\n| 7 | 与上一时间窗对比 |\n| 8 | 4 档情绪等级判定（positive ≥ 70 / neutral 50-69 / low 30-49 / negative < 30 或烦躁 > 25%） |\n| 9 | 最小样本保护（face_detected_count < 5 输出 insufficient_sample） |\n| 10 | 运营优化与安全预警双通道建议 |\n| 11 | 区域级情绪指数热力图 |\n\n### 3. ⚡ 触发条件\n\n| 触发类型 | 触发规则 |\n|---|---|\n| ✅ 默认触发 | **默认触发**：当用户提供商场/展览馆/景区等公共场所固定摄像头视频 URL 或文件需要分析时，默认触发本技能进行公共场所群体情绪指数分析 |\n| 🔎 明确分析意图 | 当用户明确提及商场顾客情绪、展品吸引力、景区满意度、群体暴躁、安全预警、智慧商场、智慧景区、客流情绪洞察等关键词，并且上传了视频文件 |\n| 📚 历史报告查询 | 当用户提及以下关键词时，**自动触发历史报告查询功能** ：查看群体情绪历史报告、群体情绪指数报告清单、商场/展览/景区情绪报告清单、查询历史群体情绪记录、显示所有群体情绪分析报告、显示客流情绪洞察报告，查询群体情绪预警清单 |\n\n### 4. 🤖 自动行为\n\n| 自动行为 | 执行要求 |\n|---|---|\n| 📎 附件处理 | 如果用户上传了附件或者视频/图片文件，则自动保存为本地文件 |\n| ☁️ 历史报告查询 | 如果用户触发历史报告查询关键词，必须直接调用云端 API 查询，不得从本地记忆或人工汇总中获取 |\n\n#### ⚠️ 强制数据获取规则（次高优先级）\n\n> **橙色强约束：** 历史报告清单只允许从云端接口读取，不允许从本地记录、长期记忆或人工汇总中提取。\n\n必须执行：\n\n```bash\npython -m scripts.smyx_public_place_group_emotion_index_analysis --list\n```\n\n| 类型 | 要求 |\n|---|---|\n| ✅ 必须 | 使用 `python -m scripts.smyx_public_place_group_emotion_index_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 | 📥 准备公共场所固定摄像头视频输入 | 提供本地文件路径或网络 URL；确保输入内容清晰、符合技能场景要求 |\n| 2 | 🔐 系统自动完成身份关联 | 无需用户输入任何身份参数；不在回复中展示内部身份值 |\n| 3 | ⚙️ 执行公共场所群体情绪指数分析 | 调用 `-m scripts.smyx_public_place_group_emotion_index_analysis` 处理输入（**必须在技能根目录下运行脚本**） |\n| 4 | 📊 查看分析结果 | 接收结构化分析报告，查看识别/监测结果、风险提示、建议与报告链接 |\n\n### ⚙️ 脚本参数说明\n\n| 参数 | 含义 | 备注 |\n|---|---|---|\n| `--input` | 本地公共场所固定摄像头视频文件路径 | 适用于本地文件分析 |\n| `--url` | 网络公共场所固定摄像头视频 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_public_place_group_emotion_index_analysis.py`](scripts/smyx_public_place_group_emotion_index_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；**关键**：能拍到顾客正面或斜侧脸、覆盖目标区域 |\n| 🔎 使用提醒 | 戴口罩、戴墨镜、低头看手机、背对摄像头等情形会显著降低可识别人脸数，建议在指标中标注 `face_detected_count` 以便解读 |\n| 🔎 使用提醒 | 短时局部表情（如顾客接电话短暂皱眉）不应单独触发负面预警，建议使用时间窗均值 |\n| 🔎 使用提醒 | 最小样本保护：`face_detected_count < 5` 时输出 `insufficient_sample`，**禁止**发布群体指数 |\n| 🔎 使用提醒 | 红线约束：**禁止**人脸识别 / 人脸比对 / 身份绑定 / 跨摄像头跟踪；**禁止**长期存储顾客原始视频或人脸特征向量；**禁止**将群体情绪用于针对个体顾客的差异化定价或服务歧视 |\n| 🔎 使用提醒 | 合规要点：部署场所必须以**显著标识**告知公众使用了匿名情绪分析摄像头，并提供咨询联系方式；数据保存期限建议 ≤ 30 天，仅保留聚合指标 |\n| 🧑‍⚖️ 结果性质 | 安全预警仅作为人工值守的辅助参考，**禁止**单纯依据情绪指数自动触发警报或干预 |\n| 🚫 脚本限制 | 禁止临时生成脚本，只能用技能本身的脚本 |\n| 🌐 网络地址 | 传入的网络地址参数，不需要下载本地，默认地址都是公网地址，api 服务会自动下载 |\n| 📜 报告输出 | 当显示历史分析报告清单的时候，从接口返回 json 数据中提取字段  作为超链接地址，且自动转化为如下 Markdown |\n| 📜 报告输出 | 表格输出示例 |\n\n## 🧰 使用示例 | Examples\n```bash\n# 分析本地公共场所视频\npython -m scripts.smyx_public_place_group_emotion_index_analysis --input /path/to/mall.mp4\n\n# 分析网络公共场所视频\npython -m scripts.smyx_public_place_group_emotion_index_analysis --url https://example.com/mall.mp4\n\n# 显示历史公共场所群体情绪指数报告（自动触发关键词：查看群体情绪历史报告、群体情绪指数报告清单等）\npython -m scripts.smyx_public_place_group_emotion_index_analysis --list\n\n# 输出精简报告\npython -m scripts.smyx_public_place_group_emotion_index_analysis --input mall.mp4 --detail basic\n\n# 保存结果到文件\npython -m scripts.smyx_public_place_group_emotion_index_analysis --input mall.mp4 --output result.json\n```\n\nFile v1.0.6:_meta.json\n\n{\n  \"ownerId\": \"kn7e2caqj7pnsvr9r7t8zenghs83xw7n\",\n  \"slug\": \"smyx-public-place-group-emotion-index-analysis\",\n  \"version\": \"1.0.6\",\n  \"publishedAt\": 1783999350943\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_PUBLIC_PLACE_GROUP_EMOTION_INDEX_ANALYSIS` - 公共场所群体情绪指数（展览/商场）\n\n## 输入约束\n\n- 摄像头：商场出入口 / 收银区 / 主动线 / 展厅 / 候机厅 / 售票处等公共场所高位固定摄像头，能拍到顾客**正面或斜侧脸**\n- 帧率 ≥ 5 FPS（推荐 10 FPS）；分辨率 ≥ 720p；光照稳定避免逆光\n- 视频时长建议 ≥ 10 分钟，覆盖完整客流时段，过短样本无法稳定计算群体指数\n- ROI 标定：可按区域划分多个子区域（如入口 / 收银 / 展品 A / 展品 B）以输出区域级情绪指数\n- 多视角部署时建议每个区域至少 1 路摄像头\n- **强匿名约束**：仅做匿名表情聚合统计，**禁止**人脸识别 / 人脸比对 / 身份绑定 / 跨摄像头跟踪\n\n## 关键观测信号\n\n- `face_detected_count` - 当前帧检测到的人脸数\n- `emotion_distribution` - 6 类情绪分布（happy / calm / irritated / surprised / sad / fearful 占比）\n- `positive_ratio` - 积极情绪占比（happy + calm）\n- `negative_ratio` - 消极情绪占比（irritated + sad + fearful）\n- `irritation_ratio` - 烦躁情绪占比（**安全预警关键指标**）\n- `group_emotion_index` - 群体情绪指数（0-100，数值越高代表群体情绪越积极）\n- `crowd_density_estimate` - 人群密度估计（参考指标，与烦躁占比联合判定）\n- `dwell_time_estimate_sec` - 平均停留时长估计（展品/区域吸引力参考）\n\n## 阈值与等级\n\n- `≥ 70` - 群体情绪积极（positive）\n- `50-69` - 群体情绪平稳（neutral）\n- `30-49` - 群体情绪低落（low）→ 建议优化服务\n- `< 30` 或 `irritation_ratio > 25%` - 群体情绪偏负面（negative）→ 推送运营优化或安全预警\n- 最小样本保护：`face_detected_count < 5` 时输出 `insufficient_sample`，不发布群体指数\n\n## 输出字段（参考）\n\n- `time_window` / `place_type`（mall / exhibition / scenic_area / airport / museum / theme_park / other）\n- `face_detected_count` / `crowd_density_estimate` / `dwell_time_estimate_sec`\n- `emotion_distribution` / `positive_ratio` / `negative_ratio` / `irritation_ratio`\n- `group_emotion_index` / `emotion_level` (positive / neutral / low / negative)\n- `region_breakdown` - 区域级情绪指数数组（[{region_name, group_emotion_index, irritation_ratio, ...}]）\n- `trend_vs_last_window` - 与上一时间窗变化（delta_pct）\n- `alert_type` - 提醒类型（operation_optimize / safety_warning / improving / normal）\n- `alert_level` - 提醒级别（info / notice / warning）\n- `operation_suggestion` - 运营建议（如\"收银区烦躁占比 32%、平均停留 4 分钟，建议增开 1 个收银台\"）\n- `safety_suggestion` - 安全建议（如\"入口区域烦躁占比 38% 且密度偏高，建议增派 1 名安保安抚分流\"）\n- `emotion_heatmap_image_url` - 情绪指数区域热力图 URL（伪彩色叠加在场景平面图）\n\n## 强制约束与红线\n\n- ❌ **禁止**进行人脸识别 / 人脸比对 / 顾客身份绑定 / 跨摄像头身份跟踪\n- ❌ **禁止**长期存储顾客原始视频或可识别人脸特征向量\n- ❌ **禁止**将群体情绪结果用于针对个体顾客的差异化定价或服务歧视\n- ✅ 仅输出**区域级匿名聚合**指标，作为运营优化与安全预警辅助参考\n- ✅ 部署场所必须以**显著标识**告知公众使用了匿名情绪分析摄像头，并提供咨询联系方式\n- ✅ 数据保存期限建议 ≤ 30 天，仅保留聚合指标，不保留原始视频\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: <br>\nAnalyzes fixed-camera public-place images or videos to produce anonymized group emotion distributions, a 0-100 group emotion index, operational suggestions, safety-warning guidance, and report links. <br>\n\nThis skill is ready for commercial/non-commercial use. <br>\n\n## Publisher: <br>\n[18072937735](https://clawhub.ai/user/18072937735) <br>\n\n### License/Terms of Use: <br>\nMIT-0 <br>\n\n\n## Use Case: <br>\nExternal operators and developers use this skill to analyze public-place camera footage for group-level emotion trends in malls, exhibition halls, scenic areas, museums, airports, and similar venues. It supports operational planning and human-reviewed safety awareness, not individual identification or automated action against people. <br>\n\n### Deployment Geography for Use: <br>\nGlobal <br>\n\n## Known Risks and Mitigations: <br>\nRisk: Public-place images or videos may be sent to external services for analysis. <br>\nMitigation: Use only footage you are authorized to process, provide clear public notice, and confirm retention rules before deployment. <br>\nRisk: The skill can create or reuse persistent local or remote identity and token state linked to report history. <br>\nMitigation: Review account, token, and local storage behavior before installation and limit access to users who should see cloud-stored report history. <br>\nRisk: Group emotion scores can be misused for individual decisions, automated interventions, discriminatory service, or differential pricing. <br>\nMitigation: Use only anonymous aggregate results, keep safety outputs human-reviewed, and do not use the score to identify, track, price, or treat individuals differently. <br>\nRisk: Low face visibility, short time windows, or small samples can make the group emotion index unreliable. <br>\nMitigation: Follow the documented minimum-sample rule, do not publish an index when fewer than five faces are detected, and label camera or sampling limitations in reports. <br>\n\n\n## Reference(s): <br>\n- [ClawHub Skill Page](https://clawhub.ai/18072937735/skills/smyx-public-place-group-emotion-index-analysis) <br>\n- [API Documentation](artifact/references/api_doc.md) <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 or JSON structured analysis report with report links] <br>\n**Output Parameters:** [1D] <br>\n**Other Properties Related to Output:** [May write results to a requested file; history queries return cloud report records.] <br>\n\n## Skill Version(s): <br>\n1.0.6 (source: server release metadata; artifact frontmatter says 1.0.5) <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.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: 32 files, 39391 bytes\n\nFiles: references/api_doc.md (4507b), scripts/__init__.py (71b), scripts/api_service.py (1704b), scripts/config.py (710b), scripts/config.yaml (3b), scripts/skill.py (598b), scripts/smyx_public_place_group_emotion_index_analysis.py (3657b), skill-card.md (2850b), SKILL.md (15540b), skills/smyx_analysis/__init__.py (0b), skills/smyx_analysis/references/api_doc.md (2094b), skills/smyx_analysis/requirements.txt (45b), skills/smyx_analysis/scripts/__init__.py (0b), skills/smyx_analysis/scripts/api_service.py (1857b), 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 (3706b), 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 (2518b), 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 (22801b), skills/smyx_common/scripts/config.yaml (463b), skills/smyx_common/scripts/dao.py (11119b), skills/smyx_common/scripts/skill.py (2473b), skills/smyx_common/scripts/util.py (19347b), _meta.json (165b)\n\nFile v1.0.5:SKILL.md\n\n---\nname: \"smyx-public-place-group-emotion-index-analysis\"\ndescription: \"Using fixed cameras in malls, exhibition halls, scenic areas and other public places, the system analyzes facial expressions of multiple people in the scene in real time (with anonymized expression recognition only), aggregates the distribution of emotions (happy, calm, irritated, surprised, sad, fearful, etc.), and computes an overall group-emotion index (0-100; higher = more positive). | 通过商场、展览馆、景区等公共场所的固定摄像头，实时分析场景中多人的面部表情（使用匿名化表情识别），统计各类情绪（愉悦、平静、烦躁、惊讶、悲伤等）的分布比例，计算整体情绪指数（0-100，数值越高代表群体情绪越积极）。该技能可帮助运营方了解顾客满意度、优化服务布局，或用于公共安全预警（如烦躁情绪比例过高可能预示冲突风险）。\"\nversion: \"1.0.1\"\nlicense: \"MIT-0\"\n---\n\n# Public Place Group Emotion Index (Exhibition / Mall) | 公共场所群体情绪指数（展览/商场）\n\nUsing fixed cameras in malls, exhibition halls, scenic areas and other public places, the system analyzes facial expressions of multiple people in the scene in real time (with anonymized expression recognition only), aggregates the distribution of emotions (happy, calm, irritated, surprised, sad, fearful, etc.), and computes an overall group-emotion index (0-100; higher = more positive). This skill helps operators understand customer satisfaction, optimize service layout, or trigger public-safety warnings (e.g., a high irritation ratio may indicate conflict risk). Application scenarios: shopping malls, exhibition halls, museums, theme parks, airport waiting halls. The system periodically generates group-emotion reports to support management decisions. Skill features: understanding customer emotions enables malls to promptly adjust services (e.g., open more checkouts, improve air conditioning, optimize traffic flow) and boost satisfaction; for exhibitions, it assesses exhibit appeal; for public safety, it warns against group irritation that may escalate into conflict. AI anonymous analysis delivers valuable insights while protecting privacy and is an essential capability of smart malls and smart scenic areas. Can be integrated into existing security systems or business-analytics platforms.\n\n通过商场、展览馆、景区等公共场所的固定摄像头，实时分析场景中多人的面部表情（使用匿名化表情识别），统计各类情绪（愉悦、平静、烦躁、惊讶、悲伤等）的分布比例，计算整体情绪指数（0-100，数值越高代表群体情绪越积极）。该技能可帮助运营方了解顾客满意度、优化服务布局，或用于公共安全预警（如烦躁情绪比例过高可能预示冲突风险）。应用场景：购物中心、展览馆、博物馆、主题公园、机场候机厅。系统定期生成群体情绪报告，辅助管理决策。技能特点：了解顾客情绪能帮助商场及时调整服务（如增加收银台、改善空调、优化动线），提升满意度；对展览馆可评估展品吸引力；对公共安全可预警群体暴躁可能引发的冲突。通过AI匿名分析，在保护隐私的前提下获取有价值的数据洞察，是智慧商场、智慧景区的重要功能。该技能可集成到现有安防系统或商业分析平台中。\n\n## 🎯 AI 角色\n\n**假设你是一个专业的公共场所群体情绪分析 AI。你的任务是分析固定摄像头的视频，检测画面中多个人的面部表情（匿名化处理，不识别个人身份），统计各类情绪（愉悦、平静、烦躁、惊讶、悲伤、恐惧等）的出现频率，计算整体情绪指数，并按区域输出运营优化与安全预警建议。不要识别或存储个人特征，仅输出群体层面的匿名统计。**\n\n## 任务目标\n\n- 本 Skill 用于：基于商场/展览馆/景区/机场/博物馆/主题公园等公共场所固定摄像头视频，匿名统计 6 类情绪分布 + 群体情绪指数（0-100）+ 按区域输出指数 → 输出运营优化建议（收银/空调/动线/展品吸引力）与公共安全预警（烦躁占比过高可能预示冲突风险）\n- 能力包含：匿名人脸表情检测（**不做身份识别/比对/跟踪**）、6 类情绪分类（happy / calm / irritated / surprised / sad / fearful）、积极/消极/烦躁比例计算、人群密度估计、平均停留时长估计、区域 ROI 划分与区域级情绪指数（region_breakdown）、与上一时间窗对比、4 档情绪等级判定（positive ≥ 70 / neutral 50-69 / low 30-49 / negative < 30 或烦躁 > 25%）、最小样本保护（face_detected_count < 5 输出 insufficient_sample）、运营优化与安全预警双通道建议、区域级情绪指数热力图\n- 触发条件:\n    1. **默认触发**：当用户提供商场/展览馆/景区等公共场所固定摄像头视频 URL 或文件需要分析时，默认触发本技能进行公共场所群体情绪指数分析\n    2. 当用户明确提及商场顾客情绪、展品吸引力、景区满意度、群体暴躁、安全预警、智慧商场、智慧景区、客流情绪洞察等关键词，并且上传了视频文件\n    3. 当用户提及以下关键词时，**自动触发历史报告查询功能**\n       ：查看群体情绪历史报告、群体情绪指数报告清单、商场/展览/景区情绪报告清单、查询历史群体情绪记录、显示所有群体情绪分析报告、显示客流情绪洞察报告，查询群体情绪预警清单\n- 自动行为：\n    1. 如果用户上传了附件或者视频文件，则自动保存为本地文件\n    2. **⚠️ 强制数据获取规则（次高优先级）**：如果用户触发任何历史报告查询关键词（如\"查看所有群体情绪报告\"、\"\n       显示所有商场/展览/景区情绪报告\"、\"\n       查看历史报告\"等），**必须**：\n        - 直接使用 `python -m scripts.smyx_public_place_group_emotion_index_analysis --list --open-id` 参数调用 API\n          查询云端的历史报告数据\n        - **严格禁止**：从本地 memory 目录读取历史会话信息、严格禁止手动汇总本地记录中的报告、严格禁止从长期记忆中提取报告\n        - **必须统一**从云端接口获取最新完整数据，然后以 Markdown 表格格式输出结果\n\n## 前置准备\n\n- 依赖说明:scripts 脚本所需的依赖包及版本\n  ```\n  requests>=2.28.0\n  ```\n\n## 操作步骤\n\n### 🔒 open-id 获取流程控制（强制执行，防止遗漏）\n\n**在执行公共场所群体情绪指数分析前，必须按以下优先级顺序获取 open-id：**\n\n```\n第 1 步：【最高优先级】检查技能所在目录的配置文件（优先）\n        路径：skills/smyx_common/scripts/config.yaml（相对于技能根目录）\n        完整路径示例：${OPENCLAW_WORKSPACE}/skills/{当前技能目录}/skills/smyx_common/scripts/config.yaml\n        → 如果文件存在且配置了 api-key 字段，则读取 api-key 作为 open-id\n        ↓ (未找到/未配置/api-key 为空)\n第 2 步：检查 workspace 公共目录的配置文件\n        路径：${OPENCLAW_WORKSPACE}/skills/smyx_common/scripts/config.yaml\n        → 如果文件存在且配置了 api-key 字段，则读取 api-key 作为 open-id\n        ↓ (未找到/未配置)\n第 3 步：检查用户是否在消息中明确提供了 open-id\n        ↓ (未提供)\n第 4 步：❗ 必须暂停执行，明确提示用户提供用户名或手机号作为 open-id\n```\n\n**⚠️ 关键约束：**\n\n- **禁止**自行假设,自行推导,自行生成 open-id 值（如 openclaw-control-ui、default、userC113、user123 等）\n- **禁止**跳过 open-id 验证直接调用 API\n- **必须**在获取到有效 open-id 后才能继续执行分析\n- 如果用户拒绝提供 open-id，说明用途（用于保存和查询历史报告记录），并询问是否继续\n\n---\n\n- 标准流程:\n    1. **准备公共场所固定摄像头视频输入**\n        - 提供本地视频路径或网络 URL，建议时长 ≥ 10 分钟\n        - 摄像头建议：商场出入口/收银区/主动线/展厅/候机厅等高位固定摄像头，能拍到顾客**正面或斜侧脸**\n        - 帧率 ≥ 5 FPS（推荐 10 FPS）、分辨率 ≥ 720p、光照稳定\n        - 部署前完成区域 ROI 标定（入口 / 收银 / 展品 A 等）\n        - **强匿名约束**：禁止启用人脸识别 / 人脸比对 / 身份绑定 / 跨摄像头跟踪\n        - 必须以**显著标识**告知公众使用了匿名情绪分析摄像头\n        - 可选附带：场所类型（mall/exhibition/scenic_area/airport/museum/theme_park/other）、区域名称、阈值覆盖\n    2. **获取 open-id（强制执行）**\n        - 按上述流程控制获取 open-id\n        - 如无法获取，必须提示用户提供用户名或手机号\n    3. **执行公共场所群体情绪指数分析**\n        - 调用 `-m scripts.smyx_public_place_group_emotion_index_analysis` 处理输入（**必须在技能根目录下运行脚本**）\n        - 参数说明:\n            - `--input`: 本地公共场所固定摄像头视频文件路径\n            - `--url`: 网络公共场所固定摄像头视频 URL 地址（API 服务自动下载）\n            - `--pet-type`: 类别标识，公共场所群体情绪分析场景默认 `other`\n            - `--open-id`: 当前用户的 open-id（必填，按上述流程获取）\n            - `--list`: 显示公共场所群体情绪指数历史分析报告列表清单（可以输入起始日期参数过滤数据范围）\n            - `--api-key`: API 访问密钥（可选）\n            - `--api-url`: API 服务地址（可选，使用默认值）\n            - `--detail`: 输出详细程度（basic/standard/json，默认 json）\n            - `--output`: 结果输出文件路径（可选）\n    4. **查看分析结果**\n        - 接收结构化的公共场所群体情绪指数报告\n        - 包含：时间窗（time_window）、场所类型（place_type：mall / exhibition / scenic_area / airport / museum / theme_park / other）、检测到的人脸数（face_detected_count）、人群密度估计（crowd_density_estimate）、平均停留时长估计（dwell_time_estimate_sec）、6 类情绪分布（emotion_distribution：happy / calm / irritated / surprised / sad / fearful）、积极/消极/烦躁比例（positive_ratio / negative_ratio / irritation_ratio）、群体情绪指数（group_emotion_index：0-100）、情绪等级（emotion_level：positive / neutral / low / negative）、区域级情绪指数数组（region_breakdown：[{region_name, group_emotion_index, irritation_ratio, ...}]）、与上一时间窗变化（trend_vs_last_window：delta_pct）、提醒类型（alert_type：operation_optimize / safety_warning / improving / normal）、提醒级别（alert_level：info / notice / warning）、运营建议（operation_suggestion，如\"收银区烦躁占比 32%、平均停留 4 分钟，建议增开 1 个收银台\"）、安全建议（safety_suggestion，如\"入口区域烦躁占比 38% 且密度偏高，建议增派 1 名安保安抚分流\"）、区域情绪指数热力图（emotion_heatmap_image_url）\n        - **重要提示**：仅输出基于视觉的群体情绪聚合统计与运营/安全辅助参考，**不构成对任何个体顾客的情绪诊断或行为评价**；任何针对个体的服务调整必须经过当事人本人主动反馈与同意\n\n## 资源索引\n\n- 必要脚本：见 [scripts/smyx_public_place_group_emotion_index_analysis.py](scripts/smyx_public_place_group_emotion_index_analysis.py)(\n  用途：调用 API 进行公共场所群体情绪指数分析，本地文件上传，网络 URL 由 API 服务自动下载)\n- 配置文件：见 [scripts/config.py](scripts/config.py)(用途：配置 API 地址、默认参数和场景码)\n- 领域参考：见 [references/api_doc.md](references/api_doc.md)(何时读取：需要了解 API 接口规范、6 类情绪/群体情绪指数阈值/最小样本保护/匿名红线和错误码时)\n\n## 注意事项\n\n- 仅在需要时读取参考文档，保持上下文简洁\n- 输入要求：支持 mp4/avi/mov 视频，最大 10MB；**关键**：能拍到顾客正面或斜侧脸、覆盖目标区域\n- API 密钥可选，如果通过参数传入则必须确保调用鉴权成功，否则忽略鉴权\n- 戴口罩、戴墨镜、低头看手机、背对摄像头等情形会显著降低可识别人脸数，建议在指标中标注 `face_detected_count` 以便解读\n- 短时局部表情（如顾客接电话短暂皱眉）不应单独触发负面预警，建议使用时间窗均值\n- 最小样本保护：`face_detected_count < 5` 时输出 `insufficient_sample`，**禁止**发布群体指数\n- 红线约束：**禁止**人脸识别 / 人脸比对 / 身份绑定 / 跨摄像头跟踪；**禁止**长期存储顾客原始视频或人脸特征向量；**禁止**将群体情绪用于针对个体顾客的差异化定价或服务歧视\n- 合规要点：部署场所必须以**显著标识**告知公众使用了匿名情绪分析摄像头，并提供咨询联系方式；数据保存期限建议 ≤ 30 天，仅保留聚合指标\n- 安全预警仅作为人工值守的辅助参考，**禁止**单纯依据情绪指数自动触发警报或干预\n- 禁止临时生成脚本，只能用技能本身的脚本\n- 传入的网络地址参数，不需要下载本地，默认地址都是公网地址，api 服务会自动下载\n- 当显示历史分析报告清单的时候，从接口返回 json 数据中提取字段 reportImageUrl 作为超链接地址，且自动转化为如下 Markdown\n  表格格式输出，包含\"\n  报告名称\"、\"情绪指数/场所/主要建议\"、\"分析时间\"、\"点击查看\"四列，其中\"报告名称\"列使用`群体情绪指数报告-{记录id}`形式拼接, \"点击查看\"\n  列使用\n  `[🔗 查看报告](reportImageUrl)`\n  格式的超链接，用户点击即可直接跳转到对应的完整报告页面。\n- 表格输出示例：\n  | 报告名称 | 情绪指数/场所/主要建议 | 分析时间 | 点击查看 |\n  |----------|----------|----------|----------|\n  | 群体情绪指数报告-20260312172200001 | 58 (neutral) / mall / 收银区烦躁 32% 建议加开收银台 | 2026-03-12 17:22:00 | [🔗 查看报告](https://example.com/report?id=xxx) |\n\n## 使用示例\n\n```bash\n# 分析本地公共场所视频（以下只是示例，禁止直接使用openclaw-control-ui 作为 open-id）\npython -m scripts.smyx_public_place_group_emotion_index_analysis --input /path/to/mall.mp4 --open-id your-open-id\n\n# 分析网络公共场所视频（以下只是示例，禁止直接使用openclaw-control-ui 作为 open-id）\npython -m scripts.smyx_public_place_group_emotion_index_analysis --url https://example.com/mall.mp4 --open-id your-open-id\n\n# 显示历史公共场所群体情绪指数报告（自动触发关键词：查看群体情绪历史报告、群体情绪指数报告清单等）\npython -m scripts.smyx_public_place_group_emotion_index_analysis --list --open-id your-open-id\n\n# 输出精简报告\npython -m scripts.smyx_public_place_group_emotion_index_analysis --input mall.mp4 --open-id your-open-id --detail basic\n\n# 保存结果到文件\npython -m scripts.smyx_public_place_group_emotion_index_analysis --input mall.mp4 --open-id your-open-id --output result.json\n```\n\nFile v1.0.5:_meta.json\n\n{\n  \"ownerId\": \"kn7e2caqj7pnsvr9r7t8zenghs83xw7n\",\n  \"slug\": \"smyx-public-place-group-emotion-index-analysis\",\n  \"version\": \"1.0.5\",\n  \"publishedAt\": 1783356039140\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_PUBLIC_PLACE_GROUP_EMOTION_INDEX_ANALYSIS` - 公共场所群体情绪指数（展览/商场）\n\n## 输入约束\n\n- 摄像头：商场出入口 / 收银区 / 主动线 / 展厅 / 候机厅 / 售票处等公共场所高位固定摄像头，能拍到顾客**正面或斜侧脸**\n- 帧率 ≥ 5 FPS（推荐 10 FPS）；分辨率 ≥ 720p；光照稳定避免逆光\n- 视频时长建议 ≥ 10 分钟，覆盖完整客流时段，过短样本无法稳定计算群体指数\n- ROI 标定：可按区域划分多个子区域（如入口 / 收银 / 展品 A / 展品 B）以输出区域级情绪指数\n- 多视角部署时建议每个区域至少 1 路摄像头\n- **强匿名约束**：仅做匿名表情聚合统计，**禁止**人脸识别 / 人脸比对 / 身份绑定 / 跨摄像头跟踪\n\n## 关键观测信号\n\n- `face_detected_count` - 当前帧检测到的人脸数\n- `emotion_distribution` - 6 类情绪分布（happy / calm / irritated / surprised / sad / fearful 占比）\n- `positive_ratio` - 积极情绪占比（happy + calm）\n- `negative_ratio` - 消极情绪占比（irritated + sad + fearful）\n- `irritation_ratio` - 烦躁情绪占比（**安全预警关键指标**）\n- `group_emotion_index` - 群体情绪指数（0-100，数值越高代表群体情绪越积极）\n- `crowd_density_estimate` - 人群密度估计（参考指标，与烦躁占比联合判定）\n- `dwell_time_estimate_sec` - 平均停留时长估计（展品/区域吸引力参考）\n\n## 阈值与等级\n\n- `≥ 70` - 群体情绪积极（positive）\n- `50-69` - 群体情绪平稳（neutral）\n- `30-49` - 群体情绪低落（low）→ 建议优化服务\n- `< 30` 或 `irritation_ratio > 25%` - 群体情绪偏负面（negative）→ 推送运营优化或安全预警\n- 最小样本保护：`face_detected_count < 5` 时输出 `insufficient_sample`，不发布群体指数\n\n## 输出字段（参考）\n\n- `time_window` / `place_type`（mall / exhibition / scenic_area / airport / museum / theme_park / other）\n- `face_detected_count` / `crowd_density_estimate` / `dwell_time_estimate_sec`\n- `emotion_distribution` / `positive_ratio` / `negative_ratio` / `irritation_ratio`\n- `group_emotion_index` / `emotion_level` (positive / neutral / low / negative)\n- `region_breakdown` - 区域级情绪指数数组（[{region_name, group_emotion_index, irritation_ratio, ...}]）\n- `trend_vs_last_window` - 与上一时间窗变化（delta_pct）\n- `alert_type` - 提醒类型（operation_optimize / safety_warning / improving / normal）\n- `alert_level` - 提醒级别（info / notice / warning）\n- `operation_suggestion` - 运营建议（如\"收银区烦躁占比 32%、平均停留 4 分钟，建议增开 1 个收银台\"）\n- `safety_suggestion` - 安全建议（如\"入口区域烦躁占比 38% 且密度偏高，建议增派 1 名安保安抚分流\"）\n- `emotion_heatmap_image_url` - 情绪指数区域热力图 URL（伪彩色叠加在场景平面图）\n\n## 强制约束与红线\n\n- ❌ **禁止**进行人脸识别 / 人脸比对 / 顾客身份绑定 / 跨摄像头身份跟踪\n- ❌ **禁止**长期存储顾客原始视频或可识别人脸特征向量\n- ❌ **禁止**将群体情绪结果用于针对个体顾客的差异化定价或服务歧视\n- ✅ 仅输出**区域级匿名聚合**指标，作为运营优化与安全预警辅助参考\n- ✅ 部署场所必须以**显著标识**告知公众使用了匿名情绪分析摄像头，并提供咨询联系方式\n- ✅ 数据保存期限建议 ≤ 30 天，仅保留聚合指标，不保留原始视频\n\n> 仅输出基于视觉的群体情绪聚合统计与运营/安全辅助参考，**不构成对任何个体顾客的情绪诊断或行为评价**；任何针对个体的服务调整必须经过当事人本人主动反馈与同意。\n\nFile v1.0.5:skills/smyx_analysis/references/api_doc.md\n\n# API接口文档\n\n## 接口地址\n\n`POST https://your-api-server.com/api/v1/common-analysis`\n\n## 请求头\n\n| 字段           | 必选 | 说明                            |\n|--------------|----|-------------------------------|\n| X-API-Key    | 是  | API访问密钥                       |\n| Content-Type | 是  | 文件上传或 application/json（URL模式） |\n\n## 请求参数\n\n### 1. 文件上传模式\n\n| 字段           | 类型     | 必选 | 说明                                    |\n|--------------|--------|----|---------------------------------------|\n| video        | file   | 是  | MP4视频文件                               |\n| detail_level | string | 否  | 输出详细程度：basic/standard/full，默认standard |\n\n### 2. URL模式\n\n| 字段           | 类型     | 必选 | 说明                                    |\n|--------------|--------|----|---------------------------------------|\n| video_url    | string | 是  | 可公开访问的视频URL                           |\n| detail_level | string | 否  | 输出详细程度：basic/standard/full，默认standard |\n\n## 响应格式\n\n```json\n{\n  \"code\": 200,\n  \"message\": \"success\",\n  \"data\": {\n    \"analysis_time\": \"2026-03-10 15:30:00\",\n    \"face_detection\": {\n      \"status\": \"success\",\n      \"face_count\": 1,\n      \"quality_score\": 95\n    },\n    \"diagnosis\": {\n      \"overall_constitution\": \"平和质\",\n      \"organ_condition\": {\n        \"liver\": \"正常\",\n        \"heart\": \"轻微火旺\",\n        \"spleen\": \"略虚\",\n        \"lung\": \"正常\",\n        \"kidney\": \"正常\"\n      },\n      \"color_analysis\": {\n        \"complexion\": \"微黄\",\n        \"correspondence\": \"脾胃功能略弱\"\n      }\n    },\n    \"health_warnings\": [\n      \"注意休息，避免熬夜\"\n    ],\n    \"suggestions\": [\n      \"饮食清淡，减少辛辣食物摄入\"\n    ]\n  }\n}\n```\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\nenv: prod\n\nApiEnum:\n  api-key:\n  api-secret-key:\n  database-url:\n  base-url-open-api: \"https://open.lifeemergence.com/smyx-open-api\"\n  base-url-open-h5: \"http://livemonitor.lifeemergence.com\"\n  base-url-health: \"https://lifeemergence.com/jeecg-boot-xzgz\"\n\nConstantEnum:\n  is-debug: false\n  app--id: x1a3s4nwy1s2r4se\n  current--tentant-code: \"XIAN_ZHAO_GAN_ZHI\"\n  feishu-app--id: cli_a93d769369badcb1\n  feishu-app--secret:\n  default--skill-platform-name: ARK_CLAW\n\nFile v1.0.5:skill-card.md\n\n## Description: <br>\nAnalyzes authorized fixed-camera video from public venues to produce anonymous, aggregate emotion distributions, a 0-100 group-emotion index, regional breakdowns, and operations or safety guidance. <br>\n\nThis skill is ready for commercial/non-commercial use. <br>\n\n## Publisher: <br>\n[18072937735](https://clawhub.ai/user/18072937735) <br>\n\n### License/Terms of Use: <br>\nMIT-0 <br>\n\n\n## Use Case: <br>\nExternal developers, venue operators, and operations or safety teams use this skill to analyze public-place video they are authorized to process and receive aggregate crowd-emotion reports. The reports support service-layout optimization, exhibit or venue satisfaction review, and human-reviewed safety triage. <br>\n\n### Deployment Geography for Use: <br>\nGlobal <br>\n\n## Known Risks and Mitigations: <br>\nRisk: The security review flags the release as suspicious because it under-discloses identity, account, token, and report-history handling for a sensitive public-camera use case. <br>\nMitigation: Install only after confirming the publisher's retention, deletion, access-control, account, and token-handling practices are acceptable for the deployment. <br>\nRisk: The skill sends public-camera footage and a user identifier, potentially a phone number, to the LifeEmergence backend. <br>\nMitigation: Use only footage the operator is authorized to analyze, provide public notice or consent where applicable, and avoid phone numbers as open-id unless handling terms are documented. <br>\nRisk: Group-emotion outputs can be misused for individual profiling or automated intervention. <br>\nMitigation: Limit use to aggregate operational insight and human-reviewed safety triage; do not use the output for individual diagnosis, differential pricing, service discrimination, or automatic enforcement. <br>\n\n\n## Reference(s): <br>\n- [Public Place Group Emotion Index API Documentation](artifact/references/api_doc.md) <br>\n- [ClawHub Skill Page](https://clawhub.ai/18072937735/skills/smyx-public-place-group-emotion-index-analysis) <br>\n\n\n## Skill Output: <br>\n**Output Type(s):** [Text, Markdown, JSON, Shell commands, Configuration, Guidance] <br>\n**Output Format:** [Markdown tables and structured JSON-like analysis summaries] <br>\n**Output Parameters:** [1D] <br>\n**Other Properties Related to Output:** [May include report links, emotion distributions, group-emotion index values, regional breakdowns, operation suggestions, safety suggestions, and heatmap image URLs.] <br>\n\n## Skill Version(s): <br>\n1.0.5 (source: server release evidence) <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, 42479 bytes\n\nFiles: references/api_doc.md (4507b), scripts/__init__.py (71b), scripts/config.py (710b), scripts/config.yaml (3b), scripts/skill.py (598b), scripts/smyx_public_place_group_emotion_index_analysis.py (3673b), skill-card.md (2889b), SKILL.md (14299b), 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)...","readmeExcerpt":"Skill: Public Place Group Emotion Index (Exhibition / Mall) | 公共场所群体情绪指数（展览/商场） Owner: 18072937735 Summary: Using fixed cameras in malls, exhibition halls, scenic areas and other public places, the system analyzes facial expressions of multiple people in the scene in real time (with anonymized expression recognition only), aggregates the distribution of emotions (happy, calm, irritated, surprised, sad, fearful, etc.)","codeSnippets":[],"executableExamples":[{"language":"bash","snippet":"python -m scripts.smyx_public_place_group_emotion_index_analysis --list"},{"language":"text","snippet":"requests>=2.28.0"},{"language":"bash","snippet":"# 分析本地公共场所视频\npython -m scripts.smyx_public_place_group_emotion_index_analysis --input /path/to/mall.mp4\n\n# 分析网络公共场所视频\npython -m scripts.smyx_public_place_group_emotion_index_analysis --url https://example.com/mall.mp4\n\n# 显示历史公共场所群体情绪指数报告（自动触发关键词：查看群体情绪历史报告、群体情绪指数报告清单等）\npython -m scripts.smyx_public_place_group_emotion_index_analysis --list\n\n# 输出精简报告\npython -m scripts.smyx_public_place_group_emotion_index_analysis --input mall.mp4 --detail basic\n\n# 保存结果到文件\npython -m scripts.smyx_public_place_group_emotion_index_analysis --input mall.mp4 --output result.json"},{"language":"bash","snippet":"python -m scripts.smyx_public_place_group_emotion_index_analysis --list"},{"language":"text","snippet":"requests>=2.28.0"},{"language":"bash","snippet":"# 分析本地公共场所视频\npython -m scripts.smyx_public_place_group_emotion_index_analysis --input /path/to/mall.mp4\n\n# 分析网络公共场所视频\npython -m scripts.smyx_public_place_group_emotion_index_analysis --url https://example.com/mall.mp4\n\n# 显示历史公共场所群体情绪指数报告（自动触发关键词：查看群体情绪历史报告、群体情绪指数报告清单等）\npython -m scripts.smyx_public_place_group_emotion_index_analysis --list\n\n# 输出精简报告\npython -m scripts.smyx_public_place_group_emotion_index_analysis --input mall.mp4 --detail basic\n\n# 保存结果到文件\npython -m scripts.smyx_public_place_group_emotion_index_analysis --input mall.mp4 --output result.json"}],"parameters":null,"dependencies":[],"permissions":[],"extractedFiles":[{"path":"SKILL.md","content":"---\nname: \"smyx-public-place-group-emotion-index-analysis\"\ndescription: \"Using fixed cameras in malls, exhibition halls, scenic areas and other public places, the system analyzes facial expressions of multiple people in the scene in real time (with anonymized expression recognition only), aggregates the distribution of emotions (happy, calm, irritated, surprised, sad, fearful, etc.), and computes an overall group-emotion index (0-100; higher = more positive). | 通过商场、展览馆、景区等公共场所的固定摄像头，实时分析场景中多人的面部表情（使用匿名化表情识别），统计各类情绪（愉悦、平静、烦躁、惊讶、悲伤等）的分布比例，计算整体情绪指数（0-100，数值越高代表群体情绪越积极）。该技能可帮助运营方了解顾客满意度、优化服务布局，或用于公共安全预警（如烦躁情绪比例过高可能预示冲突风险）。\"\nversion: \"1.0.17\"\nlicense: \"MIT-0\"\n---\n\n# 👥 Public Place Group Emotion Index (Exhibition / Mall) | 公共场所群体情绪指数（展览/商场）\n> **智能分析中枢** · 图片/视频智能分析 · 结构化报告 · 历史报告云端查询\n\n---\n\n## 🧭 技能概览 | Overview\n\n| 模块 | 内容 |\n|---|---|\n| 🏷️ 技能名称 | **公共场所群体情绪指数（展览/商场）** |\n| 🎯 核心目标 | 通过商场、展览馆、景区等公共场所的固定摄像头，实时分析场景中多人的面部表情（使用匿名化表情识别），统计各类情绪（愉悦、平静、烦躁、惊讶、悲伤等）的分布比例，计算整体情绪指数（0-100，数值越高代表群体情绪越积极）。该技能可帮助运营方了解顾客满意度、优化服务布局，或用于公共安全预警（如烦躁情绪比例过高可能预示冲突风险）。 |\n| 🖼️ 输入类型 | 图片、视频、本地文件、网络 URL |\n| 📝 输出能力 | 结构化分析报告、识别/监测结果、建议与报告链接 |\n| 🧩 场景码 | `SMYX_PUBLIC_PLACE_GROUP_EMOTION_INDEX_ANALYSIS` |\n\nUsing fixed cameras in malls, exhibition halls, scenic areas and other public places, the system analyzes facial expressions of multiple people in the scene in real time (with anonymized expression recognition only), aggregates the distribution of emotions (happy, calm, irritated, surprised, sad, fearful, etc.), and computes an overall group-emotion index (0-100; higher = more positive). This skill helps operators understand customer satisfaction, optimize service layout, or trigger public-safety warnings (e.g., a high irritation ratio may indicate conflict risk). Application scenarios: shopping malls, exhibition halls, museums, theme parks, airport waiting halls. The system periodically generates group-emotion reports to support management decisions. Skill features: understanding customer emotions enables malls to promptly adjust services (e.g., open more checkouts, improve air conditioning, optimize traffic flow) and boost satisfaction; for exhibitions, it assesses exhibit appeal; for public safety, it warns against group irritation that may escalate into conflict. AI anonymous analysis delivers valuable insights while protecting privacy and is an essential capability of smart malls and smart scenic areas. Can be integrated into existing security systems or business-analytics platforms.\n\n通过商场、展览馆、景区等公共场所的固定摄像头，实时分析场景中多人的面部表情（使用匿名化表情识别），统计各类情绪（愉悦、平静、烦躁、惊讶、悲伤等）的分布比例，计算整体情绪指数（0-100，数值越高代表群体情绪越积极）。该技能可帮助运营方了解顾客满意度、优化服务布局，或用于公共安全预警（如烦躁情绪比例过高可能预示冲突风险）。应用场景：购物中心、展览馆、博物馆、主题公园、机场候机厅。系统定期生成群体情绪报告，辅助管理决策。技能特点：了解顾客情绪能帮助商场及时调整服务（如增加收银台、改善空调、优化动线），提升满意度；对展览馆可评估展品吸引力；对公共安全可预警群体暴躁可能引发的冲突。通过AI匿名分析，在保护隐私的前提下获取有价值的数据洞察，是智慧商场、智慧景区的重要功能。该技能可集成到现有安防系统或商业分析平台中。\n\n## 🤖 AI 角色 | AI Role\n| 角色要点 | 说明 |\n|---|---|\n| 说明 1 | **假设你是一个专业的公共场所群体情绪分析 AI。你的任务是分析固定摄像头的视频，检测画面中多个人的面部表情（匿名化处理，不识别个人身份），统计各类情绪（愉悦、平静、烦躁、"},{"path":"_meta.json","content":"{\n  \"ownerId\": \"kn7e2caqj7pnsvr9r7t8zenghs83xw7n\",\n  \"slug\": \"smyx-public-place-group-emotion-index-analysis\",\n  \"version\": \"1.0.13\",\n  \"publishedAt\": 1791047425773\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_PUBLIC_PLACE_GROUP_EMOTION_INDEX_ANALYSIS` - 公共场所群体情绪指数（展览/商场）\n\n## 输入约束\n\n- 摄像头：商场出入口 / 收银区 / 主动线 / 展厅 / 候机厅 / 售票处等公共场所高位固定摄像头，能拍到顾客**正面或斜侧脸**\n- 帧率 ≥ 5 FPS（推荐 10 FPS）；分辨率 ≥ 720p；光照稳定避免逆光\n- 视频时长建议 ≥ 10 分钟，覆盖完整客流时段，过短样本无法稳定计算群体指数\n- ROI 标定：可按区域划分多个子区域（如入口 / 收银 / 展品 A / 展品 B）以输出区域级情绪指数\n- 多视角部署时建议每个区域至少 1 路摄像头\n- **强匿名约束**：仅做匿名表情聚合统计，**禁止**人脸识别 / 人脸比对 / 身份绑定 / 跨摄像头跟踪\n\n## 关键观测信号\n\n- `face_detected_count` - 当前帧检测到的人脸数\n- `emotion_distribution` - 6 类情绪分布（happy / calm / irritated / surprised / sad / fearful 占比）\n- `positive_ratio` - 积极情绪占比（happy + calm）\n- `negative_ratio` - 消极情绪占比（irritated + sad + fearful）\n- `irritation_ratio` - 烦躁情绪占比（**安全预警关键指标**）\n- `group_emotion_index` - 群体情绪指数（0-100，数值越高代表群体情绪越积极）\n- `crowd_density_estimate` - 人群密度估计（参考指标，与烦躁占比联合判定）\n- `dwell_time_estimate_sec` - 平均停留时长估计（展品/区域吸引力参考）\n\n## 阈值与等级\n\n- `≥ 70` - 群体情绪积极（positive）\n- `50-69` - 群体情绪平稳（neutral）\n- `30-49` - 群体情绪低落（low）→ 建议优化服务\n- `< 30` 或 `irritation_ratio > 25%` - 群体情绪偏负面（negative）→ 推送运营优化或安全预警\n- 最小样本保护：`face_detected_count < 5` 时输出 `insufficient_sample`，不发布群体指数\n\n## 输出字段（参考）\n\n- `time_window` / `place_type`（mall / exhibition / scenic_area / airport / museum / theme_park / other）\n- `face_detected_count` / `crowd_density_estimate` / `dwell_time_estimate_sec`\n- `emotion_distribution` / `positive_ratio` / `negative_ratio` / `irritation_ratio`\n- `group_emotion_index` / `emotion_level` (positive / neutral / low / negative)\n- `region_breakdown` - 区域级情绪指数数组（[{region_name, group_emotion_index, irritation_ratio, ...}]）\n- `trend_vs_last_window` - 与上一时间窗变化（delta_pct）\n- `alert_type` - 提醒类型（operation_optimize / safety_warning / improving / normal）\n- `alert_level` - 提醒级别（info / notice / warning）\n- `operation_suggestion` - 运营建议（如\"收银区烦躁占比 32%、平均停留 4 分钟，建议增开 1 个收银台\"）\n- `safety_suggestion` - 安全建议（如\"入口区域烦躁占比 38% 且密度偏高，建议增派 1 名安保安抚分流\"）\n- `emotion_heatmap_image_url` - 情绪指数区域热力图 URL（伪彩色叠加在场景平面图）\n\n## 强制约束与红线\n\n- ❌ **禁止**进行人脸识别 / 人脸比对 / 顾客身份绑定 / 跨摄像头身份跟踪\n- ❌ **禁止**长期存储顾客原始视频或可识别人脸特征向量\n- ❌ **禁止**将群体情绪结果用于针对个体顾客的差异化定价或服务歧视\n- ✅ 仅输出**区域级匿名聚合**指标，作为运营优化与安全预警辅助参考\n- ✅ 部署场所必须以**显著标识**告知公众使用了匿名情绪分析摄像头，并提供咨询联系方式\n- ✅ 数据保存期限建议 ≤ 30 天，仅保留聚合指标，不保留原始视频\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":"Using fixed cameras in malls, exhibition halls, scenic areas and other public places, the system analyzes facial expressions of multiple people in the scene in real time (with anonymized expression recognition only), aggregates the distribution of emotions (happy, calm, irritated, surprised, sad, fearful, etc.), and computes an overall group-emotion index (0-100; higher = more positive). | 通过商场、展览馆、景区等公共场所的固定摄像头，实时分析场景中多人的面部表情（使用匿名化表情识别），统计各类情绪（愉悦、平静、烦躁、惊讶、悲伤等）的分布比例，计算整体情绪指数（0-100，数值越高代表群体情绪越积极）。该技能可帮助运营方了解顾客满意度、优化服务布局，或用于公共安全预警（如烦躁情绪比例过高可能预示冲突风险）。 Skill: Public Place Group Emotion Index (Exhibition / Mall) | 公共场所群体情绪指数（展览/商场） Owner: 18072937735 Summary: Using fixed cameras in malls, exhibition halls, scenic areas and other public places, the system analyzes facial expressions of multiple people in the scene in real time (with anonymized expression recognition only), aggregates the distribution of emotions (happy, calm, irritated, surprised, sad, fearful, etc.)","editorialQuality":{"score":100,"threshold":65,"status":"ready","wordCount":1229,"uniquenessScore":45,"reasons":[]}},"media":{"evidence":{"source":"no-media","verified":false,"confidence":"low","updatedAt":"2026-10-10T01:33:08.012Z","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-10T01:33:08.012Z","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-10T08:57:46.371Z","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"}]}}}