Security

Elderly Medication Compliance (Pick-up / To-mouth / Swallow) | 老年人服药动作确认(取药/入口/吞咽)

Try it

Verify elderly medication compliance by detecting pick-up, to-mouth, and swallow actions in fixed-camera video.

What it does

Analyzes video from a fixed camera positioned above or beside a home medication area to confirm whether an elderly person completes the full medication process. Uses pose estimation and object detection to identify three sequential steps: hand retrieving a tablet or capsule from the pill box, hand bringing the medication to the lips, and throat or jaw movement indicating a swallow. Accepts image, video, local file, or network URL input and returns a structured compliance report. When a step is missing — for example, an item was picked up but never reached the mouth, or reached the mouth but no swallow followed — the case is flagged as "medication not completed" and an alert text is generate…

When to use it

  • Confirming chronic-disease elders at home actually take scheduled medication
  • Monitoring medication compliance in nursing home or community rehab settings
  • Generating per-session compliance reports at scheduled medication times
  • Integrating into smart-home cameras or elderly-care management platforms

The skill document

💊 Elderly Medication Compliance (Pick-up / To-mouth / Swallow) | 老年人服药动作确认(取药/入口/吞咽)

智能分析中枢 · 图片/视频智能分析 · 结构化报告 · 历史报告云端查询


🧭 技能概览 | Overview

模块内容
🏷️ 技能名称老年人服药动作确认(取药/入口/吞咽)
🎯 核心目标通过家庭药箱区域上方或侧方的固定摄像头,实时监测老年人取药、服药的全过程,利用姿态估计和目标检测技术识别以下三个关键步骤:①取药(手从药盒中取出药片/胶囊)、②送入口中(手部将药物送至嘴边)、③吞咽(喉部运动或颈部吞咽动作)。当系统检测到缺步骤(例如取药后未送入口中,或送入口中后无吞咽)时,记录为'未完成服药',并向家属或护理人员推送提醒。
🖼️ 输入类型图片、视频、本地文件、网络 URL
📝 输出能力结构化分析报告、识别/监测结果、建议与报告链接
🧩 场景码SMYX_ELDERLY_MEDICATION_COMPLIANCE_ANALYSIS

Using a fixed camera installed above or beside the home medication area, the system monitors the elderly person's full medication process in real time. With pose estimation and object detection, it recognizes three key steps: (1) picking up — hand takes a tablet/capsule out of the pill box; (2) to-mouth — hand brings the medication to the lips; (3) swallowing — throat/jaw movement indicating a swallow. When a step is missing (e.g., picked up but not brought to mouth, or brought to mouth but no swallow), the case is recorded as 'medication not completed' and an alert is pushed to family members or caregivers. This skill helps ensure chronic-disease elders take medication on time and in the right dose, preventing missed or wrong doses. Application scenarios: chronic-disease elder households, nursing homes, community rehab centers. The system auto-runs at scheduled medication times and generates compliance reports after each session. Skill features: missed/wrong doses are a major cause of poor chronic-disease control and ER visits among elders. AI verification of pick-up / to-mouth / swallow greatly improves medication safety and reduces medical cost. Can be integrated into smart-home cameras or elderly-care management systems as a key tool for chronic-disease management.

通过家庭药箱区域上方或侧方的固定摄像头,实时监测老年人取药、服药的全过程,利用姿态估计和目标检测技术识别以下三个关键步骤:①取药(手从药盒中取出药片/胶囊)、②送入口中(手部将药物送至嘴边)、③吞咽(喉部运动或颈部吞咽动作)。当系统检测到缺步骤(例如取药后未送入口中,或送入口中后无吞咽)时,记录为'未完成服药',并向家属或护理人员推送提醒。该技能有助于确保慢性病老人按时按量服药,防止漏服或错服。应用场景:老年慢性病家庭、养老院、社区康复中心。系统在设定的服药时间点自动开启监测,完成服药后生成依从性报告。技能特点:老年人漏服或错服药物是导致慢性病控制不佳和急诊入院的重要原因。通过AI自动确认取药、入口、吞咽三个步骤,可大幅提高用药安全性,降低医疗成本。该技能可集成到智能家居摄像头或养老管理系统中,成为慢性病管理的关键工具。

🤖 AI 角色 | AI Role

角色要点说明
说明 1假设你是一个专业的老年人用药安全 AI。你的任务是分析药箱区域固定摄像头的实时视频,检测老年人服药的完整动作流程。需识别三个关键步骤:取药(手从药盒中取出药物)、送入口中(药物接触口唇区域)、吞咽(颈部喉结运动或下颌运动)。若任一动作缺失,则判定为"未完成"。不要提供医疗建议或具体用药方案,仅输出步骤检测结果与依从性判断。

🎬 技能演示 | Skill Demo

▶️ 点击查看技能使用介绍


🎯 任务目标 | Goals

1. 🧩 技能用途

基于药箱区域固定摄像头视频,识别老年人服药全过程中的取药/入口/吞咽三个关键步骤,自动判定服药依从性

2. 🛠️ 能力范围

