[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M737KY35JFGWTWXGDK5K1022":3,"skill-same:01M737KY35JFGWTWXGDK5K1022":72},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":15,"categories":16,"keywords":17,"publishedAt":18,"linkOnly":19,"markdownContent":20,"markdownBody":21,"frontMatter":22,"refName":45,"commitSha":46,"skillDirectory":47,"forksCount":48,"repositoryHtmlUrl":49,"repositoryHomepageUrl":6,"ownerHtmlUrl":50,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":51,"install":52,"resources":65},"01M737KY35JFGWTWXGDK5K1022","clip",null,"Zero-shot image classification and image-text search.","ashneil12\u002Fvanilla-hermes-agent-canary","ashneil12","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F49880658?v=4","01M7378BQ9W161EPENEWBYAQNN","01M7378BRDJG8SFS93FG4V6BWY",1,"MIT","https:\u002F\u002Fgithub.com\u002Fashneil12\u002Fvanilla-hermes-agent-canary\u002Fblob\u002Fmain\u002Foptional-skills\u002Fmlops\u002Fclip\u002FSKILL.md",[],[],"2026-11-11 15:11:14",false,"---\nname: clip\ndescription: Zero-shot image classification and image-text search.\nversion: 1.0.0\nauthor: Orchestra Research\nlicense: MIT\ndependencies: [transformers, torch, pillow]\nplatforms: [linux, macos, windows]\nmetadata:\n  hermes:\n    tags: [Multimodal, CLIP, Vision-Language, Zero-Shot, Image Classification, OpenAI, Image Search, Cross-Modal Retrieval, Content Moderation]\n\n---\n\n# CLIP - Contrastive Language-Image Pre-Training\n\nOpenAI's model that understands images from natural language.\n\n## When to use CLIP\n\n**Use when:**\n- Zero-shot image classification (no training data needed)\n- Image-text similarity\u002Fmatching\n- Semantic image search\n- Content moderation (detect NSFW, violence)\n- Visual question answering\n- Cross-modal retrieval (image→text, text→image)\n\n**Metrics**:\n- **25,300+ GitHub stars**\n- Trained on 400M image-text pairs\n- Matches ResNet-50 on ImageNet (zero-shot)\n- MIT License\n\n**Use alternatives instead**:\n- **BLIP-2**: Better captioning\n- **LLaVA**: Vision-language chat\n- **Segment Anything**: Image segmentation\n\n## Quick start\n\n### Installation\n\n```bash\npip install git+https:\u002F\u002Fgithub.com\u002Fopenai\u002FCLIP.git\npip install torch torchvision ftfy regex tqdm\n```\n\n### Zero-shot classification\n\n```python\nimport torch\nimport clip\nfrom PIL import Image\n\n# Load model\ndevice = \"cuda\" if torch.cuda.is_available() else \"cpu\"\nmodel, preprocess = clip.load(\"ViT-B\u002F32\", device=device)\n\n# Load image\nimage = preprocess(Image.open(\"photo.jpg\")).unsqueeze(0).to(device)\n\n# Define possible labels\ntext = clip.tokenize([\"a dog\", \"a cat\", \"a bird\", \"a car\"]).to(device)\n\n# Compute similarity\nwith torch.no_grad():\n    image_features = model.encode_image(image)\n    text_features = model.encode_text(text)\n\n    # Cosine similarity\n    logits_per_image, logits_per_text = model(image, text)\n    probs = logits_per_image.softmax(dim=-1).cpu().numpy()\n\n# Print results\nlabels = [\"a dog\", \"a cat\", \"a bird\", \"a car\"]\nfor label, prob in zip(labels, probs[0]):\n    print(f\"{label}: {prob:.2%}\")\n```\n\n## Available models\n\n```python\n# Models (sorted by size)\nmodels = [\n    \"RN50\",           # ResNet-50\n    \"RN101\",          # ResNet-101\n    \"ViT-B\u002F32\",       # Vision Transformer (recommended)\n    \"ViT-B\u002F16\",       # Better quality, slower\n    \"ViT-L\u002F14\",       # Best quality, slowest\n]\n\nmodel, preprocess = clip.load(\"ViT-B\u002F32\")\n```\n\n| Model | Parameters | Speed | Quality |\n|-------|------------|-------|---------|\n| RN50 | 102M | Fast | Good |\n| ViT-B\u002F32 | 151M | Medium | Better |\n| ViT-L\u002F14 | 428M | Slow | Best |\n\n## Image-text similarity\n\n```python\n# Compute embeddings\nimage_features = model.encode_image(image)\ntext_features = model.encode_text(text)\n\n# Normalize\nimage_features \u002F= image_features.norm(dim=-1, keepdim=True)\ntext_features \u002F= text_features.norm(dim=-1, keepdim=True)\n\n# Cosine similarity\nsimilarity = (image_features @ text_features.T).item()\nprint(f\"Similarity: {similarity:.4f}\")\n```\n\n## Semantic image search\n\n```python\n# Index images\nimage_paths = [\"img1.jpg\", \"img2.jpg\", \"img3.jpg\"]\nimage_embeddings = []\n\nfor img_path in image_paths:\n    image = preprocess(Image.open(img_path)).unsqueeze(0).to(device)\n    with torch.no_grad():\n        embedding = model.encode_image(image)\n        embedding \u002F= embedding.norm(dim=-1, keepdim=True)\n    image_embeddings.append(embedding)\n\nimage_embeddings = torch.cat(image_embeddings)\n\n# Search with text query\nquery = \"a sunset over the ocean\"\ntext_input = clip.tokenize([query]).to(device)\nwith torch.no_grad():\n    text_embedding = model.encode_text(text_input)\n    text_embedding \u002F= text_embedding.norm(dim=-1, keepdim=True)\n\n# Find most similar images\nsimilarities = (text_embedding @ image_embeddings.T).squeeze(0)\ntop_k = similarities.topk(3)\n\nfor idx, score in zip(top_k.indices, top_k.values):\n    print(f\"{image_paths[idx]}: {score:.3f}\")\n```\n\n## Content moderation\n\n```python\n# Define categories\ncategories = [\n    \"safe for work\",\n    \"not safe for work\",\n    \"violent content\",\n    \"graphic content\"\n]\n\ntext = clip.tokenize(categories).to(device)\n\n# Check image\nwith torch.no_grad():\n    logits_per_image, _ = model(image, text)\n    probs = logits_per_image.softmax(dim=-1)\n\n# Get classification\nmax_idx = probs.argmax().item()\nmax_prob = probs[0, max_idx].item()\n\nprint(f\"Category: {categories[max_idx]} ({max_prob:.2%})\")\n```\n\n## Batch processing\n\n```python\n# Process multiple images\nimages = [preprocess(Image.open(f\"img{i}.jpg\")) for i in range(10)]\nimages = torch.stack(images).to(device)\n\nwith torch.no_grad():\n    image_features = model.encode_image(images)\n    image_features \u002F= image_features.norm(dim=-1, keepdim=True)\n\n# Batch text\ntexts = [\"a dog\", \"a cat\", \"a bird\"]\ntext_tokens = clip.tokenize(texts).to(device)\n\nwith torch.no_grad():\n    text_features = model.encode_text(text_tokens)\n    text_features \u002F= text_features.norm(dim=-1, keepdim=True)\n\n# Similarity matrix (10 images × 3 texts)\nsimilarities = image_features @ text_features.T\nprint(similarities.shape)  # (10, 3)\n```\n\n## Integration with vector databases\n\n```python\n# Store CLIP embeddings in Chroma\u002FFAISS\nimport chromadb\n\nclient = chromadb.Client()\ncollection = client.create_collection(\"image_embeddings\")\n\n# Add image embeddings\nfor img_path, embedding in zip(image_paths, image_embeddings):\n    collection.add(\n        embeddings=[embedding.cpu().numpy().tolist()],\n        metadatas=[{\"path\": img_path}],\n        ids=[img_path]\n    )\n\n# Query with text\nquery = \"a sunset\"\ntext_embedding = model.encode_text(clip.tokenize([query]))\nresults = collection.query(\n    query_embeddings=[text_embedding.cpu().numpy().tolist()],\n    n_results=5\n)\n```\n\n## Best practices\n\n1. **Use ViT-B\u002F32 for most cases** - Good balance\n2. **Normalize embeddings** - Required for cosine similarity\n3. **Batch processing** - More efficient\n4. **Cache embeddings** - Expensive to recompute\n5. **Use descriptive labels** - Better zero-shot performance\n6. **GPU recommended** - 10-50× faster\n7. **Preprocess images** - Use provided preprocess function\n\n## Performance\n\n| Operation | CPU | GPU (V100) |\n|-----------|-----|------------|\n| Image encoding | ~200ms | ~20ms |\n| Text encoding | ~50ms | ~5ms |\n| Similarity compute | \u003C1ms | \u003C1ms |\n\n## Limitations\n\n1. **Not for fine-grained tasks** - Best for broad categories\n2. **Requires descriptive text** - Vague labels perform poorly\n3. **Biased on web data** - May have dataset biases\n4. **No bounding boxes** - Whole image only\n5. **Limited spatial understanding** - Position\u002Fcounting weak\n\n## Resources\n\n- **GitHub**: https:\u002F\u002Fgithub.com\u002Fopenai\u002FCLIP ⭐ 25,300+\n- **Paper**: https:\u002F\u002Farxiv.org\u002Fabs\u002F2103.00020\n- **Colab**: https:\u002F\u002Fcolab.research.google.com\u002Fgithub\u002Fopenai\u002Fclip\u002F\n- **License**: MIT\n\n\n","# CLIP - Contrastive Language-Image Pre-Training\n\nOpenAI's model that understands images from natural language.\n\n## When to use CLIP\n\n**Use when:**\n- Zero-shot image classification (no training data needed)\n- Image-text similarity\u002Fmatching\n- Semantic image search\n- Content moderation (detect NSFW, violence)\n- Visual question answering\n- Cross-modal retrieval (image→text, text→image)\n\n**Metrics**:\n- **25,300+ GitHub stars**\n- Trained on 400M image-text pairs\n- Matches ResNet-50 on ImageNet (zero-shot)\n- MIT License\n\n**Use alternatives instead**:\n- **BLIP-2**: Better captioning\n- **LLaVA**: Vision-language chat\n- **Segment Anything**: Image segmentation\n\n## Quick start\n\n### Installation\n\n```bash\npip install git+https:\u002F\u002Fgithub.com\u002Fopenai\u002FCLIP.git\npip install torch torchvision ftfy regex tqdm\n```\n\n### Zero-shot classification\n\n```python\nimport torch\nimport clip\nfrom PIL import Image\n\n# Load model\ndevice = \"cuda\" if torch.cuda.is_available() else \"cpu\"\nmodel, preprocess = clip.load(\"ViT-B\u002F32\", device=device)\n\n# Load image\nimage = preprocess(Image.open(\"photo.jpg\")).unsqueeze(0).to(device)\n\n# Define possible labels\ntext = clip.tokenize([\"a dog\", \"a cat\", \"a bird\", \"a car\"]).to(device)\n\n# Compute similarity\nwith torch.no_grad():\n    image_features = model.encode_image(image)\n    text_features = model.encode_text(text)\n\n    # Cosine similarity\n    logits_per_image, logits_per_text = model(image, text)\n    probs = logits_per_image.softmax(dim=-1).cpu().numpy()\n\n# Print results\nlabels = [\"a dog\", \"a cat\", \"a bird\", \"a car\"]\nfor label, prob in zip(labels, probs[0]):\n    print(f\"{label}: {prob:.2%}\")\n```\n\n## Available models\n\n```python\n# Models (sorted by size)\nmodels = [\n    \"RN50\",           # ResNet-50\n    \"RN101\",          # ResNet-101\n    \"ViT-B\u002F32\",       # Vision Transformer (recommended)\n    \"ViT-B\u002F16\",       # Better quality, slower\n    \"ViT-L\u002F14\",       # Best quality, slowest\n]\n\nmodel, preprocess = clip.load(\"ViT-B\u002F32\")\n```\n\n| Model | Parameters | Speed | Quality |\n|-------|------------|-------|---------|\n| RN50 | 102M | Fast | Good |\n| ViT-B\u002F32 | 151M | Medium | Better |\n| ViT-L\u002F14 | 428M | Slow | Best |\n\n## Image-text similarity\n\n```python\n# Compute embeddings\nimage_features = model.encode_image(image)\ntext_features = model.encode_text(text)\n\n# Normalize\nimage_features \u002F= image_features.norm(dim=-1, keepdim=True)\ntext_features \u002F= text_features.norm(dim=-1, keepdim=True)\n\n# Cosine similarity\nsimilarity = (image_features @ text_features.T).item()\nprint(f\"Similarity: {similarity:.4f}\")\n```\n\n## Semantic image search\n\n```python\n# Index images\nimage_paths = [\"img1.jpg\", \"img2.jpg\", \"img3.jpg\"]\nimage_embeddings = []\n\nfor img_path in image_paths:\n    image = preprocess(Image.open(img_path)).unsqueeze(0).to(device)\n    with torch.no_grad():\n        embedding = model.encode_image(image)\n        embedding \u002F= embedding.norm(dim=-1, keepdim=True)\n    image_embeddings.append(embedding)\n\nimage_embeddings = torch.cat(image_embeddings)\n\n# Search with text query\nquery = \"a sunset over the ocean\"\ntext_input = clip.tokenize([query]).to(device)\nwith torch.no_grad():\n    text_embedding = model.encode_text(text_input)\n    text_embedding \u002F= text_embedding.norm(dim=-1, keepdim=True)\n\n# Find most similar images\nsimilarities = (text_embedding @ image_embeddings.T).squeeze(0)\ntop_k = similarities.topk(3)\n\nfor idx, score in zip(top_k.indices, top_k.values):\n    print(f\"{image_paths[idx]}: {score:.3f}\")\n```\n\n## Content moderation\n\n```python\n# Define categories\ncategories = [\n    \"safe for work\",\n    \"not safe for work\",\n    \"violent content\",\n    \"graphic content\"\n]\n\ntext = clip.tokenize(categories).to(device)\n\n# Check image\nwith torch.no_grad():\n    logits_per_image, _ = model(image, text)\n    probs = logits_per_image.softmax(dim=-1)\n\n# Get classification\nmax_idx = probs.argmax().item()\nmax_prob = probs[0, max_idx].item()\n\nprint(f\"Category: {categories[max_idx]} ({max_prob:.2%})\")\n```\n\n## Batch processing\n\n```python\n# Process multiple images\nimages = [preprocess(Image.open(f\"img{i}.jpg\")) for i in range(10)]\nimages = torch.stack(images).to(device)\n\nwith torch.no_grad():\n    image_features = model.encode_image(images)\n    image_features \u002F= image_features.norm(dim=-1, keepdim=True)\n\n# Batch text\ntexts = [\"a dog\", \"a cat\", \"a bird\"]\ntext_tokens = clip.tokenize(texts).to(device)\n\nwith torch.no_grad():\n    text_features = model.encode_text(text_tokens)\n    text_features \u002F= text_features.norm(dim=-1, keepdim=True)\n\n# Similarity matrix (10 images × 3 texts)\nsimilarities = image_features @ text_features.T\nprint(similarities.shape)  # (10, 3)\n```\n\n## Integration with vector databases\n\n```python\n# Store CLIP embeddings in Chroma\u002FFAISS\nimport chromadb\n\nclient = chromadb.Client()\ncollection = client.create_collection(\"image_embeddings\")\n\n# Add image embeddings\nfor img_path, embedding in zip(image_paths, image_embeddings):\n    collection.add(\n        embeddings=[embedding.cpu().numpy().tolist()],\n        metadatas=[{\"path\": img_path}],\n        ids=[img_path]\n    )\n\n# Query with text\nquery = \"a sunset\"\ntext_embedding = model.encode_text(clip.tokenize([query]))\nresults = collection.query(\n    query_embeddings=[text_embedding.cpu().numpy().tolist()],\n    n_results=5\n)\n```\n\n## Best practices\n\n1. **Use ViT-B\u002F32 for most cases** - Good balance\n2. **Normalize embeddings** - Required for cosine similarity\n3. **Batch processing** - More efficient\n4. **Cache embeddings** - Expensive to recompute\n5. **Use descriptive labels** - Better zero-shot performance\n6. **GPU recommended** - 10-50× faster\n7. **Preprocess images** - Use provided preprocess function\n\n## Performance\n\n| Operation | CPU | GPU (V100) |\n|-----------|-----|------------|\n| Image encoding | ~200ms | ~20ms |\n| Text encoding | ~50ms | ~5ms |\n| Similarity compute | \u003C1ms | \u003C1ms |\n\n## Limitations\n\n1. **Not for fine-grained tasks** - Best for broad categories\n2. **Requires descriptive text** - Vague labels perform poorly\n3. **Biased on web data** - May have dataset biases\n4. **No bounding boxes** - Whole image only\n5. **Limited spatial understanding** - Position\u002Fcounting weak\n\n## Resources\n\n- **GitHub**: https:\u002F\u002Fgithub.com\u002Fopenai\u002FCLIP ⭐ 25,300+\n- **Paper**: https:\u002F\u002Farxiv.org\u002Fabs\u002F2103.00020\n- **Colab**: https:\u002F\u002Fcolab.research.google.com\u002Fgithub\u002Fopenai\u002Fclip\u002F\n- **License**: MIT\n\n\n",{"name":5,"author":23,"license":14,"version":24,"metadata":25,"platforms":37,"description":7,"dependencies":41},"Orchestra Research","1.0.0",{"hermes":26},{"tags":27},[28,29,30,31,32,33,34,35,36],"Multimodal","CLIP","Vision-Language","Zero-Shot","Image Classification","OpenAI","Image Search","Cross-Modal Retrieval","Content Moderation",[38,39,40],"linux","macos","windows",[42,43,44],"transformers","torch","pillow","main","0905b0264ce5a54908bedc9637e50251543db132","optional-skills\u002Fmlops\u002Fclip",0,"https:\u002F\u002Fgithub.com\u002Fashneil12\u002Fvanilla-hermes-agent-canary","https:\u002F\u002Fgithub.com\u002Fashneil12","2026-11-04 08:25:00",{"source":8,"skillName":5,"commands":53,"prompt":63,"zipAvailable":64},[54,57,60],{"tool":55,"command":56},"npx","npx skills add ashneil12\u002Fvanilla-hermes-agent-canary --skill clip",{"tool":58,"command":59},"bunx","bunx skills add ashneil12\u002Fvanilla-hermes-agent-canary --skill clip",{"tool":61,"command":62},"pnpm","pnpm dlx skills add ashneil12\u002Fvanilla-hermes-agent-canary --skill clip","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fashneil12\u002Fvanilla-hermes-agent-canary\u002Fblob\u002Fmain\u002Foptional-skills\u002Fmlops\u002Fclip\u002FSKILL.md",true,[66],{"path":67,"resourceType":68,"resourceTypeDesc":69,"sizeBytes":70,"sourceHtmlUrl":71},"references\u002Fapplications.md","REFERENCE","参考文档",5360,"https:\u002F\u002Fgithub.com\u002Fashneil12\u002Fvanilla-hermes-agent-canary\u002Fblob\u002Fmain\u002Foptional-skills\u002Fmlops\u002Fclip\u002Freferences\u002Fapplications.md",[73,80,87,94,101,108],{"skillNo":74,"name":75,"nameZh":6,"description":76,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":77,"categories":78,"keywords":79,"publishedAt":18},"01M7380YR13A23353XT9NS6EGR","blocked-page-recovery","Use when a fetch fails: 403\u002F429, paywall, WAF, bot wall.","https:\u002F\u002Fgithub.com\u002Fashneil12\u002Fvanilla-hermes-agent-canary\u002Fblob\u002Fmain\u002Fskills\u002Fweb\u002Fblocked-page-recovery\u002FSKILL.md",[],[],{"skillNo":81,"name":82,"nameZh":6,"description":83,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":84,"categories":85,"keywords":86,"publishedAt":18},"01M7380VZ8P60Q64J3F92D4AMY","test-driven-development","TDD: enforce RED-GREEN-REFACTOR, tests before code.","https:\u002F\u002Fgithub.com\u002Fashneil12\u002Fvanilla-hermes-agent-canary\u002Fblob\u002Fmain\u002Fskills\u002Fsoftware-development\u002Ftest-driven-development\u002FSKILL.md",[],[],{"skillNo":88,"name":89,"nameZh":6,"description":90,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":91,"categories":92,"keywords":93,"publishedAt":18},"01M7380QXN6F90R0MH1M3FHRKX","systematic-debugging","4-phase root cause debugging: understand bugs before fixing.","https:\u002F\u002Fgithub.com\u002Fashneil12\u002Fvanilla-hermes-agent-canary\u002Fblob\u002Fmain\u002Fskills\u002Fsoftware-development\u002Fsystematic-debugging\u002FSKILL.md",[],[],{"skillNo":95,"name":96,"nameZh":6,"description":97,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":98,"categories":99,"keywords":100,"publishedAt":18},"01M7380N4BZYT2WRRZN1N9DZ65","spike","Throwaway experiments to validate an idea before build.","https:\u002F\u002Fgithub.com\u002Fashneil12\u002Fvanilla-hermes-agent-canary\u002Fblob\u002Fmain\u002Fskills\u002Fsoftware-development\u002Fspike\u002FSKILL.md",[],[],{"skillNo":102,"name":103,"nameZh":6,"description":104,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":105,"categories":106,"keywords":107,"publishedAt":18},"01M7380JAEC9ZH5DVPHHK56P97","simplify-code","Parallel 4-agent cleanup of recent code changes.","https:\u002F\u002Fgithub.com\u002Fashneil12\u002Fvanilla-hermes-agent-canary\u002Fblob\u002Fmain\u002Fskills\u002Fsoftware-development\u002Fsimplify-code\u002FSKILL.md",[],[],{"skillNo":109,"name":110,"nameZh":6,"description":111,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":112,"categories":113,"keywords":114,"publishedAt":18},"01M7380F5MBB7FKWWV3G3TZ193","requesting-code-review","Pre-commit review: security scan, quality gates, auto-fix.","https:\u002F\u002Fgithub.com\u002Fashneil12\u002Fvanilla-hermes-agent-canary\u002Fblob\u002Fmain\u002Fskills\u002Fsoftware-development\u002Frequesting-code-review\u002FSKILL.md",[],[]]