当前位置: 首页> 娱乐> 八卦 > 虾皮跨境电商可靠吗_系统模板html_2345网址导航智能主板_湖北seo推广

虾皮跨境电商可靠吗_系统模板html_2345网址导航智能主板_湖北seo推广

时间:2025/7/17 23:54:18来源:https://blog.csdn.net/weixin_42140236/article/details/144673619 浏览次数:0次
虾皮跨境电商可靠吗_系统模板html_2345网址导航智能主板_湖北seo推广

DataBall 助力快速掌握数据集的信息和使用方式,会员享有 百种数据集,持续增加中。 

需要更多数据资源和技术解决方案,知识星球: “DataBall - X 数据球(free)”

-----------------------------------------------------------------

Paddle OCR 中英文检测识别

具体实现代码如下:

#-*-coding:utf-8-*-
# date:2024-12-22
# Author: DataBall - XIAN
# Function:  OCR 检测识别import os
import cv2
import numpy as np
import time
from paddleocr import PaddleOCRif __name__ == '__main__':if False: # 中文cls_model_dir='paddleModels/whl/cls/ch_ppocr_mobile_v2.0_cls_infer'rec_model_dir='paddleModels/whl/rec/ch/ch_PP-OCRv4_rec_infer'ocr = PaddleOCR(use_angle_cls=True, lang="ch", det=False,cls_model_dir=cls_model_dir,rec_model_dir=rec_model_dir)  # need to run only once to download and load model into memoryelse: # 英文# ocr = PaddleOCR(use_angle_cls=True, lang="en")cls_model_dir='paddleModels/whl/cls/en_ppocr_mobile_v2.0_cls_infer'rec_model_dir='paddleModels/whl/rec/ch/en/en_PP-OCRv4_rec_infer'ocr = PaddleOCR(use_angle_cls=True, lang="en", det=False,cls_model_dir=cls_model_dir,rec_model_dir=rec_model_dir)  # need to run only once to download and load model into memoryimg_path = "image/2.png"img = cv2.imread(img_path)result_det = ocr.ocr(img, cls=True)print(type(result_det))result_det = result_det[0]idx_ = 0for m_ in result_det:idx_ += 1bbox_,contant_ = m_print("[{}] bbox: {}, contant: {}".format(idx_,bbox_,contant_))pts = np.array(bbox_).astype(np.int32)pts = pts.reshape((-1,1,2))# 绘制区域cv2.polylines(img,[pts],True,(255,22,150),1)cv2.namedWindow("img",0)cv2.imshow("img",img)cv2.waitKey(0)cv2.imwrite("out.png",img)

示例如下:

 ​​​​​​

助力快速掌握数据集的信息和使用方式。

数据可以如此美好!

关键字:虾皮跨境电商可靠吗_系统模板html_2345网址导航智能主板_湖北seo推广

版权声明:

本网仅为发布的内容提供存储空间,不对发表、转载的内容提供任何形式的保证。凡本网注明“来源:XXX网络”的作品,均转载自其它媒体,著作权归作者所有,商业转载请联系作者获得授权,非商业转载请注明出处。

我们尊重并感谢每一位作者,均已注明文章来源和作者。如因作品内容、版权或其它问题,请及时与我们联系,联系邮箱:809451989@qq.com,投稿邮箱:809451989@qq.com

责任编辑: