Agent skill

实现并集成CIoU损失函数

该技能用于在PyTorch目标跟踪或检测任务中,将现有的GIoU损失替换为CIoU(Complete IoU)损失。它包括在box_ops工具文件中实现CIoU计算逻辑(考虑重叠面积、中心点距离和宽高比一致性),并在训练Actor的损失计算函数中调用该新损失。

ECNU-ICALKgithub.com/ECNU-ICALKGitHub ↗
claude-code
Install
npx skills add ECNU-ICALK/AutoSkill --skill 实现并集成ciou损失函数 --agent claude-code

Same command for any agent — swap --agent for codex, cursor, copilot.

Facts
Files in the skill folder: 1
SKILL.md size: 2 KB
Bundled scripts: none
Version: 0.1.0
Path: SkillBank/ConvSkill/chinese_gpt4_8_GLM4.7/实现并集成ciou损失函数/SKILL.md
Open the folder on GitHub →
Where it comes from
Stars: 539
Language: Python

Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.

From the SKILL.md

# 实现并集成CIoU损失函数 该技能用于在PyTorch目标跟踪或检测任务中,将现有的GIoU损失替换为CIoU(Complete IoU)损失。它包括在box_ops工具文件中实现CIoU计算逻辑(考虑重叠面积、中心点距离和宽高比一致性),并在训练Actor的损失计算函数中调用该新损失。 ## Prompt # Role & Objective 你是一个计算机视觉和PyTorch专家。你的任务是在现有的目标跟踪代码库中实现CIoU(Complete IoU)损失函数,以替代原有的GIoU损失。 # Operational Rules & Constraints 1. **CIoU计算逻辑**: - 利用现有的 `generalized_box_iou` 函数获取基础的 IoU 和 GIoU 值。 - 计算宽高比差异项 `v`:$v = \frac{4}{\pi^2}(\arctan\frac{w^{gt}}{h^{gt}} - \arctan\frac{w^{p}}{h^{p}})^2$。 - 计算中心点距离惩罚项:$\frac{\rho^2(b, b^{gt})}{c^2}$。 - 计算权重系数 $\alpha = \frac{v}{(1 - IoU) + v}$。 - 最终CIoU损失公式:$Loss = 1 - (IoU - (\frac{\rho^2}{c^2} + \alpha v))$。 2. **代码集成**: - 在 `box_ops.py` 或类似工具文件中新增 `ciou_loss` 函数。 - 在训练Actor(如 `CEUTrackActor`)的 `compute_losses` 方法中,替换原有的 `giou_loss` 调用为 `ciou_loss`。 - 更新总损失计算公式,确保权重字典中包含 `ciou` 键。 3. **输入输出格式**: - 输入边界框格式通常为 `(N, 4)` 的 `(x1, y1, x2, y2)` 或 `(cx, cy, w, h)`,需确保与现有工具函数兼容。 - 返回标量损失值。 # Anti-Patterns - 不要直接复制粘贴不兼容的代码片段,需根据现有代码风格(如是否使用 `torch.no_grad()` 计算 alpha)进行调整。 - 不要忽略对 `nan` 或异常情况的处理(虽然原代码有 try-except,但新函数内部也应保证数值稳定性)。 # Interaction Workflow 1. 分析现有的 `box_ops.py` 文件,确认 `generalized_box_iou` 的存在和签名。 2. 编写 `ciou_loss` 函数,复用 `generalized_box_iou` 并添加几何惩罚项。 3. 修改 `CEUTrackActor` 类,在 `com

What's inside
Steps it walks through
  1. Prompt
  2. Triggers
More from AutoSkill
All skills →
About this skill
What does the 实现并集成CIoU损失函数 skill do?

该技能用于在PyTorch目标跟踪或检测任务中,将现有的GIoU损失替换为CIoU(Complete IoU)损失。它包括在box_ops工具文件中实现CIoU计算逻辑(考虑重叠面积、中心点距离和宽高比一致性),并在训练Actor的损失计算函数中调用该新损失。

How do I install it?

Run `npx skills add ECNU-ICALK/AutoSkill --skill 实现并集成ciou损失函数 --agent claude-code` — it drops the skill into your project so the agent can pick it up. Swap the --agent value for codex, cursor or copilot if you use one of those.

Where does this skill come from?

From ECNU-ICALK/AutoSkill, a repository with 539 stars. We read it straight from the repository tree rather than a submitted listing, so what you see here is what is actually published.

Is a popular skill a good skill?

Not necessarily. Stars measure attention, not adoption — a repository can trend for a week and be abandoned. That is why we show the weekly change from our own snapshots next to the total, instead of a single flattering number.

Keep going