Gmgge / ImageAnalysisService

轻量模型的图像分析web服务,包括倾斜矫正OCR,公章(印章)检测+识别,车牌识别。api方案使用FastAPI+Gunicorn,提供gradio展示。
78 stars 11 forks source link

IndexError: boolean index did not match indexed array along dimension 0 #11

Closed zealinux closed 6 months ago

zealinux commented 6 months ago

出错日志:

IndexError: boolean index did not match indexed array along dimension 0; dimension is 2704 but corresponding boolean dimension is 80

core.analysis_pipeline.analysis_pipeline:analysis_image:62 - 任务:seal_rec分析失败

File "/home/ubuntu/Sandbox/ImageAnalysisService/utils/compute/bbox_nms.py", line 43, in multiclass_nms bboxes_i = bboxes_i[scores_i > score_threshold]

Gmgge commented 6 months ago

你好,可以给出最小复现代码嘛?你这边是自己训练了印章的检测模型吗?

zealinux commented 6 months ago

你好,可以给出最小复现代码嘛?你这边是自己训练了印章的检测模型吗?

你好,我是在网上随便找了些印章检测模型,都是这样的错误,我估计应该是模型适配的问题。

Gmgge commented 6 months ago

是的哦,推荐使用paddledetection进行训练,我在 https://github.com/Gmgge/TrOCR-Seal-Recognition 项目中分享了印章检测的数据集,处理一下,仅保留圆形印章标签即可训练。