PaddlePaddle / PaddlePaddle/FastDeploy
FastDeploy推理PPocrV3模型问题
@Zheng-Bicheng is already working on this.
Since Apr 25, 2023.
- Dominant language
- Python
- Stars
- 3.7k
- Forks
- 756
- Avg merge
- 19h 28m
- Merged PRs (30d)
- 4
Description
在使用FastDeploy推理PPocrV3模型时,我使用paddle模型转换onnx模型再转成rknn模型在rk3588上进行推理,发现推理结果与在windows上结果差异很大,开始我怀疑是模型在转换过程中出现问题,于是我在pc上对转换后的onnx及paddle原始模型进行推理,发现推理结果受到SetStaticShapeInfer()设置的影响,在pc平台使用paddle模型,onnx模型,在rk3588平台使用rknn模型预测,个模型间预测结果一致,由于我需要在rk3588上部署,所以只能使用固定尺寸的input,请问有何改善的方案
这是我测试用的图片

推理代码使用example中的infer.cc的代码
以下是推理结果
设置:
det_model.GetPreprocessor().SetStaticShapeInfer(false);
rec_model.GetPreprocessor().SetStaticShapeInfer(false);
结果:
det boxes: [[21,4],[278,4],[278,17],[21,17]]rec text: classProgressBar(t.GenericLvj): rec score:0.804982
det boxes: [[54,22],[162,23],[162,40],[54,39]]rec text: def --init--( rec score:0.940800
det boxes: [[88,46],[126,46],[126,62],[88,62]]rec text: self, rec score:0.881771
det boxes: [[90,69],[368,69],[368,82],[90,82]]rec text: iterable: t.optionaz[t.Iterable[vs rec score:0.820816
det boxes: [[87,88],[332,89],[332,106],[87,105]]rec text: length: t.optionazint] = None rec score:0.899627
det boxes: [[89,113],[253,113],[253,127],[89,127]]rec text: fizl_char: str = "#" rec score:0.884660
det boxes: [[88,135],[244,133],[244,147],[88,149]]rec text: empty_char: str = " rec score:0.940556
det boxes: [[88,156],[323,156],[323,171],[88,171]]rec text: bar_template: str = "%(bar)s" rec score:0.921710
det boxes: [[87,177],[231,176],[231,193],[87,194]]rec text: info_sep: str = " rec score:0.912973
det boxes: [[89,200],[258,200],[258,214],[89,214]]rec text: show_eta: bool = True rec score:0.908067
det boxes: [[87,221],[390,222],[390,239],[87,238]]rec text: show_percent: t.optionat[booz] = None, rec score:0.900560
det boxes: [[89,245],[267,245],[267,259],[89,259]]rec text: show_pos: bool = False rec score:0.914557
det boxes: [[87,264],[724,265],[724,283],[87,282]]rec text: item_show_func: t.Optional[t.Callable[[t.Optionat[v]], t.Optional[str]]] = None rec score:0.902894
det boxes: [[88,288],[322,289],[322,303],[88,302]]rec text: label: t.optionaz[str] = None rec score:0.851348
det boxes: [[87,308],[355,309],[355,327],[87,326]]rec text: file: t.optionat[t.TextIo] = None rec score:0.886582
det boxes: [[86,330],[331,332],[331,349],[86,347]]rec text: color: t.optional[booz] : None rec score:0.912155
det boxes: [[89,355],[293,355],[293,369],[89,369]]rec text: update_min_steps: int = 1 rec score:0.904869
det boxes: [[87,376],[213,376],[213,390],[87,390]]rec text: width: int = 30 rec score:0.907129
det boxes: [[67,399],[135,399],[135,413],[67,413]]rec text: -> None: rec score:0.963876
det boxes: [[89,420],[296,420],[296,433],[89,433]]rec text: self.fizl char = fil char rec score:0.815899
det boxes: [[89,444],[312,444],[312,457],[89,457]]rec text: self.empty_char = empty_char rec score:0.906245
det boxes: [[89,465],[344,465],[344,479],[89,479]]rec text: self.bar_template = bar_template rec score:0.943523
设置:
det_model.GetPreprocessor().SetStaticShapeInfer(true);
rec_model.GetPreprocessor().SetStaticShapeInfer(true);
结果:
det boxes: [[19,4],[277,3],[277,15],[19,16]]rec text: classroressarGeneric rec score:0.676173
det boxes: [[56,25],[161,25],[161,39],[56,39]]rec text: def_-int.. rec score:0.552126
det boxes: [[86,46],[128,46],[128,62],[86,62]]rec text: self rec score:0.823751
det boxes: [[88,69],[369,68],[369,82],[88,83]]rec text: itbbe rec score:0.706840
det boxes: [[88,91],[332,91],[332,105],[88,104]]rec text: Lengtht.optionalint]=Nne rec score:0.808381
det boxes: [[88,113],[250,112],[250,126],[88,127]]rec text: fil.char tr "#" rec score:0.608173
det boxes: [[89,136],[256,133],[257,147],[90,150]]rec text: empty.char: str = " n rec score:0.743116
det boxes: [[87,156],[323,157],[323,171],[87,170]]rec text: bartempate t="%bar)s" rec score:0.723324
det boxes: [[87,179],[232,178],[232,192],[87,194]]rec text: info_sp: t " rec score:0.704647
det boxes: [[88,201],[260,202],[260,214],[88,213]]rec text: showeta:bol rue rec score:0.759768
det boxes: [[88,222],[389,222],[389,237],[88,237]]rec text: sherinab rec score:0.615717
det boxes: [[90,246],[266,246],[266,258],[90,258]]rec text: showpo:bol False rec score:0.683770
det boxes: [[87,265],[724,266],[724,282],[87,281]]rec text: rec score:0.000000
det boxes: [[88,288],[321,289],[321,303],[88,302]]rec text: Label:t.optional[st]=None rec score:0.792424
det boxes: [[88,309],[355,311],[355,325],[88,323]]rec text: filenax rec score:0.642089
det boxes: [[88,333],[331,333],[331,347],[88,346]]rec text: coooptionalbNne rec score:0.756318
det boxes: [[90,356],[290,356],[290,368],[90,368]]rec text: updateminsteps: int=1 rec score:0.754334
det boxes: [[87,377],[212,377],[212,391],[87,391]]rec text: with int - 30 rec score:0.665494
det boxes: [[57,399],[136,399],[136,412],[57,412]]rec text: ) > None: rec score:0.822747
det boxes: [[90,422],[292,422],[292,433],[90,433]]rec text: selfill har fill hal rec score:0.656918
det boxes: [[90,445],[310,445],[310,457],[90,457]]rec text: sefemtychremptychr rec score:0.699114
det boxes: [[90,467],[343,467],[343,477],[90,477]]rec text: selfbartemplatebartemplate rec score:0.767005
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.