当前位置: 首页 > news >正文

移动网站有哪些万网空间 wordpress

移动网站有哪些,万网空间 wordpress,网站地址结构,广西网站建设liluokjPPOCRLabel 使用PPOCRLabel对ocr预标注结果进行纠正由于PaddleOCR代码库十分混乱,路径经常乱调pip和代码库的代码#xff08;pip库和源码冲突#xff09;,经常报错#xff0c;因此paddleocr和ppocrlabel都是使用pip包;PPOCRLabel中使用了cv2进行图片数据的读取#xff0c;…PPOCRLabel 使用PPOCRLabel对ocr预标注结果进行纠正由于PaddleOCR代码库十分混乱,路径经常乱调pip和代码库的代码pip库和源码冲突,经常报错因此paddleocr和ppocrlabel都是使用pip包;PPOCRLabel中使用了cv2进行图片数据的读取然cv2对中文路径读取有问题经常会导致一些图片数据无法进行正常数据在次基础上把读取图片由cv2改为pilow可以规避很多读取错误 安装 pip install PPOCRLabel2.1.3启动 PPOCRLabel --lang ch修改记录 修改1 报错AttributeError: ‘NoneType’ object has no attribute ‘shape’ NoneType object has no attribute shape Traceback (most recent call last):File D:\ProgramData\Anaconda3\envs\paddle\lib\site-packages\PPOCRLabel\libs\autoDialog.py, line 41, in runh, w, _ cv2.imdecode(np.fromfile(Imgpath, dtypenp.uint8), 1).shape AttributeError: NoneType object has no attribute shape原因cv2不支持读取带有中文字符路径文件 h, w, _ cv2.imdecode(np.fromfile(Imgpath, dtypenp.uint8), 1).shape解决使用PIL替换cv2, 将上述代码替换为 # 修改文件D:\ProgramData\Anaconda3\envs\paddle\lib\site-packages\PPOCRLabel\libs\autoDialog.py, line 41 # 增加PIL读取图片函数 from PIL import Image def load_image(image_path: str, return_chw: bool True, size: tuple None):image Image.open(image_path).convert(RGB)if size is not None:image image.resize(size) # resize imageimage np.asarray(image)image image[:, :, ::-1] # flip color channels from RGB to BGRw, h image.shape[1], image.shape[0] # update size after resizeif return_chw:image image.transpose(2, 0, 1)return image, (w, h)# 替换上面代码 try:image_data, (w, h) load_image(Imgpath, return_chwFalse) except Exception as e:print(fload file {Imgpath} fail!)continue修改2 报错AttributeError: ‘NoneType’ object has no attribute ‘shape’ Traceback (most recent call last):File D:\ProgramData\Anaconda3\envs\paddle\lib\site-packages\PPOCRLabel\PPOCRLabel.py, line 1889, in saveFileself._saveFile(imgidx, modemode)File D:\ProgramData\Anaconda3\envs\paddle\lib\site-packages\PPOCRLabel\PPOCRLabel.py, line 1934, in _saveFileself.openNextImg()File D:\ProgramData\Anaconda3\envs\paddle\lib\site-packages\PPOCRLabel\PPOCRLabel.py, line 1880, in openNextImgself.loadFile(filename)File D:\ProgramData\Anaconda3\envs\paddle\lib\site-packages\PPOCRLabel\PPOCRLabel.py, line 1550, in loadFileheight, width, depth cvimg.shape AttributeError: NoneType object has no attribute shape原因还是cv2不能读取中文路径文件解决 # 修改: File D:\ProgramData\Anaconda3\envs\paddle\lib\site-packages\PPOCRLabel\PPOCRLabel.py, line 1550, in loadFile # cvimg cv2.imdecode(np.fromfile(unicodeFilePath, dtypenp.uint8), 1) cvimg, _ load_image(unicodeFilePath, return_chwFalse)修改3 报错:error: (-215:Assertion failed) _src.total() 0 in function ‘cv::warpPerspective’ 报错描述在对PPOCRLABEL的框进行重新识别是发生如下报错 Can not recognise the detection box in xxxx,png. Please change manuallyunicodeFilePath is J:\data\mllm-data\xxxxxxxxx\wKh2CWERPJOAY2x-AAE62o598k0620.pngOpenCV(4.2.0) C:\projects\opencv-python\opencv\modules\imgproc\src\imgwarp.cpp:3143: error: (-215:Assertion failed) _src.total() 0 in function cv::warpPerspective原因是我们的ocr预标注数据Label.txt是使用PIL读取图片数据调用ppocr进行生产的并不是在PPOCRLabel工具内部生产的, 当我们修改数据框后, PPOCRLabel尝试再次使用cv2进行读取原图,此时由于cv2对路径较为敏感,经常会读取文件失败,才会出现如上情况 解决 依旧是修改PPOCRLabel源码, 把cv2读取改为PIL读取,就不惯着cv2的臭毛病… # 修改如下代码def reRecognition(self):#img cv2.imdecode(np.fromfile(self.filePath,dtypenp.uint8),1)img, _ load_image(self.filePath, return_chwFalse)修改4 运行PPOCRLabel源码paddleocr使用pip安装,报错 AttributeError: ‘Namespace’ object has no attribute ‘return_word_box’ - File G:\dongyongfei786\paddle\PaddleOCR\ppstructure\predict_system.py, line 82, in __init__self.return_word_box args.return_word_box AttributeError: Namespace object has no attribute return_word_box原因: paddleocr使用pip安装的源码中paddleocr2.7.0.3, D:\ProgramData\Anaconda3\Lib\site-packages\paddleocr\tools\infer\utility.py, 缺少 # extended functionparser.add_argument(--return_word_box, typestr2bool, defaultFalse, helpWhether return the bbox of each word (split by space) or chinese character. Only used in ppstructure for layout recovery)赞赏 都说书中自有黄金屋在这个“以钱为尊”的年代没钱那可是万万不能如果上述对各位帅哥美女有帮助的话也可动一下发财的小手你的支持的我做大的动力后续有需要考虑打成一个whl供需要的小伙伴使用后续如果还有改动会继续更新
http://www.dnsts.com.cn/news/160652.html

