feat(ocr): 扫描件与图片识别——OCR 进文字层、资质库上传识别、大图浏览
计划见 docs/architecture/vision-plan.md(VS1–VS13,docs/decisions.md)。 - 验证:OCR(RapidOCR + PP-OCRv6 small,CPU)和 DeepSeek Flash 看图在国动投标文件 和 7 张证书上初测(tech-validation §7,代码 spikes/s5-ocr/) - OCR 服务 services/ocr(镜像、Compose 服务):整页转正(含 180°)、红章附近按红色通道重读 - 扫描页和插图识别后并入文字层 v6,句子标 source=ocr;出处标「OCR」(迁移 0013); 依据识别文字的问题降级,规则不查扫描附件;国动端到端见 check-eval §16 - 资质库上传识别:添加资质对话框最上面传证书照片,识别后填表,只预填和 OCR 文字 对得上的字段;识别值留痕、照片挂成附件(迁移 0014,提示词 vision.cert_fields v1) - 资质库改为查看详情(只读键值 + 附件缩略图),附件用大图浏览控件看,不开新标签页 (设计规范 §7.23);PDF 附件按页出预览图 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
31
services/ocr/pyproject.toml
Normal file
31
services/ocr/pyproject.toml
Normal file
@@ -0,0 +1,31 @@
|
||||
[project]
|
||||
name = "bid-doctor-ocr"
|
||||
version = "0.1.0"
|
||||
description = "标博士 OCR 服务:页面图片 → 文字行 + 坐标(架构 §3.5、vision-plan §4.2)。worker 通过 HTTP 调用,不连数据库"
|
||||
requires-python = ">=3.12"
|
||||
dependencies = [
|
||||
"rapidocr>=3.10,<4", # PP-OCRv6 small 检测 / 识别模型(tech-validation §7.1)
|
||||
"onnxruntime>=1.20",
|
||||
"numpy>=2",
|
||||
"pillow>=11",
|
||||
"fastapi>=0.115",
|
||||
"uvicorn>=0.32",
|
||||
]
|
||||
|
||||
[project.scripts]
|
||||
bid-doctor-ocr = "bid_doctor_ocr.app:main"
|
||||
|
||||
[build-system]
|
||||
requires = ["hatchling>=1.26"]
|
||||
build-backend = "hatchling.build"
|
||||
|
||||
[tool.hatch.build.targets.wheel]
|
||||
packages = ["src/bid_doctor_ocr"]
|
||||
|
||||
[tool.ruff]
|
||||
line-length = 120
|
||||
target-version = "py312"
|
||||
|
||||
[tool.ruff.lint]
|
||||
select = ["E", "F", "W", "I", "B", "UP", "SIM", "RUF", "ASYNC", "S", "BLE"]
|
||||
ignore = ["RUF001", "RUF002", "RUF003", "S101"]
|
||||
Reference in New Issue
Block a user