vault backup: 2026-04-24 12:56:16

This commit is contained in:
2026-04-24 12:56:17 +08:00
parent 9b4f89fe45
commit 15d6b14eda
4 changed files with 49 additions and 13 deletions

View File

@@ -4,8 +4,8 @@
"title": "Design ComfyUI video segmentation and tracking", "title": "Design ComfyUI video segmentation and tracking",
"titleGenerationStatus": "success", "titleGenerationStatus": "success",
"createdAt": 1776871296744, "createdAt": 1776871296744,
"updatedAt": 1776997703748, "updatedAt": 1777005991920,
"lastResponseAt": 1776997703748, "lastResponseAt": 1777005991920,
"sessionId": "50e1c568-9493-4c86-8ca1-1f50b0f2e724", "sessionId": "50e1c568-9493-4c86-8ca1-1f50b0f2e724",
"providerState": { "providerState": {
"providerSessionId": "50e1c568-9493-4c86-8ca1-1f50b0f2e724" "providerSessionId": "50e1c568-9493-4c86-8ca1-1f50b0f2e724"
@@ -15,12 +15,12 @@
], ],
"usage": { "usage": {
"model": "kimi-for-coding", "model": "kimi-for-coding",
"inputTokens": 80085, "inputTokens": 86018,
"cacheCreationInputTokens": 0, "cacheCreationInputTokens": 0,
"cacheReadInputTokens": 0, "cacheReadInputTokens": 0,
"contextWindow": 200000, "contextWindow": 200000,
"contextTokens": 80085, "contextTokens": 86018,
"percentage": 40, "percentage": 43,
"contextWindowIsAuthoritative": true "contextWindowIsAuthoritative": true
} }
} }

View File

