Files
ssw 792f3d5d02 rocr: 工作空间文档收编进仓库 (docs/+samples/ 重布局)
- 总手册/大图报告/GPU调研/INT8复盘/部署记录 → docs/
- 基准脚本与原始计时 → docs/bench/
- 测试样本图与生成脚本 → samples/
- README 引用与目录结构同步更新
2026-09-12 17:17:41 +08:00

27 lines
821 B
Python

from PIL import Image, ImageDraw, ImageFont
FONT = "/System/Library/Fonts/PingFang.ttc"
lines = [
"离线 OCR 引擎 RustO! 性能测试",
"订单编号:20260911-001",
"合计金额:¥1,280.00(含税)",
"联系电话:138-0000-0000",
"交付地点:福建省龙岩市新罗区",
]
def make(path, W, H, fs, step, x0, y0):
img = Image.new("RGB", (W, H), "white")
d = ImageDraw.Draw(img)
f = ImageFont.truetype(FONT, fs)
y = y0
for ln in lines:
d.text((x0, y), ln, fill=(20, 20, 20), font=f)
y += step
img.save(path)
print("saved", path, W, "x", H)
# 基准小图
make("/tmp/lt-a.png", 800, 320, 34, 52, 40, 30)
# 不同尺寸的第二张(用于测"形状变化触发 session 重规划"的开销)
make("/tmp/lt-b.png", 1000, 400, 34, 62, 50, 40)