← 返回 Skills 市场
13681882136

Kami Fall Detection

作者 KamiVision · GitHub ↗ · v1.0.1 · MIT-0
linux ⚠ suspicious
30
总下载
0
收藏
0
当前安装
2
版本数
在 OpenClaw 中安装
/install kami-fall-detection
功能描述
Detect fall events from RTSP camera streams using KamiClaw cloud API. No local GPU needed.
使用说明 (SKILL.md)

Kami Fall Detection (Cloud)

Detect fall events from RTSP camera streams using the KamiClaw cloud API. No local GPU needed — all inference runs server-side.

How it works

  1. Stage 1 — Change detection (local, CPU-only): Lightweight frame-differencing on 128×128 grayscale. Keeps a rolling pre-buffer (default 4s). When a significant temporal change is detected, triggers Stage 2.
  2. Stage 2 — KamiClaw cloud analysis: Collects post-transition frames (default 4s), resizes the clip to 360×360, writes to a temp file, and sends it to the KamiClaw API (detectType: FALL, detectSubType: SK_FALL_DETECTION). If a fall is detected, outputs a JSON alarm line and optionally saves the clip. Then resets and returns to Stage 1.
  3. Auto-reconnect: If the RTSP stream drops, the skill automatically retries connection every 5 seconds and resumes monitoring seamlessly.

API Key Setup Guide

This skill requires a KamiClaw API key to authenticate with the cloud service.

Step 1 — Register

Go to https://kamiclaw-skill.kamihome.com and create an account. Choose a plan that fits your usage.

Step 2 — Get your API key

After registration, copy your API key from the dashboard. It looks like:

sk_live_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

Step 3 — Provide your key and RTSP URL

Tell the agent your API key and RTSP URL. The agent will automatically save them to config.json.

