csb-report-fill-fyc

CSB-report-fill-fyc: automatic ultrasonic inspection report generation. Fills and produces a complete ultrasonic test report based on the provided “ultrasonic raw data.docx” and the “ultrasonic test report.docx” template. Triggered when users request actions such as "fill report", "produce report", "generate inspection report", or "put data into template".

Installation

Review the source and dependencies with a prompt. A package is available to download.

Install with an AI assistant

Copy the prompt so your assistant can review the pinned revision and dependencies first.

View promptHide prompt
Check whether SkillPI Skill Finder is installed for your current agent. If it is missing, install and enable it using the official instructions at https://github.com/Findskills/skillpi. Then use Skill Finder to locate and install "csb-report-fill-fyc" from this exact SkillPI detail page: https://skillpi.com/skills/deepskill-1c2532a4cf9ae78d850bf7f2034565af636d48a9054cdc63a012572a5e5b7b21. Verify the upstream source and version against https://skillhub.cn/skills/user_bef44692/csb-report-fill-fyc before installing. If they do not match, stop and report the mismatch. Report the installed path and source version.

Source and setup

skillhub.cn

Setup guidance pending

See the original source for supported tools, dependencies, and permissions.

Installation test pending

CSB-report-fill-fyc: automatic ultrasonic inspection report generation. Fills and produces a complete ultrasonic test report based on the provided “ultrasonic raw data.docx” and the “ultrasonic test report.docx” template. Triggered when users request actions such as "fill report", "produce report", "generate inspection report", or "put data into template".

0 Downloads

Introduction source: third_party · user_bef44692 · 2.8.0 Reference

SkillPi interpretation

Tasks
Translation pending; see source documentation.
Software, accounts and paid services
Translation pending; see source documentation.
Limits and differences
Translation pending; see source documentation.
Testing
Not tested

Browse files

Browse files at the source ↗

Original SKILL.md

Open original ↗
Frontmatter
name: ultrasonic-report-fill
description: "根据超声波原始数据.docx和超声波试验报告.docx模板,自动生成完整的超声波检测报告。当用户要求\"填报告\"、\"出报告\"、\"生成检测报告\"、\"把数据填入模板\"时触发。"

超声波检测报告生成 Skill (v2.8)

v2.8 变更:快速路径改用 engine.recognize_txt() 批量 rec, 跳过 det+cls, 提速 ~9 倍。

  • 批量 rec:3 个窄带一次 recognize_txt(List[np.ndarray]) 批量识别, 仅走 rec 模型
  • 跳过 det+cls:窄带已精确裁剪, 不需要检测和分类, 省 2 个模型推理
  • 保留原 ocr_fast_path() 备用:精度更高但慢 (3 次 det+cls+rec)
  • 实测 501 张: v2.7 的 741s (12min) → v2.8 的 ~80s (1.3min), 提速 8.8 倍

v2.7 变更:OCR 流程重构为「样片预扫描 + 固定 y 坐标窄带裁剪」, 并改为单进程执行。

  • 预扫描:取前 3 张样片整图 OCR, 提取 4 个标题行 y 中心并验证稳定性 (跨度 ≤5px)
  • 快速路径:稳定性达标后, 后续图片直接用固定 y 坐标 ±10px 窄带裁剪 OCR, 跳过整图 OCR
  • 回退机制:预扫描失败 → 全量走原两轮策略; 单图窄带识别失败 → 该图回退两轮
  • 单进程:移除 multiprocessing.Pool, 单进程顺序执行, 进度更可控
  • 实测提速约 18% (鲁寨 502 张样本)

v2.6.1 变更:OCR 引擎由 rapidocr-onnxruntime(已弃用,不支持 Python 3.13)迁移到 rapidocr v3.x + 独立 onnxruntime。

  • 新增 pip 清华镜像配置(setup.sh),新电脑无需手动改源
  • 更新 OCR 方案说明:标注 rapidocr-onnxruntime → rapidocr 迁移

v2.6 变更:裁剪策略改为「标题行精确窄带」。

v2.4 变更:仅保留 PaddleOCR(RapidOCR)引擎,移除 Windows OCR(winrt)与 Tesseract 代码;由 4 字段减少为 3 字段(去掉有效值);4 横带改为裁顶部 1/4 后 3 等分。

