Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

senior-computer-vision

БесплатноБез исполняемых скриптовНе проверен

Object detection, image segmentation, and visual AI. Use when a user asks to detect objects in images, segment images, run YOLO inference, build a computer…

TerminalSkillsот TerminalSkills★ 221 звезда на GitHub

Об этом скилле

Senior Computer Vision

Overview

Build and deploy computer vision pipelines for object detection, image segmentation, and visual AI. Supports Ultralytics YOLO (YOLO26 is the current release; YOLO11 and v8 still work), Faster R-CNN, SAM (Segment Anything Model), and Mask R-CNN. Includes TensorRT optimization for production deployment with real-time inference.

Instructions

When a user asks for computer vision help, determine the task:

Task A: Object detection with YOLO

  1. Install ultralytics:
pip install ultralytics

Ultralytics code and weights are AGPL-3.0; closed-source commercial products need an Ultralytics Enterprise License (or use torchvision/other Apache or BSD models).

  1. Run inference:
from ultralytics import YOLO

# Load a pretrained model
model = YOLO("yolo26n.pt")  # nano (fastest) | s | m | l | x (most accurate)

# Detect objects in an image
results = model("image.jpg")

# Process results
for result in results:
    boxes = result.boxes
    for box in boxes:
        cls = int(box.cls[0])
        conf = float(box.conf[0])
        label = model.names[cls]
        x1, y1, x2, y2 = box.xyxy[0].tolist()
        print(f"{label}: {conf:.2f} at [{x1:.0f},{y1:.0f},{x2:.0f},{y2:.0f}]")

# Save annotated image
results[0].save("result.jpg")
  1. Run on video:
# Process video with tracking
results = model.track("video.mp4", show=False, save=True, tracker="bytetrack.yaml")
  1. Train a custom YOLO model:
model = YOLO("yolo26n.pt")
model.train(
    data="dataset.yaml",   # Path to dataset config
    epochs=100,
    imgsz=640,
    batch=16,
    device=0,              # GPU index
    patience=20,           # Early stopping
)

Dataset YAML format:

path: ./dataset
train: images/train
val: images/val
names:
  0: cat
  1: dog
  2: bird

Task B: Image segmentation with SAM

The simplest route is the Ultralytics SAM class (weights download automatically). sam2.1_b.pt (SAM 2.1) and SAM 3 (sam3.pt, needs access approval on Hugging Face) load the same way.

from ultralytics import SAM

model = SAM("sam_b.pt")

# Prompt with a box [x1, y1, x2, y2] or points (1 = foreground, 0 = background)
results = model("product.jpg", bboxes=[120, 80, 860, 940])
results = model("product.jpg", points=500, 375, labels=[1])

# No prompt: segment everything
results = model("product.jpg")
mask = results[0].masks.data[0].cpu().numpy()   # binary mask, shape (H, W)

Meta's original segment-anything package (pip install git+https://github.com/facebookresearch/segment-anything.git, checkpoint sam_vit_h_4b8939.pth downloaded from the repo README) exposes sam_model_registry, SamPredictor and SamAutomaticMaskGenerator; use it when you need its raw API. It needs numpy and an RGB (H, W, 3) uint8 array as the image.

Task C: Faster R-CNN and Mask R-CNN with torchvision

import torch
from torchvision.models.detection import fasterrcnn_resnet50_fpn_v2, maskrcnn_resnet50_fpn_v2
from torchvision.transforms import functional as F
from PIL import Image

# Object detection with Faster R-CNN
det_model = fasterrcnn_resnet50_fpn_v2(weights="DEFAULT")
det_model.eval().cuda()

img = Image.open("image.jpg")
img_tensor = F.to_tensor(img).unsqueeze(0).cuda()

with torch.no_grad():
    predictions = det_model(img_tensor)[0]

# Filter by confidence
threshold = 0.7
for i in range(len(predictions["scores"])):
    if predictions["scores"][i] > threshold:
        label = predictions["labels"][i].item()
        score = predictions["scores"][i].item()
        box = predictions["boxes"][i].tolist()
        print(f"Class {label}: {score:.2f} at {box}")

# Instance segmentation with Mask R-CNN
seg_model = maskrcnn_resnet50_fpn_v2(weights="DEFAULT")
seg_model.eval().cuda()

with torch.no_grad():
    predictions = seg_model(img_tensor)[0]
    # predictions["masks"] contains per-instance binary masks

Task D: TensorRT optimization for deployment

# Export YOLO to TensorRT
from ultralytics import YOLO

model = YOLO("yolo26n.pt")
model.export(format="engine", device=0, quantize=16)  # FP16 engine yolo26n.engine (older versions: half=True)

# Run inference with TensorRT engine
trt_model = YOLO("yolo26n.engine")
results = trt_model("image.jpg")

For custom models:

import torch

# Export PyTorch model to ONNX first
torch.onnx.export(
    model, dummy_input, "model.onnx",
    opset_version=17,
    input_names=["input"],
    output_names=["output"],
    dynamic_axes={"input": {0: "batch"}, "output": {0: "batch"}},
)

# Convert ONNX to TensorRT
# trtexec --onnx=model.onnx --saveEngine=model.engine --fp16

Task E: Image classification

from torchvision.models import efficientnet_v2_s, EfficientNet_V2_S_Weights
import torch
from torchvision.transforms import functional as F
from PIL import Image

weights = EfficientNet_V2_S_Weights.DEFAULT
model = efficientnet_v2_s(weights=weights).eval().cuda()
pr
Полный SKILL.md на GitHub

Установить senior-computer-vision в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

Вложенные файлы

_scores.json

FAQ

Что делает скилл senior-computer-vision?

Object detection, image segmentation, and visual AI. Use when a user asks to detect objects in images, segment images, run YOLO inference, build a computer vision pipeline, use Faster R-CNN or SAM, deploy a vision model with TensorRT, or perform image classification. Covers YOLO, SAM, Mask R-CNN, and TensorRT optimization.

Как установить скилл senior-computer-vision?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл senior-computer-vision запускает скрипты?

Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.

Похожие скиллы

Сравнить senior-computer-vision с