Token导航 LogoToken导航

Agent Skill · 研究检索

clip-aware-embeddings(剪辑感知嵌入)

用于搭建或维护带检索增强的 RAG 工作流,适合让 Agent 处理知识库问答、向量检索、来源引用和事实核查。它可以辅助整理数据接入、Embedding、向量库、召回参数和回答生成流程。使用时需要确认数据来源、更新频率、召回阈值和引用展示方式,避免把未命中的资料或过期内容包装成确定事实。

clip-aware-embeddings 是研究检索类 Agent Skill,可用宿主为 Codex、Claude、Cursor、Gemini CLI,通过GitHub 仓库获取,权限为调用外部服务;许可证为 MIT,第三方扫描已通过,按安装量在研究检索类的 73,675 个 Skill 里排第 35,589。

总安装 2,060周安装 85GitHub Stars 98下载 673核验 2026-05-01

安装说明

本站只整理中文说明,不托管安装包,也不代用户安装。
GitHub
许可证
MIT

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:clip-aware-embeddings(剪辑感知嵌入)
来源仓库:https://github.com/erichowens/some_claude_skills
仓库路径:skills/clip-aware-embeddings
安装命令:
npx skills add https://github.com/erichowens/some_claude_skills --skill clip-aware-embeddings
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。不同来源提供的安装方式可能略有差异;本站展示可直接复制的安装命令,安装前请核对来源页面。

skills.shnpx skills
npx skills add https://github.com/erichowens/some_claude_skills --skill clip-aware-embeddings

这个 Skill 是做什么的

研究检索类 Skill 主要解决「找资料、核对事实、把来源整理清楚」的问题,通常会让助手先检索再总结。

智能判断何时使用 CLIP 嵌入或切换至替代方案,优化图像-文本匹配任务的准确率。适合对图像语义理解要求高但对象计数、空间关系等任务需专用模型的混合应用场景。根据任务类型自动选择最优模型,提供决策树指导避免误用导致的性能下降。需配置 Hugging Face 等模型源并确保网络连通性以获取最新基准测试结果。

clip-aware-embeddings 属于研究检索类 Skill,可作为该场景下的辅助能力补充。

来源仓库内路径:skills/clip-aware-embeddings

上手步骤

4 步
  1. 1

    确认自己的宿主工具

    公开资料标注支持 Codex、Claude、Cursor、Gemini CLI;先确认自己用的是其中之一,再按对应工具的 Skills 目录放置。

  2. 2

    拿到安装命令

    可以直接复制的命令是 npx skills add https://github.com/erichowens/some_claude_skills --skill clip-awa…;命令里的占位符换成自己的路径或密钥再执行。

  3. 3

    安装后重启宿主

    命令执行完要完全退出宿主工具再打开,让新装的 Skill 被重新扫描到,否则列表里可能看不到。

  4. 4

    按最小权限试用

    它需要调用外部服务,先在测试目录或测试账号里跑,确认没问题再放到正式项目。

常见问题

6 条

clip-aware-embeddings 怎么安装?

在终端执行 npx skills add https://github.com/erichowens/some_claude_skills --skill clip-aware-embeddi…。装完完全退出宿主工具再打开,让它重新扫描本地 Skill。

clip-aware-embeddings 支持哪些 AI 工具?

公开资料标注支持 Codex、Claude、Cursor、Gemini CLI。其他工具只要能读取本地 Skill 目录,一般也能手动放进去,但要自己确认触发方式是否一致。

clip-aware-embeddings 需要什么权限?

权限级别是调用外部服务。该 Skill 可能调用第三方服务、云服务或外部模型 API,使用前需要确认账号、额度、数据发送范围和服务条款。

clip-aware-embeddings 是免费的吗?

来源标注的许可证是 MIT。本站不代收任何费用,也不托管安装包;能否商用、要不要署名,以许可证原文为准。

clip-aware-embeddings 用的人多吗?

公开数据是累计安装 2,060 次,近一周安装 85 次,下载 673 次,GitHub 98 星。这些数字来自第三方目录统计,只能当作热度参考,不代表质量或安全性。

clip-aware-embeddings 安全吗?

第三方扫描结果为通过,但这只覆盖已知的静态检查项,不能替代自己读一遍源码和安装命令。

值得选的地方和要先想清楚的地方

值得选的地方

  • 同时适配 4 种工具,换客户端不用重新找替代品。
  • 3 个目录同时收录,说明这个 Skill 流传比较广。
  • 许可证明确为 MIT,商用和分发边界好判断。
  • 第三方扫描已通过,常见的高风险行为没有命中。

先想清楚的地方

  • 第三方目录整理,版本更新和行为细节以来源仓库为准。

适不适合你

更适合

  • 已经在用 Codex,想直接扩展它能力的人。
  • 需要处理研究检索类任务、又不想每次都手写提示词的人。
  • 需要许可证清楚、并且有第三方扫描结果的团队项目。

