This shows you the differences between two versions of the page.
Both sides previous revision Previous revision | |||
products:sbc:vim4:npu:ksnn:demo:ppocr [2025/01/08 22:34] louis |
products:sbc:vim4:npu:ksnn:demo:ppocr [2025/05/12 21:43] (current) louis |
||
---|---|---|---|
Line 121: | Line 121: | ||
==== Picture input demo ==== | ==== Picture input demo ==== | ||
+ | |||
+ | <WRAP important> | ||
+ | The demo use cn rec model. If you want to use other rec model, you need to modify the rec model output and character index dictionary. | ||
+ | |||
+ | ```python ppocr-picture.py | ||
+ | # model input and output | ||
+ | det_input_size = (736, 736) # (model height, model width) | ||
+ | rec_input_size = ( 48, 320) # (model height, model width) | ||
+ | rec_output_size = (40, 97) # rec output | ||
+ | ``` | ||
+ | |||
+ | ```python postprocess.py | ||
+ | character_str = [" | ||
+ | with open(" | ||
+ | lines = fin.readlines() | ||
+ | for line in lines: | ||
+ | line = line.decode(" | ||
+ | character_str.append(line) | ||
+ | character_str.append(" | ||
+ | ignored_token = [0] | ||
+ | ``` | ||
+ | |||
+ | You can find the dictionary txt file in '' | ||
+ | </ | ||
```shell | ```shell |