@@ -179,7 +179,7 @@
} }
], ],
"direction": "horizontal", "direction": "horizontal",
"width": 402.5 "width": 241.5
}, },
"left-ribbon": { "left-ribbon": {
"hiddenItems": { "hiddenItems": {
@@ -195,7 +195,7 @@
"obsidian-excalidraw-plugin:新建绘图文件": false "obsidian-excalidraw-plugin:新建绘图文件": false
} }
}, },
"active": "98c4d568edb73698", "active": "cf6ed9a83174d6d5",
"lastOpenFiles": [ "lastOpenFiles": [
"自动语义分割系统/安装步骤.md", "自动语义分割系统/安装步骤.md",
"自动语义分割系统/系统设计.md", "自动语义分割系统/系统设计.md",

View File

@@ -132,15 +132,37 @@ tags:
2. 连线: 2. 连线:
- `Select Images`(第一帧)的图像输出 → `Sam2Segmentation``image` - `Select Images`(第一帧)的图像输出 → `Sam2Segmentation``image`
- `(Down)Load SAM2Model` 的模型输出 → `Sam2Segmentation``sam2_model` - `(Down)Load SAM2Model` 的模型输出 → `Sam2Segmentation``sam2_model`
- `coordinates_positive`: 填入你的正选点坐标(如 `[[0.45, 0.52]]`
3. 选择以下**任意一种**提示方式填入:
**方式 A手绘 Mask最直观强烈推荐**
-`Select Images` 的图像先连到一个 `Preview Image` 节点
- 在预览图上**右键** → `Open in Mask Editor`
- 用画笔在目标区域涂抹(不需要很精确,覆盖目标大致轮廓即可),点击 **Save to node**
- 将得到的 `mask` 连到 `Sam2Segmentation``mask` 输入
- 这样无需计算精确坐标,手绘的粗略区域即可引导 SAM2 生成分割
**方式 B点坐标适合精确控制**
- `coordinates_positive`: 填入正选点坐标(如 `[[0.45, 0.52]]`
- `coordinates_negative`: 填入反选点坐标(如 `[[0.55, 0.48]]`),如无则留空 - `coordinates_negative`: 填入反选点坐标(如 `[[0.55, 0.48]]`),如无则留空
- `bboxes`: 如使用检测框则填入,否则留空 - > **坐标获取技巧**`Sam2Segmentation` 节点本身不带图像点击界面。你可以:
3. 参数: > - 先用 `Sam2AutoSegmentation`(见 5.2)跑一次,从它输出的 `bbox` 列表中估算目标中心坐标
> - 或将第一帧保存到本地在图像编辑软件如画图、Photoshop中查看鼠标位置的像素坐标再归一化除以图像宽高后填入
**方式 C检测框适合规则形状物体**
- `bboxes`: 填入边界框坐标 `[x1, y1, x2, y2]`
- 可通过 `Florence2 Coordinates``Grounding DINO` 节点自动生成(见第六、七章)
4. 参数:
- `keep_model_loaded`: 可开启(若后续继续用同一模型) - `keep_model_loaded`: 可开启(若后续继续用同一模型)
- `individual_objects`: 根据需求选择(多目标时开启) - `individual_objects`: 根据需求选择(多目标时开启)
4. 输出连到 `image``Preview Image` 查看效果 5. 输出连到 `image``Preview Image` 查看效果
> **坐标格式提示**:请查看该节点说明,确认使用的是**归一化坐标**0~1还是**像素坐标** > **多次迭代的技巧**SAM2 的分割结果对提示位置敏感。如果第一次效果不佳,**不需要重新连线**
> - 若用 **方式 AMask**:重新打开 Mask Editor调整手绘区域再次 Save然后直接点击「运行」
> - 若用 **方式 B坐标**:直接修改 `coordinates_positive` 的数值,再次点击「运行」
>
> 建议先用 **方式 A 手绘 mask** 快速确认目标能被正确分割,然后再根据效果决定视频追踪时使用的精确坐标。
### 5.2 自动分割一切Sam2AutoSegmentation ### 5.2 自动分割一切Sam2AutoSegmentation

View File

@@ -66,11 +66,25 @@ tags:
- 连接: - 连接:
- `Select Images`(第一帧)→ `image` - `Select Images`(第一帧)→ `image`
- `(Down)Load SAM2Model``sam2_model` - `(Down)Load SAM2Model``sam2_model`
**选择以下任意一种提示方式填入:**
- **方式 A手绘 Mask最直观强烈推荐**
- 将图像连到 `Preview Image`,右键预览图 → `Open in Mask Editor`
- 用画笔涂抹目标区域Save 后得到 `mask`,连到 `Sam2Segmentation``mask` 输入
- 无需精确坐标,手绘粗略区域即可引导 SAM2 分割
- **方式 B点坐标适合精确控制**
- `coordinates_positive`: 填入正选点坐标(如 `[[0.45, 0.52]]` - `coordinates_positive`: 填入正选点坐标(如 `[[0.45, 0.52]]`
- `coordinates_negative`: 填入反选点坐标(可选) - `coordinates_negative`: 填入反选点坐标(可选)
- `bboxes`: 如使用检测框则填入,否则留空 - 坐标获取技巧:先用 `Sam2AutoSegmentation` 跑一下看 `bbox` 参考;或在画图软件中读像素坐标再归一化
- **方式 C检测框**
- `bboxes`: 填入边界框 `[x1, y1, x2, y2]`,可通过 Florence-2 / Grounding DINO 自动生成
- 再加一个 `image``Preview Image`,连到 `Sam2Segmentation``mask` 输出 - 再加一个 `image``Preview Image`,连到 `Sam2Segmentation``mask` 输出
- **点击右上角「运行」**,先确认第一帧分割正确 - **点击右上角「运行」**,先确认第一帧分割正确
- **效果不佳时**:直接修改 mask重画或坐标数值再次运行即可快速迭代
### 第 5 步:视频追踪核心链路 ### 第 5 步:视频追踪核心链路