不太适合

  • 需要厂商级技术支持和 SLA 的生产系统。

研究检索类 Skill 对比

6 个同类
Skill总安装GitHub 星权限许可证扫描
find-skills

寻找技能 · Codex、Claude

31,199,81316,486操作浏览器MIT有提醒
self-improving-agent

自我改进 Agent · OpenClaw

16,464,0023,396接触敏感数据MIT-0通过
soultrace

灵魂追踪 · Codex、Claude

7,588,94412需要联网未明确有提醒
self-improving

自我完善 · OpenClaw

6,829,2841,046需要联网MIT-0通过
microsoft-foundry

微软代工厂 · Codex、Claude

6,614,144764调用外部服务未明确有提醒
clip-aware-embeddings

剪辑感知嵌入 · 本页

2,06098调用外部服务MIT通过

按安装量取同分类前几名;数字来自第三方目录统计,只作热度参考,不代表质量结论。

SKILL.md 原文

CLIP-Aware Image Embeddings

Smart image-text matching that knows when CLIP works and when to use alternatives.

MCP Integrations

MCPPurpose
FirecrawlResearch latest CLIP alternatives and benchmarks
Hugging Face (if configured)Access model cards and documentation

Quick Decision Tree

Your task:
├─ Semantic search ("find beach images") → CLIP ✓
├─ Zero-shot classification (broad categories) → CLIP ✓
├─ Counting objects → DETR, Faster R-CNN ✗
├─ Fine-grained ID (celebrities, car models) → Specialized model ✗
├─ Spatial relations ("cat left of dog") → GQA, SWIG ✗
└─ Compositional ("red car AND blue truck") → DCSMs, PC-CLIP ✗

When to Use This Skill

✅ Use for:

  • Semantic image search
  • Broad category classification
  • Image similarity matching
  • Zero-shot tasks on new categories

❌ Do NOT use for:

  • Counting objects in images
  • Fine-grained classification
  • Spatial understanding
  • Attribute binding
  • Negation handling

Installation

pip install transformers pillow torch sentence-transformers --break-system-packages

Validation: Run python scripts/validate_setup.py

Basic Usage

Image Search

from transformers import CLIPProcessor, CLIPModel
from PIL import Image

model = CLIPModel.from_pretrained("openai/clip-vit-large-patch14")
processor = CLIPProcessor.from_pretrained("openai/clip-vit-large-patch14")

# Embed images
images = [Image.open(f"img{i}.jpg") for i in range(10)]
inputs = processor(images=images, return_tensors="pt")
image_features = model.get_image_features(**inputs)

# Search with text
text_inputs = processor(text=["a beach at sunset"], return_tensors="pt")
text_features = model.get_text_features(**text_inputs)

# Compute similarity
similarity = (image_features @ text_features.T).softmax(dim=0)

Common Anti-Patterns

Anti-Pattern 1: "CLIP for Everything"

❌ Wrong:

# Using CLIP to count cars in an image
prompt = "How many cars are in this image?"
# CLIP cannot count - it will give nonsense results

Why wrong: CLIP's architecture collapses spatial information into a single vector. It literally cannot count.

✓ Right:

from transformers import DetrImageProcessor, DetrForObjectDetection

processor = DetrImageProcessor.from_pretrained("facebook/detr-resnet-50")
model = DetrForObjectDetection.from_pretrained("facebook/detr-resnet-50")

# Detect objects
results = model(**processor(images=image, return_tensors="pt"))
# Filter for cars and count
car_detections = [d for d in results if d['label'] == 'car']
count = len(car_detections)

How to detect: If query contains "how many", "count", or numeric questions → Use object detection


Anti-Pattern 2: Fine-Grained Classification

❌ Wrong:

# Trying to identify specific celebrities with CLIP
prompts = ["Tom Hanks", "Brad Pitt", "Morgan Freeman"]
# CLIP will perform poorly - not trained for fine-grained face ID

Why wrong: CLIP trained on coarse categories. Fine-grained faces, car models, flower species require specialized models.

✓ Right:

# Use a fine-tuned face recognition model
from transformers import AutoFeatureExtractor, AutoModelForImageClassification

model = AutoModelForImageClassification.from_pretrained(
    "microsoft/resnet-50"  # Then fine-tune on celebrity dataset
)
# Or use dedicated face recognition: ArcFace, CosFace

How to detect: If query asks to distinguish between similar items in same category → Use specialized model


Anti-Pattern 3: Spatial Understanding

❌ Wrong:

# CLIP cannot understand spatial relationships
prompts = [
    "cat to the left of dog",
    "cat to the right of dog"
]
# Will give nearly identical scores

Why wrong: CLIP embeddings lose spatial topology. "Left" and "right" are treated as bag-of-words.

✓ Right:

# Use a spatial reasoning model
# Examples: GQA models, Visual Genome models, SWIG
from swig_model import SpatialRelationModel

