sceptre-integrating-rust
Embed Sceptre OCR in Rust with Reader, decoded images, model providers and structured error handling.
来源信息
- 仓库
- xberg-io/sceptre
- 最近来源活动
- 2026年10月14日 17:09
- 检测到的 SKILL.md 语言
- 英语
- 星标
- 18
- 分支
- 1
安装方式
默认使用会先检查来源的 Prompt;你也可以切换为直接命令,或下载本地副本。
检查来源文件
决定是否安装前,请先阅读 SKILL.md,以及 SkillsMP 当前展示的配套文件。
文件资源管理器
2 个文件正在显示 SKILL.md
SKILL.md
来源说明 · 只读预览- description
- Embed Sceptre OCR in Rust with Reader, decoded images, model providers and structured error handling.
- name
- sceptre-integrating-rust
<!--
AI-RULEZ :: GENERATED FILE — DO NOT EDIT
Content-Hash: blake3:8a2764e592fca4078d462d08b57a3bed76460dc415af41bc7ff745857663b731
Source-Hash: blake3:5c8442fa8b2f9f7d5d68801c4562f6bf03cc6e52237900bbcf720e4b5bedfa5e
Schema-Version: v1
-->
# Integrating Rust
Add `sceptre = { version = "0.8", features = ["ort-bundled", "download"] }` to Cargo dependencies.
The library default features are empty; select a backend explicitly.
```rust
use sceptre::{ReadOptions, Reader};
use std::path::Path;
let reader = Reader::builder().build()?;
let result = reader.readtext(Path::new("receipt.png"), &ReadOptions::default())?;
```
Reuse the reader across images. Call `warm_up()` or build with `build_warmed()` to move model
initialization out of the first request. Structured lines expose text, confidence and quadrilateral.
For encoded bytes, decode with `Image::from_bytes`, then call `Reader::recognize(&image, &options)`.
`Reader::detect` and `Reader::recognize_line` also accept decoded `Image` values.
Configure the reader through `Reader::builder().config(OcrConfig::default())`;
provide a `ModelProvider` through `.model_provider(...)` for managed or offline assets.
Propagate `OcrError` with the failed operation's context; do not convert errors into empty text.
在 GitHub 查看