PaddlePaddle / PaddlePaddle/FastDeploy
Fastdeploy_python初始化cls_model为None之后,推理图片还是会先检测后进行方向旋转然后给识别模型进行识别
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 3.7k
- Forks
- 756
- Avg merge
- 19h 28m
- Merged PRs (30d)
- 4
Description
环境
- 【FastDeploy版本】: fastdeploy_gpu_python-1.0.7-cp39-cp39
- 【编译命令】通过pip安装的
- 【系统平台】: Linux x64(Ubuntu 22.04)
- 【硬件】:Nvidia GPU 4060
- 【编译语言】:Python(3.9)
ocr初始化模型我是通过该方式初始化的
···
self.ocr = fd.vision.ocr.PPOCRv4(
det_model=det_model, cls_model=None, rec_model=rec_model)
···
然后推理该图片
推理代码:self.ocr.predict(image)
得到结果
det boxes: [[154,33],[189,33],[189,53],[154,53]]rec text: ALT rec score:0.999999
det boxes: [[347,32],[409,32],[409,53],[347,53]]rec text: 0-40U/L rec score:0.992021
det boxes: [[253,35],[263,35],[263,52],[253,52]]rec text: 三 rec score:0.660740
det boxes: [[14,34],[140,34],[140,51],[14,51]]rec text: 丙氨酸氨基转移酶 rec score:0.999998
然后将[[253,35],[263,35],[263,52],[253,52]]手动裁剪出来
可以看到1这个图片识别效果不好,应该是旋转了。
然后我自己将裁剪的图片进行单独的rec识别
结果如下:
['1', 0.9998661279678345]
该如何解决这个自动旋转的问题? cls_model为None也会自动旋转,导致识别不对
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.
Research direction
Start at the Python entry points fd.vision.ocr.PPOCRv4 and self.ocr.predict(image) described in the report. Reproduce with cls_model=None and the supplied cropped image, then trace whether classification and rotation still run. Done means disabling the classifier also prevents automatic rotation while recognition remains correct.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- computer-vision
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100