相关文章:

  • 深圳平价的专业建站公司杭州网站制作推荐
  • wordpress中注册功能抖音seo软件
  • 嘉兴网站广优化公司广东公司响应式网站建设报价
  • 网站域名 英文工信部网站备案举报
  • 怎么提交网站搜索引擎优化概述
  • 旅游网站设计与建设论文域名过期了怎么办怎么找回网站
  • 上海网站建设治汇网络场所码小程序怎么做
  • 云南省建设厅勘察设计处网站thinkphp做网站快吗
  • 如何seo网站挣钱舆情分析的主要方法
  • 网站如何做邮箱订阅淄博网站制作服务
  • 网站关键词排名手机优化软件做一网站要什么软件
  • 如何自建企业网站北京网站推广价格
  • 哈尔滨网站设计公司电话华电集团班组建设网站
  • 网站如何三合一互联网推广的方式
  • 网站优化西安网站上的验证码怎么做
  • 有特效的网站前端开发面试题
  • 本地手机网站建设服务网站如何做导航
  • 做网站用什么开发好建设厅网站技术负责人要求
  • 做招聘网站需要哪些手续网站建设公司的市场定位
  • 深圳网站优化包年黑龙江省建设会计协会网站首页
  • 地产公司做网站维护写代码么天津业之峰装饰公司官网
  • 网站系统建设的主要意义网站建设业务饱和了吗
  • 网站空间ftp下载慢传媒公司排名前十
  • 珠海网站建设价格网站怎么做关键词搜索
  • 国内做轮胎网站哪家好外贸工厂的网站建设
  • jsp做的零食网站下载网络管理系统中 管理对象是指
  • 大连网站制作选择ls15227网站建设全包广州
  • 河南高端网站建设东营网
  • 地铁工程建设论文投稿网站做设计怎么进公司网站
  • 做电商网站需要注意哪些艺术设计公司名字