chineseocr / chineseocr

yolo3+ocr
MIT License
5.95k stars 1.73k forks source link

大神,切换到darknet模型请求接口报错可有什么地方要改的 #351

Open xiaodongca opened 5 years ago

xiaodongca commented 5 years ago

Traceback (most recent call last): File "/root/anaconda3/envs/chineseocr/lib/python3.6/site-packages/web/application.py", line 257, in process return self.handle() File "/root/anaconda3/envs/chineseocr/lib/python3.6/site-packages/web/application.py", line 248, in handle return self._delegate(fn, self.fvars, args) File "/root/anaconda3/envs/chineseocr/lib/python3.6/site-packages/web/application.py", line 488, in _delegate return handle_class(cls) File "/root/anaconda3/envs/chineseocr/lib/python3.6/site-packages/web/application.py", line 466, in handle_class return tocall(*args) File "/root/chineseocr/app.py", line 172, in POST rightAdjustAlph=0.01,##对检测的文本行进行向右延伸 File "/root/chineseocr/main.py", line 93, in model boxes,scores = self.box_cluster(img,boxes,scores,**args) File "/root/chineseocr/main.py", line 59, in box_cluster scores[:, np.newaxis], TypeError: list indices must be integers or slices, not tuple

Asher-1 commented 5 years ago

修改text/darknet_detect.py文件55行如下即可: import numpy as np return boxes, scores ------> return np.array(boxes), np.array(scores) 注意:这是app仓库版本修改方法,具体master自行修改即可