diff --git a/examples/svtr/README.md b/examples/svtr/README.md index 6c94700..ba62fa6 100644 --- a/examples/svtr/README.md +++ b/examples/svtr/README.md @@ -24,8 +24,9 @@ cargo run -r --example svtr ## Results ```shell -[Texts] from the background, but also separate text instances which -[Texts] are closely jointed. Some examples are illustrated in Fig.7. +[Texts] from the background, but also separate text instances which +[Texts] are closely jointed. Some examples are illustrated in Fig.7. [Texts] 你有这么高速运转的机械进入中国,记住我给出的原理 [Texts] 110022345 +[Texts] 冀B6G000 ``` diff --git a/examples/svtr/main.rs b/examples/svtr/main.rs index 3ca77b1..b86fa86 100644 --- a/examples/svtr/main.rs +++ b/examples/svtr/main.rs @@ -4,8 +4,8 @@ fn main() -> Result<(), Box> { // build model let options = Options::default() .with_i00((1, 2, 8).into()) - .with_i03((320, 1500, 2200).into()) - .with_confs(&[0.6]) + .with_i03((320, 960, 1600).into()) + .with_confs(&[0.4]) .with_vocab("../ppocr_rec_vocab.txt") .with_model("../models/ppocr-v4-svtr-ch-dyn.onnx"); let mut model = SVTR::new(&options)?; @@ -16,6 +16,7 @@ fn main() -> Result<(), Box> { DataLoader::try_read("./examples/svtr/text2.png")?, DataLoader::try_read("./examples/svtr/text3.png")?, DataLoader::try_read("./examples/svtr/text4.png")?, + DataLoader::try_read("./examples/svtr/text5.png")?, ]; // run diff --git a/examples/svtr/text5.png b/examples/svtr/text5.png new file mode 100644 index 0000000..2ced5b2 Binary files /dev/null and b/examples/svtr/text5.png differ diff --git a/src/models/svtr.rs b/src/models/svtr.rs index 4eaf4fd..5944e5f 100644 --- a/src/models/svtr.rs +++ b/src/models/svtr.rs @@ -72,6 +72,7 @@ impl SVTR { } if idx == 0 || idx == self.vocab.len() - 1 { + text_ids.push(*text_id); return text_ids; }