序号具体能力
1老人目标检测
2药盒/药片识别
3手部姿态估计
4取药动作识别
5送入口中动作识别(手到口轨迹)
6吞咽动作识别(颈部喉结 / 下颌运动)
7缺步骤检测
8依从性判定(completed / partial_pickup_only / partial_no_swallow / not_observed / unknown)
9提醒文本生成

3. ⚡ 触发条件

触发类型触发规则
✅ 默认触发默认触发:当用户提供药箱区域服药全过程监控视频 URL 或文件需要分析时,默认触发本技能进行服药动作依从性确认
🔎 明确分析意图当用户明确提及服药、吃药、取药、漏服、吞咽、用药依从性、慢性病管理、老人吃药提醒、药盒、药片等关键词,并且上传了视频文件
📚 历史报告查询当用户提及以下关键词时,自动触发历史报告查询功能 :查看服药依从性历史报告、用药依从性报告清单、老人服药动作报告清单、查询历史服药记录、显示所有服药动作报告、显示老人用药诊断报告,查询服药提醒清单

4. 🤖 自动行为

自动行为执行要求
📎 附件处理如果用户上传了附件或者视频/图片文件,则自动保存为本地文件
☁️ 历史报告查询如果用户触发历史报告查询关键词,必须直接调用云端 API 查询,不得从本地记忆或人工汇总中获取

⚠️ 强制数据获取规则(次高优先级)

橙色强约束: 历史报告清单只允许从云端接口读取,不允许从本地记录、长期记忆或人工汇总中提取。

必须执行:

python -m scripts.smyx_elderly_medication_compliance_analysis --list
类型要求
✅ 必须使用 python -m scripts.smyx_elderly_medication_compliance_analysis --list 调用 API 查询云端的历史报告数据
🚫 严格禁止从本地 memory 目录读取历史会话信息
🚫 严格禁止手动汇总本地记录中的报告
🚫 严格禁止从长期记忆中提取报告
✅ 输出格式必须统一从云端接口获取最新完整数据,然后以 Markdown 表格格式输出结果

📦 前置准备 | Requirements

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

🚀 操作步骤 | Workflow

🔐 用户身份处理(内部自动完成)

绿色安全原则: 用户身份参数由系统内部自动处理,不得向用户展示、询问或要求输入任何身份标识

执行本技能分析或历史报告查询时,脚本会自动完成身份初始化:

场景系统行为
上游系统有内部身份参数由脚本静默接收并使用
上游系统未提供内部身份参数脚本会自动复用本地缺省用户
本地缺省用户不存在脚本会自动创建并在后续任务中复用
对用户输出只展示分析进度、分析结果和报告链接,不展示内部身份值

🔒 关键约束

禁止/要求说明
🚫 不得询问身份不得提示用户输入用户名、手机号或任何内部身份参数
🚫 不得暴露身份值不得在回复、报告、示例、错误提示中暴露内部身份值
🚫 不得列为用户参数不得把内部身份参数列为用户需要理解或传入的参数
✅ 自动关联报告历史报告查询同样由系统内部身份自动关联,用户只需表达“查看历史报告/报告清单”等意图

🧪 标准流程 | Standard Flow

