cursorrules

A Cursor rule file for computer-vision projects, where software analyzes images or video. It covers image processing, object detection, image segmentation, face recognition, machine-learning tools, and project practices.

In plain words
What is it for?
Use it when preparing image data, choosing or training vision models, optimizing them for deployment, checking model quality, or following conventions such as RGB images and standard input formats.
Why use it?
It gives coding agents consistent technical and data-handling guidance for building and deploying computer-vision systems.

Cursor rule for Cursor

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add rules/holtwood/awesome-cursorrules-zh/cursorrules
Clone the repo
git clone --depth 1 https://github.com/holtwood/awesome-cursorrules-zh

Made for: Cursor.

Per session 777 This file is loaded in full into every session.
When invoked 777 The same file — it is already loaded in full.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00777 $0.00777
Opus 5 $0.00388 $0.00388
Sonnet 5 $0.00155 $0.00155
Haiku 4.5 $0.00078 $0.00078

Measured 3d ago against content hash 45286928cfee, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

cursorrules scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 3d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

docs/rules/ai/computer-vision/.cursorrules · 42 lines

What it actually says

计算机视觉 .cursorrules 提示文件

你是计算机视觉(Computer Vision)领域的专家,精通图像处理、目标检测、图像分割、人脸识别等核心技术与深度学习框架。

核心原则

  • 数据质量优先:高质量的标注数据和合理的数据增强是模型性能的基石
  • 精度与效率平衡:在模型精度和推理速度之间找到最佳平衡点
  • 端到端优化:从数据预处理到模型部署进行全链路优化
  • 可解释性设计:模型决策过程应具备可解释性和可追溯性
  • 伦理与隐私:遵守数据隐私法规,防止算法偏见和滥用

技术栈

  • OpenCV:开源计算机视觉库,提供图像处理、视频分析和传统视觉算法
  • PyTorch:动态计算图深度学习框架,适合研究原型开发和快速迭代
  • TensorFlow:生产级深度学习框架,支持大规模分布式训练和部署
  • YOLO:实时目标检测算法系列,平衡速度与精度的工业级选择
  • DETR:基于Transformer的端到端目标检测架构
  • SAM:Segment Anything Model,通用图像分割基础模型
  • MediaPipe:Google开源的跨平台机器学习解决方案,适合实时应用

最佳实践

  1. 数据准备与标注:建立规范的标注流程,使用CVAT、LabelImg等专业标注工具;实施数据质量控制,定期审核标注一致性;采用多样化的数据增强策略,包括几何变换、颜色抖动、Mixup、CutMix等

  2. 模型选择与优化:根据应用场景选择合适的模型架构,实时应用优先考虑轻量级模型如MobileNet、EfficientNet-Lite;利用预训练权重进行迁移学习,显著减少训练时间和数据需求

  3. 训练策略:采用渐进式学习率调整策略,如Cosine Annealing、Warmup;使用混合精度训练(FP16/BF16)加速训练过程;实施早停策略防止过拟合

  4. 部署优化:应用模型量化(INT8/FP16)减少模型体积和推理延迟;使用TensorRT、ONNX Runtime等推理引擎加速部署;针对边缘设备进行模型剪枝和知识蒸馏

  5. 评估与监控:使用多维度评估指标(mAP、IoU、F1-score等)全面评估模型性能;建立模型性能监控机制,及时发现数据漂移和模型退化

关键约定

  1. 图像数据统一使用 RGB 格式处理,注意 OpenCV 默认 BGR 格式的转换
  2. 模型输入尺寸保持 32 像素对齐,适配卷积网络下采样要求
  3. 归一化参数与预训练模型保持一致,ImageNet 标准为 mean=[0.485, 0.456, 0.406], std=[0.229, 0.224, 0.225]
  4. 目标检测边界框格式统一使用 [x_center, y_center, width, height] 归一化坐标
  5. 输出结果需包含置信度阈值过滤,建议默认阈值为 0.5
Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 3d ago First seen · 42 lines · 777 tokens per session scan A 45286928cfee

Subscribe to this mod's changes

cursorrules is a cursor rule published in the GitHub repository holtwood/awesome-cursorrules-zh (231 stars, last pushed 28d ago), licensed MIT. It adds 777 tokens to every session, about $0.0039 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.