Agent instructions:

  1. Before running this skill, read config.json and check if api_key and rtsp_url are both non-empty.
  2. If either is empty, ask the user to provide the missing value(s). Do NOT proceed until both are provided.
    • If api_key is empty: "Please provide your KamiClaw API key. Register at https://kamiclaw-skill.kamihome.com to get one."
    • If rtsp_url is empty: "Please provide your RTSP camera URL (e.g. rtsp://192.168.1.100/live/stream) or a local video file path."
  3. Also ask: "Would you like to save video clips when a fall is detected? (yes/no, default: yes)" — set save_alarm_clips to true or false accordingly.
  4. Ask about Feishu notifications: "Would you like to receive fall alarms via Feishu? (yes/no)"
    • If yes: Guide user to create a Feishu group bot and get the webhook URL
    • Fill feishu_webhook_url in config.json with the webhook URL (e.g., https://open.feishu.cn/open-apis/bot/v2/hook/xxx)
    • If no: Leave feishu_webhook_url as empty string ""
  5. Once the user provides all values, write them into config.json (read existing, merge, write back).
  6. Then run the skill.

Do NOT ask the user to manually edit config.json. Always write it for them.

Installation

bash setup.sh

This will:

  1. Detect system Python (python3python → auto-install)
  2. Create .venv/ virtual environment
  3. Install: requests, opencv-python-headless, numpy

No GPU or heavy ML libraries needed.

Running

.venv/bin/python fall_detect_cloud_skill.py \
    --rtsp_url rtsp://192.168.1.100/live/stream \
    --api_key sk_live_xxxxxxxx

Or set values in config.json and run without arguments:

.venv/bin/python fall_detect_cloud_skill.py

Configuration

All parameters are in config.json. The agent auto-fills this when the user provides values in chat.

Field Default Description
api_key "" KamiClaw API key (sent as X-API-Key header)
rtsp_url "" RTSP stream URL or path to video file
run_time 0 Max run time in seconds; 0 = unlimited
pre_seconds 4.0 Seconds buffered before transition
post_seconds 4.0 Seconds collected after transition
save_alarm_clips true Save alarm video clips to logs/clips/
feishu_webhook_url "" Feishu Bot Webhook URL for alarm notifications

Feishu Notification Setup (Webhook)

To enable automatic alarm notifications via Feishu Webhook:

Step 1: Create a Feishu Bot in your group

  1. Open your Feishu group chat
  2. Click group settings (⋮) → Add Bot
  3. Choose Custom Bot
  4. Set a name (e.g., "Fall Detection Alert")
  5. Copy the Webhook URL (format: https://open.feishu.cn/open-apis/bot/v2/hook/xxx)

Step 2: Add to config.json

{
  "feishu_webhook_url": "https://open.feishu.cn/open-apis/bot/v2/hook/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
}

Step 3: Test the notification

.venv/bin/python fall_detect_cloud_skill.py

The system will send a test message to confirm the webhook works.

Agent instructions: When configuring this skill, ask the user if they want Feishu alarm notifications. If yes, guide them to create a Feishu group bot and provide the webhook URL.

CLI args and env vars still work as overrides (priority: CLI > env > config.json > defaults).

Agent: If api_key or rtsp_url is empty in config.json, you MUST ask the user to provide both before running. Never run the skill with either field empty.

Output Format (stdout JSON)

When alarm triggers:

{
  "alarm": true,
  "type": "fall",
  "fall_type": "active_falling",
  "num_persons": 1,
  "confidence": 0.92,
  "reason": "Person collapsed from standing to floor near bed",
  "frame": 87,
  "source": "rtsp://192.168.1.100/live/stream",
  "clip": "logs/clips/alarm_fall_20260429_143201.mp4"
}

Agent: When a fall alarm is detected (alarm: true), you MUST notify the user through the connected channel (e.g. chat, Feishu, WeChat) with the alarm details, including fall_type, confidence, reason, and clip path (if available).

When no alarm (run_time reached):

{
  "alarm": false,
  "type": null,
  "detail": "Run time limit reached, no fall detected",
  "frames_processed": 3600,
  "source": "rtsp://192.168.1.100/live/stream"
}

Exit Codes

Code Meaning
0 Run time limit reached (normal exit)
1 Invalid API key, missing config, or fatal error

The skill runs continuously and prints a JSON alarm line to stdout each time a fall is detected. It does NOT stop after an alarm — it resets and keeps monitoring. Stream disconnections are handled automatically via auto-reconnect.

Logs

All logs are saved in the logs/ directory:

File Format Content
logs/app.log Human-readable General application log (rotates daily, keeps 30 days)
logs/alarms.jsonl JSON Lines Every alarm event + every clip analysis result
logs/transitions.jsonl JSON Lines Every transition detection event

alarms.jsonl format

Alarm triggered:

{"event": "alarm", "alarm": true, "type": "fall", "fall_type": "active_falling", "num_persons": 1, "confidence": 0.92, "reason": "...", "frame": 87, "source": "rtsp://..."}

Clip analyzed, no alarm:

{"event": "clip_analyzed", "frame": 120, "source": "rtsp://...", "fall_detected": false, "confidence": 0.97, "reason": "...", "_ts": "2026-04-27T14:33:15+0800"}

transitions.jsonl format

{"event": "transition", "frame": 83, "source": "rtsp://...", "_ts": "2026-04-27T14:31:58+0800"}

Analysis tips

# Count total alarms today
grep '"alarm"' logs/alarms.jsonl | grep "$(date +%Y-%m-%d)" | wc -l

# Count transitions vs alarms (false positive rate)
wc -l logs/transitions.jsonl logs/alarms.jsonl

# Extract all alarm events as CSV-friendly
cat logs/alarms.jsonl | python3 -c "
import sys, json
for line in sys.stdin:
    obj = json.loads(line)
    if obj.get('event') == 'alarm':
        print(f\"{obj['_ts']},{obj.get('type','')},{obj.get('fall_type','')},{obj.get('confidence',0)},{obj.get('frame',0)}\")
"

File Structure

kami-fall-detection-cloud/
├── SKILL.md                      # This file
├── config.json                   # All config in one place (api_key, rtsp_url, etc.)
├── fall_detect_cloud_skill.py    # Production skill entry point
├── fall_detect_cloud.py          # Development/debug version (with test mode)
├── setup.sh                      # Venv installer
├── requirements.txt              # Dependencies: requests, opencv-python-headless, numpy
安全使用建议
Before installing, confirm you trust KamiClaw with camera clips, do not provide any Qwen API key, review or remove the OpenClaw Feishu credential-reading code path, and decide whether continuous monitoring, saved clips, and local credential storage are acceptable.
能力标签
requires-oauth-tokenrequires-sensitive-credentials
能力评估
Purpose & Capability
The main camera fall-detection and Feishu webhook behavior is purpose-aligned, but feishu_notifier.py also reads local OpenClaw Feishu app credentials and setup.sh prints an unrelated '--qwen_api_key <QWEN_KEY>' run option.
Instruction Scope
SKILL.md instructs the agent to collect the KamiClaw API key, RTSP URL, optional clip-saving preference, and optional Feishu webhook, then write them into config.json before running.
Install Mechanism
The setup script creates a virtualenv and installs expected Python packages, but its final usage output asks for an unrelated Qwen key that is not part of the stated requirements.
Credentials
The skill sends selected camera clips to the KamiClaw cloud API and can send alarm messages to Feishu; this is disclosed and aligned with cloud fall detection, but it involves private video and notification data.
Persistence & Privilege
The skill stores configuration in config.json, keeps local logs/clips under logs/, and runs continuously by default until stopped or a run_time is set.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install kami-fall-detection
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /kami-fall-detection 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.1
- Bug fix release with internal improvements. - Minor updates to fall_detect_cloud_skill.py for stability or correctness. - No changes to user-facing features or configuration.
v1.0.0
**Cloud-based RTSP fall detection skill with API-key configuration, Feishu notifications, and auto-reconnect.** - Adds KamiClaw cloud API support: no local GPU required, all inference done server-side. - New agent-guided configuration flow: agent must prompt user for API key, RTSP URL, and optional Feishu webhook, and auto-save all values in config.json. - Supports Feishu group bot notifications for fall alarms (optional, with guided setup). - Auto-reconnects to RTSP stream if connection drops. - Flexible configuration via CLI, environment variables, or config.json (with agent always managing config.json). - Structured JSON logging for alarms, transitions, and analysis with logs directory.
元数据
Slug kami-fall-detection
版本 1.0.1
许可证 MIT-0
累计安装 0
当前安装数 0
历史版本数 2
常见问题

Kami Fall Detection 是什么?

Detect fall events from RTSP camera streams using KamiClaw cloud API. No local GPU needed. 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 30 次。

如何安装 Kami Fall Detection?

在 OpenClaw 或 Claude Code 对话框中运行命令「/install kami-fall-detection」即可一键安装,无需额外配置。

Kami Fall Detection 是免费的吗?

是的,Kami Fall Detection 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。

Kami Fall Detection 支持哪些平台?

Kami Fall Detection 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(linux)。

谁开发了 Kami Fall Detection?

由 KamiVision(@13681882136)开发并维护,当前版本 v1.0.1。

💬 留言讨论