1 Star 0 Fork 37

jonny chen/eSearch

forked from xsf-root/eSearch 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
before_pack.js 1.35 KB
一键复制 编辑 原始数据 按行查看 历史
xsf-root 提交于 2022-08-27 10:58 . :arrow_up:ocr 离线ocr v3模型
const fs = require("fs");
const path = require("path");
const download = require("download");
exports.default = async function () {
// 重写存储器
const storeindex = path.join(__dirname, "/node_modules/electron-store/index.js");
fs.writeFileSync(
storeindex,
fs
.readFileSync(storeindex)
.toString()
.replace(/ipcMain\.on\(.*\n.*\n.*?;/, "")
);
if (!fs.existsSync("./ocr/ppocr/默认")) {
fs.mkdirSync("./ocr/ppocr/默认", { recursive: true });
fs.writeFileSync(
"./ocr/ppocr/默认/ppocr_det.onnx",
await download(
"https://github.com/xushengfeng/eSearch-OCR/releases/download/3.0.0/ch_PP-OCRv3_det_infer.onnx",
{ rejectUnauthorized: false }
)
);
fs.writeFileSync(
"./ocr/ppocr/默认/ppocr_rec.onnx",
await download(
"https://github.com/xushengfeng/eSearch-OCR/releases/download/3.0.0/ch_PP-OCRv3_rec_infer.onnx",
{ rejectUnauthorized: false }
)
);
fs.writeFileSync(
"./ocr/ppocr/默认/ppocr_keys_v1.txt",
await download("https://github.com/xushengfeng/eSearch-OCR/releases/download/3.0.0/ppocr_keys_v1.txt", {
rejectUnauthorized: false,
})
);
}
};
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
JavaScript
1
https://gitee.com/chenjuanli/eSearch.git
git@gitee.com:chenjuanli/eSearch.git
chenjuanli
eSearch
eSearch
master

搜索帮助