v2.3 变更:新增可选 PaddleOCR(RapidOCR)引擎,作为 Windows 自带 OCR 的高精度替代。

  • 隔离安装:RapidOCR 装在独立 venv(~/.workbuddy/binaries/python/envs/rapidocr),通过子进程调用,绕开 PaddlePaddle 3.x oneDNN/PIR 算子 bug。
  • 多进程加速:内部 multiprocessing 并行,--concurrency 控制并发(默认 4,上限 8)。

v2.2 变更:OCR 主策略重写为「黑白化 + 横带切片」,并新增日志系统。

  • 预处理:对比度增强(×1.6)再二值化(阈值 128)。
  • 双日志:JSON 结构化 + 纯文本双日志。

前置条件

首次使用前: 确保 RapidOCR 依赖已安装。

RapidOCR 安装在独立 venv:

  • ~/.workbuddy/binaries/python/envs/rapidocr
  • 引擎:rapidocr-onnxruntime(基于 ONNXRuntime,无需 PaddlePaddle)

如果环境未就绪,执行:

bash SKILL_DIR/scripts/setup.sh

核心流程

当用户提供 超声波原始数据.docx 和 超声波试验报告.docx 两个文件时:

用户上传两个文件
     │
     ├─ 超声波原始数据.docx(含逐行检测位置+连续模式图片)
     └─ 超声波试验报告.docx(模板,含三、检测数据表格)
     │
     ▼
1. 将文件保存到本地目录
2. 执行 Python 脚本(RapidOCR 引擎)填入数据
3. 输出「数据已填入超声波试验报告.docx」
4. 返回给用户

详细步骤

Step 1:接收文件

用户会上传两个文件:

  • 超声波原始数据.docx — 包含每行检测位置和连续模式截图
  • 超声波试验报告.docx — 报告模板,含「三、检测数据」表格(6个预置行)

Step 2:执行脚本

python3 SKILL_DIR/scripts/fill_report.py \
  "<raw_path>" \
  "<tmpl_path>" \
  "<out_path>"

可选参数:

  • --limit N:只处理前 N 条(调试用)
  • --concurrency N:(v2.7 已弃用, 单进程执行, 保留向后兼容)

脚本会自动完成:

  1. 读取原始数据中的检测位置和连续模式图片
  2. 预扫描:对前 3 张样片整图 OCR, 提取 4 个标题行 y 中心, 验证稳定性 (跨度 ≤5px)
  3. 批量识别:稳定性达标 → 用固定 y 坐标 ±10px 窄带裁剪, 3 带单独 OCR 取峰值/50Hz/100Hz
  4. 回退:预扫描失败 → 全量两轮策略; 单图窄带失败 → 该图回退两轮
  5. 扩展报告模板表格到足够行数
  6. 填入数据(检测位置、峰值、50Hz、100Hz)
  7. 嵌入连续模式图片到图谱文件列
  8. 按检测位置分组排序
  9. 设置实线边框、宋体 8.5pt 加粗、居中

Step 3:返回结果

将生成的 数据已填入超声波试验报告.docx 返回给用户。

文件说明

文件 说明
scripts/fill_report.py 主处理脚本(Python),调用 paddle_ocr_worker.py 子进程进行批量 OCR
scripts/paddle_ocr_worker.py RapidOCR 子进程识别器(v2.7: 预扫描 + 固定 y 坐标窄带, 单进程)
scripts/setup.sh 依赖安装脚本(安装 rapidocr 环境)
references/full-workflow-reference.md 完整工作流与常见问题参考
references/docx-programmatic-tips.md 程序化操作 docx 的技巧

OCR 方案说明(v2.8 — 样片预扫描 + 批量 rec)

  • 唯一引擎:RapidOCR(rapidocr v3.x + onnxruntime),检测/识别模型与官方 PaddleOCR 一致。
  • 预处理:图片先转灰度并对比度增强(×1.6),再按阈值 128 二值化。
  • 预扫描(一次性):取前 3 张样片整图 OCR → 找到所有 = X mV 标题行 → 按 y 排序 → 得到 4 个 y 中心(有效值/峰值/50Hz/100Hz)→ 验证 3 张样片间 y 坐标跨度 ≤5px
  • 批量 rec(v2.8 快速路径):稳定性达标后, 跳过整图 OCR, 用固定 y 坐标 ±10px 裁剪 3 个窄带(峰值/50Hz/100Hz), 一次 engine.recognize_txt([strip1, strip2, strip3]) 批量识别(仅 rec 模型, 跳过 det+cls)
  • 回退机制:
    • 预扫描失败(样片不足/标题行 <4/y 不稳定)→ 全量走原两轮整图策略
    • 单图批量 rec 失败 → 该图回退两轮策略
  • 优势:批量 rec 比逐带 OCR 快 ~9 倍 (3×(det+cls+rec) → 1×rec); 固定 y 坐标避免柱形图/刻度数字误判
  • 未识别:3 个字段任一缺失 → 整行留空, 结尾打印清单
  • 性能:鲁寨样本 501 张, 单进程约 80 秒完成(v2.7 的 741s, 提速 8.8 倍)

