五月天青色头像情侣网名,国产亚洲av片在线观看18女人,黑人巨茎大战俄罗斯美女,扒下她的小内裤打屁股

歡迎光臨散文網(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)遵守國家法律
威信县| 易门县| 红河县| 句容市| 顺平县| 咸宁市| 巴里| 丹巴县| 通渭县| 博湖县| 庆城县| 安顺市| 黄梅县| 荃湾区| 甘泉县| 佛冈县| 邵武市| 天祝| 临沧市| 遂平县| 新余市| 中江县| 临沧市| 勐海县| 鲁山县| 连平县| 和硕县| 合阳县| 斗六市| 白朗县| 康乐县| 尼勒克县| 仁怀市| 昌都县| 黎平县| 亳州市| 雅安市| 威信县| 益阳市| 龙门县| 马龙县|