文章预览
项目简介 本项目是使用Python来调用微信本地ocr模型,调用方法完全由QQImpl翻译过来。也就是说该项目只是将原C++代码翻译成了纯Python实现。 温馨提示 该项目自己玩玩就行,不要用于商业用途 使用说明 安装 pip install wechat-ocr 依赖(必要条件) 能运行最新版微信的Windows系统 已经安装最新版微信 Python环境,版本任意 示例 import os import json import time from wechat_ocr.ocr_manager import OcrManager, OCR_MAX_TASK_ID wechat_ocr_dir = "C:\\Users\\Administrator\\AppData\\Roaming\\Tencent\\WeChat\\XPlugin\\Plugins\\WeChatOCR\\7057\\extracted\\WeChatOCR.exe" wechat_dir = "D:\\GreenSoftware\\WeChat\\3.9.6.32" def ocr_result_callback (img_path:str, results:dict) : result_file = os.path.basename(img_path) + ".json" print( f"识别成功,img_path: {img_path} , result_file: {result_file} " ) with open(result_file, 'w' , encoding= 'utf-8' ) as f: f.write(json.d
………………………………