日志文件(v2.2 新增)

运行后与输出 .docx 同目录生成两份日志(时间戳 <YYYYMMDD_HHMMSS>):

  • ultrasonic_fill_<时间戳>.json:结构化详情。含 run_timestamp、ocr_engine、config(CONTRAST/BIN_THRESH/STRIP_LABELS)、images 数组;每个 image 记录 seq/position/img_path/engine、final(识别结果)、status、unrecognized_fields。便于程序化排查每一行的识别数字。
  • ultrasonic_fill_<时间戳>.log:可读文本摘要(Python logging,含时间)。关键节点:每条记录的识别结果、最终 status=success|unrecognized。

注意事项

  • RapidOCR 是确定性引擎,黑白预处理对相同图片字节结果一致;仍建议抽查「未识别成功」清单中的行与图谱对照。
  • 50Hz/100Hz 分量本身很小,大量测点仪器输出即为 0.000 mV,这些 0 是真实读数,并非 OCR 错误。
  • 输出文件约 2.8MB(含 501 张图片,视数据量而定)。
  • 若运行报错提示 RapidOCR 不可用,需先运行 setup.sh 安装 RapidOCR 环境。
  • v2.7 单进程执行, 速度比 v2.6 多进程慢, 但进度可控、无多进程模型加载开销、结果更稳定。如需更快可在 worker 内重新启用 multiprocessing.Pool (回退到 v2.6 备份)。

Current listing version

2.8.0

Verify the source revision ↗

Safety and assessment details

Quality assessment

Out of 100 · Assessment report from SkillPi LAB.

Scenario Value92/100

Areas to improve

  • description写错位置 Reported severity: Minor

    顶层 frontmatter 中 description 为空,实际描述内容位于 skill_body 内部。

    Recommendation: 将 description 内容移至顶层 frontmatter,确保触发解析准确。

Highlights

  • 解决超声波检测报告自动化生成的工程刚需,显著提升行业工作效率
  • 具备完整 OCR 流程与回退机制,适应实际生产环境
Trigger Precision95/100

Highlights

  • 触发词覆盖用户常见表达,边界清晰,误触风险低
Structure and Standards94/100

Areas to improve

  • 缺少When to Use显式章节 Reported severity: Minor

    文档未设置显式 'When to Use' 章节,但核心流程已涵盖使用场景。

    Recommendation: 建议增加 'When to Use' 章节以提升可读性。

  • 文档较长 Reported severity: Minor

    文档内容详尽但篇幅较长,可能影响快速查阅。

    Recommendation: 可考虑将部分技术细节移至 references 文件,主文档保留核心流程。

Highlights

  • 结构完整,含版本记录、前置条件、详细步骤与文件说明
  • 提供完整工作流参考与程序化操作技巧文档
Execution Reliability93/100

Highlights

  • OCR 引擎明确,参数配置清晰,异常处理机制完善
  • 提供结构化与文本双日志,便于问题排查与审计
Evidence Verifiability (mean of the first four)94/100

The arithmetic mean of the first four original scores, rounded to a whole number.

Static text checks

100 / 100 · skillpi-20261123-no-r3-v1

No current rules matched the text.

This score reflects rule matches in the text and is provided for reference before use. It excludes attachments and runtime behavior.

Permissions and checks before use

Automatically summarized from this main document. Matches may be examples or defensive advice; they are not actual permission declarations. Attachments, external dependencies and runtime behavior are not covered.

  • Invoke commands or scripts

    Read the script and arguments first. Use ordinary privileges and a scoped directory; confirm installation or execution in your host tool.

    Mentioned in main document · lines 46

These notices grant no permissions. Your host tool must still confirm file changes, secrets, external transfers or costs as needed.

Security rating and access scope

safe · Static evidence review; not a runtime safety guarantee.

Translation pending; see source documentation.

Before use, confirm and authorize actual file access, external services and network destinations in your host. This review grants no runtime permissions.