识别图片文字
2024/10/24 22:44:12
复制
删除
python
from PIL import Image
import pytesseract
# Load the image from the path
image_path = '/mnt/data/2024-10-24-22-1dg8zHuRfWza36DI54Um.jpg'
img = Image.open(image_path)
# Use Tesseract to do OCR on the image
text = pytesseract.image_to_string(img, lang='chi_sim')
text
Result: run failed❌
shell
(1, 'Error opening data file /usr/share/tesseract-ocr/5/tessdata/chi_sim.traineddata Please make sure the TESSDATA_PREFIX environment variable is set to your "tessdata" directory. Failed loading language \'chi_sim\' Tesseract couldn\'t load any languages! Could not initialize tesseract.')
Result: run failed❌
shell
(1, 'Error opening data file /usr/share/tesseract-ocr/5/tessdata/chi_sim.traineddata Please make sure the TESSDATA_PREFIX environment variable is set to your "tessdata" directory. Failed loading language \'chi_sim\' Tesseract couldn\'t load any languages! Could not initialize tesseract.')
It seems that the system is currently unable to process Chinese characters from the image. However, I can manually transcribe the text for you:
PROJECT INFO.
项目名称 | 凤栖江南·杭州老凤祥旗舰店
设计范围 | 空间设计、导视设计、艺术软装
项目地址 | 中国·杭州
室内面积 | 415.0m²
设计时间 | 2022年1月
完成时间 | 2024年6月
总设计师 | 林镇, Gaby.Teng
艺术软装 | 梁蕴, 王悦, 李玉盈
品牌视觉 | 杨龙, 肖萌萌, 龚妙君
项目管理 | 莫自豪, 潘静楠, 刘永红
合作品牌 | 顾和墙纸·Jessica, 诗连达SLENDER, Hesper赫莱照明, Energy能亮手工砖
项目拍摄 | SFAP, DPD杨之毅
特别鸣谢 | 杭州瑞祥珠宝有限公司
|