model = SpatialRelationModel()
result = model.predict_relation(image, "cat", "dog")
# Returns: "left", "right", "above", "below", etc.

How to detect: If query contains directional words (left, right, above, under, next to) → Use spatial model


Anti-Pattern 4: Attribute Binding

❌ Wrong:

prompts = [
    "red car and blue truck",
    "blue car and red truck"
]
# CLIP often gives similar scores for both

Why wrong: CLIP cannot bind attributes to objects. It sees "red, blue, car, truck" as a bag of concepts.

✓ Right - Use PC-CLIP or DCSMs:

# PC-CLIP: Fine-tuned for pairwise comparisons
from pc_clip import PCCLIPModel

model = PCCLIPModel.from_pretrained("pc-clip-vit-l")
# Or use DCSMs (Dense Cosine Similarity Maps)

How to detect: If query has multiple objects with different attributes → Use compositional model


Evolution Timeline

2021: CLIP Released

  • Revolutionary: zero-shot, 400M image-text pairs
  • Widely adopted for everything
  • Limitations not yet understood

2022-2023: Limitations Discovered

  • Cannot count objects
  • Poor at fine-grained classification
  • Fails spatial reasoning
  • Can't bind attributes

2024: Alternatives Emerge

  • DCSMs: Preserve patch/token topology
  • PC-CLIP: Trained on pairwise comparisons
  • SpLiCE: Sparse interpretable embeddings

2025: Current Best Practices

  • Use CLIP for what it's good at
  • Task-specific models for limitations
  • Compositional models for complex queries

LLM Mistake: LLMs trained on 2021-2023 data will suggest CLIP for everything because limitations weren't widely known. This skill corrects that.


Validation Script

Before using CLIP, check if it's appropriate:

python scripts/validate_clip_usage.py \
    --query "your query here" \
    --check-all

Returns:

  • ✅ CLIP is appropriate
  • ❌ Use alternative (with suggestion)

Task-Specific Guidance

Image Search (CLIP ✓)

# Good use of CLIP
queries = ["beach", "mountain", "city skyline"]
# Works well for broad semantic concepts

Zero-Shot Classification (CLIP ✓)

# Good: Broad categories
categories = ["indoor", "outdoor", "nature", "urban"]
# CLIP excels at this

Object Counting (CLIP ✗)

# Use object detection instead
from transformers import DetrImageProcessor, DetrForObjectDetection
# See /references/object_detection.md

Fine-Grained Classification (CLIP ✗)

# Use specialized models
# See /references/fine_grained_models.md

Spatial Reasoning (CLIP ✗)

# Use spatial relation models
# See /references/spatial_models.md

Troubleshooting

Issue: CLIP gives unexpected results

Check:

  1. Is this a counting task? → Use object detection
  2. Fine-grained classification? → Use specialized model
  3. Spatial query? → Use spatial model
  4. Multiple objects with attributes? → Use compositional model

Validation:

python scripts/diagnose_clip_issue.py --image path/to/image --query "your query"

Issue: Low similarity scores

Possible causes:

  1. Query too specific (CLIP works better with broad concepts)
  2. Fine-grained task (not CLIP's strength)
  3. Need to adjust threshold

Solution: Try broader query or use alternative model


Model Selection Guide

ModelBest ForAvoid For
CLIP ViT-L/14Semantic search, broad categoriesCounting, fine-grained, spatial
DETRObject detection, countingSemantic similarity
DINOv2Fine-grained featuresText-image matching
PC-CLIPAttribute binding, comparisonsGeneral embedding
DCSMsCompositional reasoningSimple similarity

Performance Notes

CLIP models:

  • ViT-B/32: Fast, lower quality
  • ViT-L/14: Balanced (recommended)
  • ViT-g-14: Highest quality, slower

Inference time (single image, CPU):

  • ViT-B/32: ~100ms
  • ViT-L/14: ~300ms
  • ViT-g-14: ~1000ms

Further Reading

  • /references/clip_limitations.md - Detailed analysis of CLIP's failures
  • /references/alternatives.md - When to use what model
  • /references/compositional_reasoning.md - DCSMs and PC-CLIP deep dive
  • /scripts/validate_clip_usage.py - Pre-flight validation tool
  • /scripts/diagnose_clip_issue.py - Debug unexpected results

*See CHANGELOG.md for version history.*

平台分布

Claude Code

25.06%
按下载量换算169

windsurf

24.18%
按下载量换算163

Antigravity

16.54%
按下载量换算111

OpenCode

12.3%
按下载量换算83

Gemini CLI

8.19%
按下载量换算55

Codex

3.7%
按下载量换算25

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

调用外部服务

该 Skill 可能调用第三方服务、云服务或外部模型 API,使用前需要确认账号、额度、数据发送范围和服务条款。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。

继续浏览同类 Skills