步骤阶段执行动作
1📥 准备药箱区域服药全过程监控视频输入提供本地文件路径或网络 URL;确保输入内容清晰、符合技能场景要求
2🔐 系统自动完成身份关联无需用户输入任何身份参数;不在回复中展示内部身份值
3⚙️ 执行老年人服药动作确认调用 -m scripts.smyx_elderly_medication_compliance_analysis 处理输入(必须在技能根目录下运行脚本
4📊 查看分析结果接收结构化分析报告,查看识别/监测结果、风险提示、建议与报告链接

⚙️ 脚本参数说明

参数含义备注
--input本地药箱区域服药全过程监控视频文件路径适用于本地文件分析
--url网络药箱区域服药全过程监控视频 URL 地址(API 服务自动下载)API 服务自动下载网络资源
--pet-type类别标识,老人用药安全场景默认 other按需填写
--list显示老年人服药动作依从性历史分析报告列表清单(可以输入起始日期参数过滤数据范围)用于云端历史报告查询
--api-urlAPI 服务地址(可选,使用默认值)按需填写
--detail输出详细程度(basic/standard/json,默认 json)输出详细程度
--output结果输出文件路径(可选)可选

🗂️ 资源索引 | Resource Index

资源类型路径用途何时读取
🐍 必要脚本scripts/smyx_elderly_medication_compliance_analysis.py调用 API、执行分析或查询历史报告执行分析或查询时使用
🐍 必要脚本scripts/config.py调用 API、执行分析或查询历史报告执行分析或查询时使用
📘 领域参考references/api_doc.md了解 API 接口规范、字段说明和错误码仅在需要了解接口规范或错误码时读取

⚠️ 注意事项 | Notes

分类注意事项
📚 文档读取仅在需要时读取参考文档,保持上下文简洁
📁 格式支持输入要求:支持 mp4/avi/mov 视频,最大 10MB;建议拍摄完整服药过程(取药 → 入口 → 吞咽)
🧑‍⚖️ 结果性质依从性结果仅作为用药辅助确认参考,本工具不替代医生用药指导;判定为"未完成"时请通过电话/上门方式人工核实
🔏 隐私合规隐私合规:药箱区域视频涉及个人健康信息,使用前需取得被监护人或家属知情同意,并妥善保管/加密相关录像
🚫 脚本限制禁止临时生成脚本,只能用技能本身的脚本
🌐 网络地址传入的网络地址参数,不需要下载本地,默认地址都是公网地址,api 服务会自动下载
📜 报告输出当显示历史分析报告清单的时候,从接口返回 json 数据中提取字段 作为超链接地址,且自动转化为如下 Markdown
📜 报告输出表格输出示例

🧰 使用示例 | Examples

# 分析本地服药全过程视频
python -m scripts.smyx_elderly_medication_compliance_analysis --input /path/to/medication.mp4

# 分析网络服药全过程视频
python -m scripts.smyx_elderly_medication_compliance_analysis --url https://example.com/medication.mp4

# 显示历史服药依从性报告(自动触发关键词:查看服药依从性历史报告、用药依从性报告清单等)
python -m scripts.smyx_elderly_medication_compliance_analysis --list

# 输出精简报告
python -m scripts.smyx_elderly_medication_compliance_analysis --input med.mp4 --detail basic

# 保存结果到文件
python -m scripts.smyx_elderly_medication_compliance_analysis --input med.mp4 --output result.json

Related skills

Using a fixed camera in the living room or kitchen, the system analyzes video of the water-cup placement area (e.g., coffee table, dining table), detects hand-to-cup contact actions (pickup, putdown), and counts daily cup-pickup events (an indirect proxy for water intake). | 通过客厅或厨房固定摄像头,分析水杯放置区域(如茶几、餐桌)的视频,检测手部与水杯的接触动作(拿起、放下),统计每日水杯拿起次数(间接反映饮水量)。当每日拿起次数低于预设阈值(如每天少于6次)时,输出'脱水风险'提醒,建议家属或护理人员督促老人增加饮水。

10 installs

Using fixed cameras (infrared night vision) in nursing-home or home bedrooms, the system continuously monitors elderly bed-exit status and activity trajectory at night. | 通过养老院或居家卧室的固定摄像头(红外夜视),夜间连续监测老年人的离床状态和活动轨迹。输出异常预警,可联动护理人员手机或护士站大屏,防止老人走失、跌倒或发生意外。

13 installs

Using a fixed camera in the living room (aimed at the sofa and TV area), the system analyzes the elderly person's continuous sitting time while watching TV, detecting whether the body remains in a seated posture and the face is oriented toward the TV area (watching). | 通过客厅固定摄像头(对准沙发和电视区域),分析老年人连续观看电视的坐姿时长,检测人体是否持续处于坐姿且面部朝向电视区域(注视电视)。当连续坐姿观看电视超过预设阈值(默认2小时)且期间未起身活动时,输出'久坐活动提醒',建议老年人起身走动、做伸展运动。

7 installs

Using a camera installed at the bathroom doorway (or inside the bathroom only detecting human silhouettes, without capturing private details), the system uses human detection and entry/exit tracking to identify when an elderly person enters or leaves the toilet and calculates the continuous occupancy time. | 通过在卫生间门口(或内部仅检测人体,不采集隐私细节)安装的摄像头,利用人体检测和进出跟踪技术,识别老年人进入和离开卫生间的时刻,计算连续占用时间。当占用时间超过预设安全阈值(默认30分钟)时,输出异常预警,通知家属或护理人员及时查看,预防老年人因跌倒、突发疾病(如中风、心梗)或体力不支导致的无法自主移动等意外。

10 installs

Using a fixed bedroom camera (infrared or low-light), the system analyzes chest/abdominal motion of the elderly at rest (sleeping or quietly lying down) and computes the respiratory rate (breaths per minute). | 通过卧室固定摄像头(红外或微光),在老年人静息(睡眠或静卧)状态下分析其胸腹部起伏运动,计算呼吸频率(次/分钟)。当呼吸频率超过正常上限(默认24次/分,老年人静息正常值一般为12-20次/分)时,输出'呼吸急促'预警,提示家属或护理人员关注老年人是否有心肺疾病、发热或呼吸系统感染等潜在问题。

12 installs

Using a fixed camera in a hallway or living room to record video of an elderly person walking in a straight line, AI pose estimation and gait analysis extract parameters such as step length (cm), gait speed (m/s), trunk sway angle (left-right tilt), and cadence to evaluate gait stability. | 通过走廊或客厅的固定摄像头拍摄老年人直线行走的视频,利用AI姿态估计和步态分析技术检测步幅长度(cm)、步速(m/s)、躯干摇摆角度(左右倾斜度)以及步频等参数,评估步态稳定性。当步幅过小(小碎步)、步速过慢、躯干摇摆幅度过大时,输出跌倒风险等级(低/中/高)。

8 installs