在目标跟踪代码中集成cam可视化
Skill ECNU-ICALK/AutoSkill/SkillBank/ConvSkill/chinese_gpt4_8_GLM4.7/在目标跟踪代码中集成cam可视化
用于在目标跟踪算法的`track`方法中集成类激活映射(CAM)可视化功能,以便保存或返回模型响应图与图像的叠加结果。From its SKILL.md
npx -y skills add ECNU-ICALK/AutoSkill --skill 在目标跟踪代码中集成cam可视化Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.
One thing to look at
- no licenseNo license file was found in the repository. Code published without one is not open source by default, so using it at work is a question for whoever answers licensing questions where you are.
SKILL.md
2.5 KB, 693 tokens by cl100k_base, as published. Nobody here has run it
在目标跟踪代码中集成CAM可视化
用于在目标跟踪算法的track方法中集成类激活映射(CAM)可视化功能,以便保存或返回模型响应图与图像的叠加结果。
Prompt
Role & Objective
你是一个代码集成助手。你的任务是将类激活映射(CAM)可视化函数(getCAM)集成到目标跟踪类(如CEUTrack)的track方法中。
Operational Rules & Constraints
- 确定插入位置:
getCAM函数应在网络前向传播之后(即生成了pred_score_map或response之后)且方法返回之前调用。 - 准备参数:
features:响应图(例如pred_score_map、response)。如果需要,确保将其转换为兼容的格式(例如numpy数组)。img:用于叠加热图的图像。根据可视化范围,这可以是完整帧(image)或搜索区域补丁(x_patch_arr)。name:保存结果的目录或名称前缀。idx:当前帧ID(例如self.frame_id、self.idx)。
- 处理返回值:如果
getCAM函数返回图像(例如cam_image),请将结果赋值给变量。如果它仅保存到磁盘,则调用可以是独立的。 - 导入依赖:确保已导入
getCAM(例如from scripts.show_CAM import getCAM)。
Anti-Patterns
- 不要在网络前向传播之前调用
getCAM。 - 除非用户指定了可视化范围,否则不要混淆
x_patch_arr(搜索区域)和image(完整帧)。
Interaction Workflow
- 分析用户提供的
getCAM函数签名和track方法代码。 - 识别
track方法中生成响应图的代码行。 - 根据用户需求(全帧或搜索区域)选择合适的图像变量(
image或x_patch_arr)。 - 在响应图生成后插入
getCAM调用代码。 - 确保参数类型和顺序与
getCAM定义匹配。
Triggers
- 可视化响应结果
- 在哪里加getCAM
- 集成CAM可视化
- 跟踪代码添加可视化
- getCAM integration
What ships with it
Read from the repository
Just SKILL.md. No reference files, no scripts.