Files
ISISeg/工程分析/实现方案-2026-05-18-17-55-29.md

25 lines
1.0 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# 实现方案
开始时间2026-05-18-17-55-29
## 方案
新增 `scripts/record_demo.py`,在不引入额外大型依赖的情况下生成演示视频:
1. 等待并检查 `http://127.0.0.1:8001/api/health`
2. 如样例视频不存在,则调用 `scripts/generate_sample.sh` 生成合成导丝视频。
3. 使用本机 Chrome headless 对 Web 首页截图。
4. 使用 `curl` 调用 `POST /api/segment` 上传 `storage/samples/synthetic_guidewire.mp4`
5. 读取 API 返回的真实叠加图和掩膜图。
6. 使用 OpenCV 将首页截图、分割结果和指标合成为 mp4。
## 输出路径
- 演示视频:`storage/demos/isiseg_usage_demo.mp4`
- API 响应记录:`storage/demos/latest_demo_response.json`
## 设计选择
- 当前环境没有显示器会话也没有可立即使用的浏览器自动化库Playwright 下载耗时异常,因此改用系统已有 Chrome headless 和 OpenCV 合成可复现演示。
- 演示视频不提交到 git避免仓库体积快速膨胀脚本提交任何时候都能重新录制。