国产精品天干天干,亚洲毛片在线,日韩gay小鲜肉啪啪18禁,女同Gay自慰喷水

歡迎光臨散文網(wǎng) 會(huì)員登陸 & 注冊(cè)

利用MindSpore實(shí)現(xiàn)VI-LayoutXLM模型

2023-07-14 10:36 作者:玄兎  | 我要投稿

?本文參考地址:https://github.com/PaddlePaddle/PaddleOCR/blob/release/2.6/doc/doc_ch/quickstart.md

前置mindspore安裝參考我的acfun教程:https://www.acfun.cn/a/ac41786362


清華鏡像:(如果pip出問題就在后面加這個(gè))

-i https://pypi.tuna.tsinghua.edu.cn/simple

具體步驟:

打開pycharm的控制臺(tái)

安裝PaddlePaddle(cpu平臺(tái))

python3 -m pip install paddlepaddle -i https://mirror.baidu.com/pypi/simple


安裝PaddleOCR whl包

pip install "paddleocr>=2.0.1" -i https://pypi.tuna.tsinghua.edu.cn/simple


PaddleOCR提供了一系列測試圖片,點(diǎn)擊這里下載并解壓,然后在終端中切換到相應(yīng)目錄(/path/to/ppocr_img填你實(shí)際的目錄)

cd /path/to/ppocr_img


檢測+方向分類器+識(shí)別全流程:--use_angle_cls true設(shè)置使用方向分類器識(shí)別180度旋轉(zhuǎn)文字,--use_gpu false設(shè)置不使用GPU

paddleocr --image_dir ./imgs/11.jpg --use_angle_cls true --use_gpu false


提示沒有paddle包:

安裝:

python -m pip install paddlepaddle==2.4.2 -i https://pypi.tuna.tsinghua.edu.cn/simple

參見:https://www.paddlepaddle.org.cn/、


再次出現(xiàn)問題:ImportError: numpy.core.multiarray failed to import

在終端輸入:

python

import numpy

print(numpy.__path__)

exit()

刪除顯示的路徑

重新安裝numpy

調(diào)試程序:檢測+方向分類器+識(shí)別全流程

from paddleocr import PaddleOCR, draw_ocr

ocr = PaddleOCR(use_angle_cls=True, lang="ch")
img_path = r"C:\Users\34476\Desktop\賽題四所需\ppocr_img\ppocr_img\imgs\11.jpg"
result = ocr.ocr(img_path, cls=True)
for idx in range(len(result)):
? ?res = result[idx]
? ?for line in res:
? ? ? ?print(line)

from PIL import Image

result = result[0]
image = Image.open(img_path).convert('RGB')
boxes = [line[0] for line in result]
txts = [line[1][0] for line in result]
scores = [line[1][1] for line in result]
font_path = r"C:\Users\34476\Desktop\賽題四所需\ppocr_img\ppocr_img\fonts\simfang.ttf"
im_show = draw_ocr(image, boxes, txts, scores, font_path=font_path)
im_show = Image.fromarray(im_show)
im_show.save('result.jpg')



結(jié)果



利用MindSpore實(shí)現(xiàn)VI-LayoutXLM模型的評(píng)論 (共 條)

分享到微博請(qǐng)遵守國家法律
自治县| 庆云县| 怀宁县| 南安市| 阳泉市| 鄱阳县| 三门峡市| 利川市| 万全县| 精河县| 广东省| 奉贤区| 山阳县| 商洛市| 黄浦区| 正宁县| 青冈县| 兰西县| 平果县| 柏乡县| 松阳县| 大宁县| 厦门市| 腾冲县| 望谟县| 理塘县| 沐川县| 平南县| 筠连县| 莒南县| 包头市| 广饶县| 鸡东县| 共和县| 桐城市| 佛山市| 溧水县| 鄂州市| 潍坊市| 新郑市| 海盐县|