-
Notifications
You must be signed in to change notification settings - Fork 76
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
开发者方便调用的方式 #28
Comments
通过接口调用是可以的。比如命令行调用: 但是,完全将本项目当成一个子模块来使用可能是不方便的。本软件依赖于前端qml引擎驱动事件循环,也就是无法剥离前端UI、仅运行核心组件。如果将Umi作为子模块,那么也必须带上Umi的完整UI面板。不知道你们可否接受。 |
我不会py,我想在其它语言中通过HTTP调用,修改端口的位置我看到了,看了文档之后我不清楚body需要什么。["--screenshot"]是一个命令吗? 一共有哪些命令。是否可以传输图片的BASE64。期待楼主的回答,谢谢 |
目前HTTP调用尚不完善,仅支持 以js为例: const port = 1224;
const url = `http://127.0.0.1:${port}/argv`; // 接口:/argv
const argv = ["ScreenshotOCR"]; // 指令参数
const data = JSON.stringify(argv);
const options = {
method: "POST",
headers: {
"Content-Type": "application/json",
},
body: data,
};
fetch(url, options)
.then((response) => response.text())
.then((result) => {
console.log(result);
})
.catch((error) => {
console.error(error);
}); 其中你需要往数组 argv 中填写需要发出的指令。常用的指令如下: 弹出主窗口: 暂时不支持传输base64,将在后续完善。 |
如果不强求HTTP调用,只需要本地调用OCR,或者能接受较简单的TCP传输的话,请见: |
好的,我胡乱翻看了一下py源码,http服务是把body转换成了cmd命令去执行,感谢 |
可否将其开发成其他开发者能调用的方式来执行呢?就是其他开发者添加了你们工程的库或者代码后,通过接口的方式调用你们的截屏文字识别功能。
The text was updated successfully, but these errors were encountered: