Skip to content

Commit 9a964cd

Browse files
cursoragentznsoftm
andcommitted
Score the user seal crops on a frozen split of their own.
The 229 crops stay off git. Boxes are ink extents, text is left empty, and the 63-image test is reported apart from the 52-page web set. Co-authored-by: Daniel <znsoft@163.com>
1 parent 89f7c2a commit 9a964cd

7 files changed

Lines changed: 666 additions & 1 deletion

File tree

‎docs/data.md‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,8 @@ python training/scripts/collect_web_seals.py \
7272

7373
脚本会问 Bing、百度和 360 图片。Google 图片搜索会 302 跳转,这里不抓。这台机器上百度直接拒绝爬虫。中文查询和 “official round stamp on document” 上 Bing 回的是空页;英文的 notary、corporate seal 查询 Bing 有结果。2026-10-16 这一批留下 401 张:360 图片搜索 350 张,Bing 51 张,百度 0 张。来源页的版权仍归原站,这些图只做内部训练和评测。清单里的 `model_text` 是现有模型在原图上的自动结果。这一版平均每张标出十几个框,环文经常塌成同一小撮字,不能直接当评测或训练标签。`spot_check` 只覆盖抽看过的 9 张。
7474

75-
固定划分写在 `training/manifests/web_seals_split.jsonl`,不随新增文件重抽:sha256 前 8 位转成整数后模 10,小于 3 为测试,其余可训练;拼图只进训练。文章页和商品图整类排除,不用作空负样本,因为页面上往往还有章,标成空会教检测器把章压掉。只有审成「无关」的页是空负样本。框是红蓝墨连通域,再对上审阅时给的大致区域;彩色页上没有红蓝墨的框丢掉。当前清单是训练 137 页、测试 52 页、排除 191 页、没有可用框而跳过 21 页。测试集上的文字几乎是空的,整串命中不以这 52 页为准。图片在 `/home/mayong/rapidstamp/real/web`(训练)和 `/home/mayong/rapidstamp/real/web_test`(测试,目录名是 `det/val`,这样评测脚本不用改)。
75+
固定划分写在 `training/manifests/web_seals_split.jsonl`,不随新增文件重抽:sha256 前 8 位转成整数后模 10,小于 3 为测试,其余可训练;拼图只进训练。文章页和商品图整类排除,不用作空负样本,因为页面上往往还有章,标成空会教检测器把章压掉。只有审成「无关」的页是空负样本。框是红蓝墨连通域,再对上审阅时给的大致区域;彩色页上没有红蓝墨的框丢掉。当前清单是训练 137 页、测试 52 页、排除 191 页、没有可用框而跳过 21 页。测试集上的文字几乎是空的,整串命中不以这 52 页为准。图片在 `/home/mayong/rapidstamp/real/web`(训练)和 `/home/mayong/rapidstamp/real/web_test`(测试,目录名是 `det/val`,这样评测脚本不用改)。这 52 页不再重抽。
76+
77+
用户另交的一批裁图在 `/home/mayong/datasets/user_seals/`(`images/` 与 `compound-img/`,229 张 png,压缩包里没有转写)。导入脚本是 `training/scripts/import_user_seals.py`。框是红、蓝或灰扫描上的深色墨外接矩形,每张图一枚章。形状按框的长短边和四角是否还有墨来定;这一批四角是纸、长短边接近,类别都是 `round_official`。没有可靠转写,金标准文字留空,不用模型输出回填。同一拍摄(文件名去掉末尾 `_N`)或像素完全相同的文件合成一组,按组名的 sha256 前 8 位模 10,小于 3 为测试,其余训练。像素完全相同的副本只保留一份,避免测试图再进训练。清单是 `training/manifests/user_seals_split.jsonl`。图片在 `/home/mayong/rapidstamp/real/user_seals`(训练)和 `/home/mayong/rapidstamp/real/user_seals_test`(测试)。这批的精确率、召回和 mAP 单独报告,不并进上面那 52 页。2026-10-16 用已发布检测器(得分阈值 0.25)在 63 张测试裁图上:精确率 0(0/2)、召回 0(0/63)、mAP50 0、约 24 ms/张。把阈值降到 0.05 后仍没有一个预测框和金标准的 IoU 达到 0.5,打出来的是章内部的小碎片,而不是铺满画面的整枚章。文字没有金标准,整串命中不在这批上计算。
7678

7779
ReST 的测试图没有转写,脚本不使用 `test_images.zip`。有标注的 5,000 张里大约 10% 按 id 留作验证。检测框是贴回文档页的整枚裁图;标题多边形只说明字在哪,不当作印章外框。

‎models/metrics.json‎

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,22 @@
105105
"ms_per_image": 268.15212769221176
106106
}
107107
},
108+
"user_seals_test": {
109+
"images": 63,
110+
"gt_seals": 63,
111+
"train_images": 156,
112+
"duplicate_images": 10,
113+
"split": "capture-group sha256 prefix mod 10 < 3; exact copies not written twice; not mixed into the 52-page web test",
114+
"class": "round_official",
115+
"text_status": "unverified",
116+
"precision50": 0.0,
117+
"recall50": 0.0,
118+
"det_map50": 0.0,
119+
"predictions": 2,
120+
"text_n": 0,
121+
"ms_per_image": 24.343579127046738,
122+
"score_0.05_iou50_hits": 0
123+
},
108124
"rejected_name_rec": {
109125
"published": false,
110126
"reason": "paddle title fell and square strips stayed 0/137",

‎python/src/rapidstamp/models/metrics.json‎

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,22 @@
105105
"ms_per_image": 268.15212769221176
106106
}
107107
},
108+
"user_seals_test": {
109+
"images": 63,
110+
"gt_seals": 63,
111+
"train_images": 156,
112+
"duplicate_images": 10,
113+
"split": "capture-group sha256 prefix mod 10 < 3; exact copies not written twice; not mixed into the 52-page web test",
114+
"class": "round_official",
115+
"text_status": "unverified",
116+
"precision50": 0.0,
117+
"recall50": 0.0,
118+
"det_map50": 0.0,
119+
"predictions": 2,
120+
"text_n": 0,
121+
"ms_per_image": 24.343579127046738,
122+
"score_0.05_iou50_hits": 0
123+
},
108124
"rejected_name_rec": {
109125
"published": false,
110126
"reason": "paddle title fell and square strips stayed 0/137",

0 commit comments

Comments
 (0)