Agent Skills › SharpAI/DeepCamera › depth-estimation

depth-estimation

GitHub

基于Depth Anything v2的实时单目深度估计技能,支持macOS CoreML与Linux PyTorch后端。提供隐私匿名化、深度叠加及3D场景理解功能,适用于安全监控等场景。

skills/transformation/depth-estimation/SKILL.md SharpAI/DeepCamera

触发场景

需要实时视频流的深度图生成 要求隐私模式下的身份匿名化处理 需要在Apple Silicon设备上加速推理

安装

npx skills add SharpAI/DeepCamera --skill depth-estimation -g -y
更多选项

非标准路径

npx skills add https://github.com/SharpAI/DeepCamera/tree/master/skills/transformation/depth-estimation -g -y

不安装直接使用

npx skills use SharpAI/DeepCamera@depth-estimation

指定 Agent (Claude Code)

npx skills add SharpAI/DeepCamera --skill depth-estimation -a claude-code -g -y

安装 repo 全部 skill

npx skills add SharpAI/DeepCamera --all -g -y

预览 repo 内 skill

npx skills add SharpAI/DeepCamera --list

SKILL.md

Frontmatter
{
    "name": "depth-estimation",
    "version": "1.2.0",
    "category": "privacy",
    "parameters": [
        {
            "name": "model",
            "type": "select",
            "group": "Model",
            "label": "Depth Model",
            "default": "depth-anything-v2-small",
            "options": [
                "depth-anything-v2-small",
                "depth-anything-v2-base",
                "depth-anything-v2-large"
            ]
        },
        {
            "name": "variant",
            "type": "select",
            "group": "Model",
            "label": "CoreML Variant (macOS)",
            "default": "DepthAnythingV2SmallF16",
            "options": [
                "DepthAnythingV2SmallF16",
                "DepthAnythingV2SmallF16INT8",
                "DepthAnythingV2SmallF32"
            ]
        },
        {
            "name": "blend_mode",
            "type": "select",
            "group": "Display",
            "label": "Display Mode",
            "default": "depth_only",
            "options": [
                "depth_only",
                "overlay",
                "side_by_side"
            ]
        },
        {
            "max": 1,
            "min": 0,
            "name": "opacity",
            "type": "number",
            "group": "Display",
            "label": "Overlay Opacity",
            "default": 0.5
        },
        {
            "name": "colormap",
            "type": "select",
            "group": "Display",
            "label": "Depth Colormap",
            "default": "inferno",
            "options": [
                "inferno",
                "viridis",
                "plasma",
                "magma",
                "jet",
                "turbo",
                "hot",
                "cool"
            ]
        },
        {
            "name": "device",
            "type": "select",
            "group": "Performance",
            "label": "Device",
            "default": "auto",
            "options": [
                "auto",
                "cpu",
                "cuda",
                "mps"
            ]
        }
    ],
    "description": "Real-time depth map privacy transforms using Depth Anything v2 (CoreML + PyTorch)",
    "capabilities": {
        "live_transform": {
            "script": "scripts\/transform.py",
            "description": "Real-time depth estimation overlay on live feed"
        }
    }
}

Depth Estimation (Privacy)

Real-time monocular depth estimation using Depth Anything v2. Transforms camera feeds with colorized depth maps — near objects appear warm, far objects appear cool.

When used for privacy mode, the depth_only blend mode fully anonymizes the scene while preserving spatial layout and activity, enabling security monitoring without revealing identities.

Hardware Backends

Platform Backend Runtime Model
macOS CoreML Apple Neural Engine apple/coreml-depth-anything-v2-small (.mlpackage)
Linux/Windows PyTorch CUDA / CPU depth-anything/Depth-Anything-V2-Small (.pth)

On macOS, CoreML runs on the Neural Engine, leaving the GPU free for other tasks. The model is auto-downloaded from HuggingFace and stored at ~/.aegis-ai/models/feature-extraction/.

What You Get

  • Privacy anonymization — depth-only mode hides all visual identity
  • Depth overlays on live camera feeds
  • 3D scene understanding — spatial layout of the scene
  • CoreML acceleration — Neural Engine on Apple Silicon (3-5x faster than MPS)

Interface: TransformSkillBase

This skill implements the TransformSkillBase interface. Any new privacy skill can be created by subclassing TransformSkillBase and implementing two methods:

from transform_base import TransformSkillBase

class MyPrivacySkill(TransformSkillBase):
    def load_model(self, config):
        # Load your model, return {"model": "...", "device": "..."}
        ...

    def transform_frame(self, image, metadata):
        # Transform BGR image, return BGR image
        ...

Protocol

Aegis → Skill (stdin)

{"event": "frame", "frame_id": "cam1_1710001", "camera_id": "front_door", "frame_path": "/tmp/frame.jpg", "timestamp": "..."}
{"command": "config-update", "config": {"opacity": 0.8, "blend_mode": "overlay"}}
{"command": "stop"}

Skill → Aegis (stdout)

{"event": "ready", "model": "coreml-DepthAnythingV2SmallF16", "device": "neural_engine", "backend": "coreml"}
{"event": "transform", "frame_id": "cam1_1710001", "camera_id": "front_door", "transform_data": "<base64 JPEG>"}
{"event": "perf_stats", "total_frames": 50, "timings_ms": {"transform": {"avg": 12.5, ...}}}

Setup

python3 -m venv .venv && source .venv/bin/activate
pip install -r requirements.txt

版本历史

  • 2264fcb 当前 2026-08-20 16:02

同 Skill 集合

skills/analysis/cloud-provider-regression/SKILL.md
skills/analysis/home-security-benchmark/SKILL.md
skills/analysis/homesafe-bench/SKILL.md
skills/analysis/smarthome-bench/SKILL.md
skills/annotation/dataset-annotation/SKILL.md
skills/annotation/dataset-management/SKILL.md
skills/camera-providers/eufy/SKILL.md
skills/camera-providers/tapo/SKILL.md
skills/channels/matrix/SKILL.md
skills/detection/yolo-detection-2026-coral-tpu-macos/SKILL.md
skills/detection/yolo-detection-2026-coral-tpu-win-wsl/SKILL.md
skills/detection/yolo-detection-2026-openvino/SKILL.md
skills/detection/yolo-detection-2026/SKILL.md
skills/integrations/homeassistant-bridge/SKILL.md
skills/segmentation/sam2-segmentation/SKILL.md
skills/training/model-training/SKILL.md
skills/automation/ha-trigger/SKILL.md
skills/automation/mqtt/SKILL.md
skills/automation/webhook/SKILL.md
skills/camera-providers/reolink/SKILL.md
skills/channels/line/SKILL.md
skills/channels/signal/SKILL.md
skills/streaming/go2rtc-cameras/SKILL.md

元信息

文件数
0
版本
933dcc7
Hash
184048cf
收录时间
2026-08-20 16:02

首页 - Wiki
Copyright © 2011-2026 iteam. Current version is 2.156.0. UTC+08:00, 2026-11-21 16:30
浙ICP备14020137号-1