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

网站设计技术方案广州网站app制作公司

网站设计技术方案,广州网站app制作公司,海南网站建设服务,wordpress 父分类名称基于PaddleOCR2.7.0发布WebRest服务测试案例 #WARNING: This is a development server. Do not use it in a production deployment. Use a production WSGI server instead. #警告:这是一个开发服务器。不要在生产部署中使用它。请改用生产WSGI服务器。 输出结果…

基于PaddleOCR2.7.0发布WebRest服务测试案例

#WARNING: This is a development server. Do not use it in a production deployment. Use a production WSGI server instead.
#警告:这是一个开发服务器。不要在生产部署中使用它。请改用生产WSGI服务器。

输出结果:

'''
输出结果
["中华人民共和国,0.9899783730506897","居民身份证,0.9980843663215637","祥证,0.8810203075408936","正,0.9998733997344971","签发机关北京市公安商西城分局,0.9768146872520447","有效期限2004.10.27-2024.10.26,0.9777843952178955","姓名金阳,0.9970041513442993","反,0.8982676267623901","性别女,0.9921286702156067","民族汉,0.7694575190544128","出生1978年10月27日,0.9945864081382751","住址北京市西城区复兴门外大,0.9793714284896851","街999号院11号楼3单元,0.997355043888092","样证502室,0.954838752746582","公民身份号码,0.999056339263916","110102197810272321,0.9936114549636841","头杀@刘海波,0.8078877925872803"
]
'''

postman请求格式:
在这里插入图片描述

访问地址:http://127.0.0.1:5000/ocr    post模式 参数image_path  
postman 请求格式
Json格式和 image_path=
''' 
{"image_path" : "E:/project/python/OCR/data/sfz.jpg"
}
'''

安装paddleocr2.7.0

 激活环境
conda activate  d:\programdata\conda\cwgis 
conda deactivate
采用pip模式查询包的版本列表情况
pip index versions  paddleocrpip install paddleocr==2.7.0#兼容性再安装
pip install opencv-python==4.4.0.46
pip install click==8.1.3 
conda install pillow==9.0.1

PaddleOCR版本列表情况

C:\Users\hsgpc>pip index versions  paddleocr
WARNING: pip index is currently an experimental command. It may be removed/changed in a future release without prior warning.
paddleocr (2.7.0.2)
Available versions: 2.7.0.2, 2.7.0.1, 2.7.0.0, 2.6.1.3, 2.6.1.2, 2.6.1.1, 2.6.1.0, 2.6.0.3, 2.6.0.2, 2.6.0.1, 2.6, 2.5.0.3, 2.5.0.2, 2.5, 2.4.0.4, 2.4.0.3, 2.4.0.2, 2.4.0.1, 2.4, 2.3.0.2, 2.3.0.1, 2.3, 2.2.0.2, 2.2.0.1, 2.2, 2.0.6, 2.0.5, 2.0.4, 2.0.3, 2.0.2, 2.0.1, 1.1.1, 1.0.1, 1.0.0, 0.0.3.1, 0.0.3, 0.0.2, 0.0.1.1C:\Users\hsgpc>

测试的发布服务的代码:

from flask import Flask, request, jsonify
from paddleocr  import PaddleOCR#报错:ImportError: cannot import name 'ParameterSource' from 'click.core'
#pip index versions click   #查看版本号列表
#随机选择一个版本8.0.0版本,安装时提示flask 2.3.2 requires click>=8.1.3,
#故再次选择安装8.1.3版本 OK
#pip install click==8.1.3# need to run only once to download and load model into memory
p = PaddleOCR(use_angle_cls=True, lang="ch")  print(__name__)     #__main__
app = Flask(__name__)#定义 get 方法 /v
@app.route('/v', methods=['get'])
def v():return "1.0.0"#定义 post  方法  /ocr
@app.route('/ocr', methods=['POST'])
def ocr():data = request.get_json()image_path = data['image_path']  # 从请求中获取图像路径print('image_path=',image_path)#ocr_result = PaddleOCR.ocr(image_path, use_gpu=False)  # 调用PaddleOCR模型进行图像识别ocr_result = p.ocr(image_path, cls=True)h_result=[]index=1for line in ocr_result:   for detection in line:t=detection[1][0]+","+str(detection[1][1])h_result.append(t)index+=1return jsonify(h_result)  # 将识别结果以JSON格式返回给客户端if __name__ == '__main__':app.run()#http://127.0.0.1:5000/v     #OK

本blog地址:https://blog.csdn.net/hsg77
—the—end—

http://www.yayakq.cn/news/518454/

相关文章:

  • 做书的网站有哪些内容吗重庆关键词排名推广
  • 赣州做网站的公司腾讯企业邮箱登录入口手机版
  • 嘉兴网站建议绵阳市公司网站建设
  • 怎么做58同城网站吗网络平台推广具体是干啥
  • 怎么建设ftp网站互联网产品设计公司
  • 济南网站建设方案报价聚名网怎么提现
  • 做地产网站哪家好dw怎么做jsp网站
  • 企业网站建设的申请优化 英语
  • 2019一个网站开发要多少钱wordpress流量统计代码
  • 早那么做商城网站网站建设 部署与发布视频
  • 南京移动网站建设效果好黄冈贴吧黄冈论坛吧
  • 哪个网站做课件ppt比较好wordpress官方的三个主题好排名
  • 网站建设的费用预算如何写做企业网站服务商
  • 中国十大黄页网站排行榜wordpress添加子菜单
  • 贵州网站备案查询网络游戏网站建设论文
  • 山东青?u68元建网站河北邢台重大新闻
  • 温岭市住房和城乡建设局网站淘宝网站开发源码
  • 商业网站设计与制作合肥小程序开发
  • 哈尔滨精品网站制作哈尔滨网页设计模板网站
  • 织梦网站上传及安装步骤哪个网站用div做的好
  • 贵州华瑞网站建设有限公司山东济南seo整站优化费用
  • 支持微信支付的网站开发怎么创一个网站
  • 青岛胶东建设国际机场网站新乡网站建设那家好
  • 优质做网站价格企业网站seo诊断工具
  • 建设银行中国网站首页品牌建设中企业要注意哪些问题
  • 漂亮网站底部代码怎么做和京东一样网站
  • 电子烟网站建设黄骅市邮编
  • 大型网站 phpwordpress 4.0 中文
  • 巴彦淖尔市网站建设网易企业邮箱满了怎么办
  • 卖网站链接南宁h5建站