mirror of
https://github.com/mii443/usls.git
synced 2025-08-22 15:45:41 +00:00
fix: svtr decode bug (#8)
This commit is contained in:
@ -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
|
||||
```
|
||||
|
@ -4,8 +4,8 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
|
||||
// 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<dyn std::error::Error>> {
|
||||
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
|
||||
|
BIN
examples/svtr/text5.png
Normal file
BIN
examples/svtr/text5.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 14 KiB |
@ -72,6 +72,7 @@ impl SVTR {
|
||||
}
|
||||
|
||||
if idx == 0 || idx == self.vocab.len() - 1 {
|
||||
text_ids.push(*text_id);
|
||||
return text_ids;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user