About ocr-service
ocr-service is a skill for developers who need to extract text from images. Its client offers a health check and returns recognized text, confidence scores, and text-region coordinates.
Key features
- 01Extract text from images
- 02Support multiple image formats and languages
- 03Check service health
- 04Return confidence scores and text-region coordinates
Use cases
- 01Recognize text in images
- 02Check whether the OCR service is running
Install
Copy the command and run it in a terminal.
$
npx skills add https:/ / github.com/ lin-a1/ skills-agent --skill ocr-serviceAfter installing, type/ocr-servicein Claude Code to confirm it loaded.
Bundled files
References and scripts installed along with SKILL.md.
client.pyDockerfileserver.pyDetails
From the project README功能
从图像中提取文字内容,支持多种图像格式和语言。
调用方式
from services.ocr_service.client import OCRServiceClient
client = OCRServiceClient()
# 健康检查
status = client.health_check()
# OCR识别
image_base64 = client.image_to_base64("/path/to/image.jpg")
result = client.ocr(image_base64)
# 获取识别结果
texts = result["rec_texts"] # ["识别的文字1", "识别的文字2", ...]
scores = result["rec_scores"] # [0.98, 0.95, ...]
返回格式
{
"doc_preprocessor_res": {"angle": 0},
"dt_polys": [[x1,y1], [x2,y2], ...],
"rec_texts": ["识别的文字1", "识别的文字2"],
"rec_scores": [0.98, 0.95]
}
字段说明
rec_texts: 识别出的文字列表rec_scores: 每个文字块的置信度dt_polys: 检测到的文本区域坐标
Comments
Markdown supported