Compare commits

..

56 Commits
master ... main

Author SHA1 Message Date
programmerWsy
aa9955d432
docs(readme): add Qwen model interface documentation link 2025-03-28 09:52:43 +08:00
cunninger
7634f61cb9 Merge branch 'main' of https://github.com/Cunninger/ocr-based-qwen 2025-03-26 18:55:12 +08:00
cunninger
ff2d2bf290 fix: update terminology from 'multimodal recognition' to 'OCR text recognition' 2025-03-26 18:54:50 +08:00
programmerWsy
824506d968
docs(readme): add prompt engineering guide supplement 2025-03-25 12:55:00 +08:00
programmerWsy
27aa5e9563
docs: update project showcase image in README 2025-03-22 09:19:59 +08:00
cunninger
95d8f03c48 Add token expiration time display below the Token input field 2025-03-22 09:07:17 +08:00
programmerWsy
b16e2aa34a
docs(images): Update example screenshots in the documentation 2025-03-21 21:26:36 +08:00
programmerWsy
57e5a62ca7
docs(cookie): Add two new cookie examples to README for user reference 2025-03-21 21:24:44 +08:00
programmerWsy
0f5a1dd3ce
Update README.md 2025-03-18 09:35:09 +08:00
programmerWsy
4985cd8ddd
Update README.md 2025-03-18 09:34:02 +08:00
programmerWsy
82c3699e38
Update README.md 2025-03-11 19:39:56 +08:00
programmerWsy
e66d2f91a6
Update README.md 2025-03-11 19:33:24 +08:00
cunninger
2a56afaaf5 feat: upgrade model to qwen-max-latest and update code references 2025-03-11 19:26:34 +08:00
programmerWsy
77be3dfafe
Update README.md 2025-02-15 22:30:34 +08:00
programmerWsy
ec1d399736
Update README.md 2025-02-15 22:27:12 +08:00
programmerWsy
4543258c1f
Update README.md 2025-02-15 19:00:10 +08:00
cunninger
9ce7d47b8a fix: encode custom prompt to handle non-ASCII characters in request headers 2025-02-15 10:51:22 +08:00
programmerWsy
69629b1eb3
Update README.md 2025-02-15 10:39:50 +08:00
programmerWsy
09526242ff
Update README.md 2025-02-15 10:36:40 +08:00
cunninger
d2b6d7bd3f Add custom prompt feature with advanced/raw mode support 2025-02-15 10:30:09 +08:00
programmerWsy
2637226c23
Update README.md 2025-02-15 09:49:03 +08:00
programmerWsy
f638c5d65e
Update README.md 2025-02-13 13:48:59 +08:00
programmerWsy
6bd52ea74a
Update README.md 2025-02-13 13:47:19 +08:00
cunninger
4e55b325e0 feat: add "Get Cookie" button next to GitHub icon
- Introduced a new green "Get Cookie" button to the UI.
- Positioned the button to the right of the history button for easy access.
- Implemented functionality to open the URL `https://chat.qwenlm.ai` in a new tab when the button is clicked.
- Enhanced user experience by providing a direct link for users to obtain their cookie.
2025-02-13 13:15:20 +08:00
programmerWsy
2f8f57ade7
Update README.md 2025-02-13 09:20:15 +08:00
programmerWsy
ad532bd994
docs: update API endpoint examples 2025-02-10 12:15:24 +08:00
programmerWsy
9c6745fcf5
docs: update API endpoint examples and usage notes 2025-02-10 12:02:12 +08:00
programmerWsy
d7e0bf4106
docs: update API endpoint examples and usage notes 2025-02-10 11:54:33 +08:00
cunninger
bee8754e24 feat: enhance API implementation and add documentation
- Added detailed comments to API endpoint implementations for clarity.
- Ensured consistent error handling across all endpoints with standardized JSON responses.
- Implemented unit tests for API endpoints to verify functionality.
- Updated constants and added comments for better understanding of parameters.
- Ensured code logic aligns with the updated README documentation.
2025-02-10 11:48:05 +08:00
programmerWsy
f825b18d88
Update README.md 2025-02-10 10:06:48 +08:00
Cunninger
3f32cb4de2 fix(cookie): resolve hardcoded cookie issue (oversight fix) 2025-02-04 00:31:30 +08:00
Cunninger
989bb531f9 update readme about cookie 2025-02-03 15:03:19 +08:00
programmerWsy
1c25f0d70d
Update README.md 2025-02-03 14:43:38 +08:00
Cunninger
061d05dfe8 refactor(api): update authentication and request parameters for enhanced compatibility
- Replace token-based authentication with cookie-based authentication for improved security and usability
- Add support for chat_type field in both request body and content object to align with updated API requirements
- Ensure prompt content remains unchanged while adapting to the new interface specifications
- Update frontend interface to include a dedicated field for cookie input under Token management
This change ensures seamless integration with the updated API while maintaining backward compatibility and user experience.
2025-02-03 14:39:25 +08:00
Cunninger
ec554bc93a refactor(api): update authentication and request parameters for enhanced compatibility 2025-02-03 14:31:27 +08:00
Cunninger
77997c592e Fix some symbol issues at line 1221 2025-02-02 21:17:52 +08:00
Cunninger
6f6383a31f Update vision model to qwen2.5-vl-72b-instruct
- Upgraded model version to qwen2.5-vl-72b-instruct
- Updated configuration files to support the new model
- Fixed compatibility issues related to the new model
2025-01-28 07:59:11 +08:00
programmerWsy
bfc1a28fc4
Update README.md 2025-01-25 10:29:23 +08:00
Cunninger
09905c0990 Merge branch 'main' of https://github.com/Cunninger/ocr-based-qwen 2025-01-24 21:17:09 +08:00
Cunninger
6b75d87808 Fix CORS policy issue for fetch request
- Resolved the CORS policy error when accessing 'https://chat.qwenlm.ai/api/v1/files/' from 'https://ocr.doublefenzhuan.me'.
- Added 'Access-Control-Allow-Origin' header to the server response to allow cross-origin requests.
- Alternatively, set the request mode to 'no-cors' if an opaque response is acceptable.

This change ensures that the fetch request can be made without being blocked by CORS policy restrictions.
2025-01-24 21:16:25 +08:00
programmerWsy
c49f1d6598
Update README.md 2025-01-24 18:48:55 +08:00
programmerWsy
8110a8b752
Update README.md 2025-01-18 14:55:26 +08:00
Cunninger
d8eb58b88f style: adjust layout and styling for better alignment 2025-01-18 14:54:38 +08:00
Cunninger
7da3c8e81b fix: display image correctly in recognition history when input from URL 2025-01-18 14:43:58 +08:00
Cunninger
b38a40911b chore: add github link 2025-01-18 14:34:47 +08:00
Cunninger
4dc33f25ba Merge branch 'main' of https://github.com/Cunninger/ocr-based-qwen 2025-01-18 14:13:34 +08:00
Cunninger
5a9630ca94 chore: add favicon to the website 2025-01-18 14:12:48 +08:00
programmerWsy
9eee66ae9a
Update README.md 2025-01-18 12:30:43 +08:00
programmerWsy
235394180e
Update README.md 2025-01-18 12:29:14 +08:00
Cunninger
87dcdd9928 Merge branch 'main' of https://github.com/Cunninger/ocr-based-qwen 2025-01-18 12:25:09 +08:00
Cunninger
744b544aea feat: add URL input button for image support on main interface 2025-01-18 12:24:09 +08:00
programmerWsy
b9c1baade2
Update LICENSE 2025-01-17 15:24:11 +08:00
programmerWsy
d1c81e7d14
Update LICENSE 2025-01-17 15:22:55 +08:00
Cunninger
4ba70a858f fix: resolve issue with .gitignore$ being copied in recognized content 2025-01-15 08:24:52 +08:00
programmerWsy
5deb60c82f
Update README.md 2025-01-15 07:45:56 +08:00
programmerWsy
21e3d6c494
Update README.md 2025-01-14 20:26:14 +08:00
6 changed files with 783 additions and 183 deletions

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
.idea/

16
LICENSE
View File

@ -1,14 +1,13 @@
重要声明
由于本项目是对 QwenLM 的逆向工程实现,仅供学习和研究使用。任何商业用途或滥用行为均与作者无关。请遵守相关法律法规和平台的使用条款。
项目性质:本项目是对 QwenLM 的逆向工程实现,仅供学习和研究使用。
免责声明:任何商业用途或滥用行为均与作者无关。
法律合规:使用者需遵守相关法律法规和平台的使用条款。
开源协议 (LICENSE)
本项目采用 MIT 许可证,明确限制仅用于学习和研究目的。以下是 LICENSE 文件内容:
本项目采用 MIT 许可证,明确限制仅用于学习和研究目的。以下是 LICENSE 文件内容的补充说明
```
MIT License
Copyright (c) 2025 [cunninger]
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
@ -22,6 +21,8 @@ furnished to do so, subject to the following conditions:
2. The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
3. If you modify or distribute the Software, you must include a reference to the original project's open-source address: https://github.com/Cunninger/ocr-based-qwen.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
@ -29,4 +30,7 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
```
补充说明
二次开发声明如果您对项目进行二次开发或分发必须声明本项目的开源地址https://github.com/Cunninger/ocr-based-qwen。
请确保在使用或修改本项目时遵守上述条款和条件。

142
README.md
View File

@ -1,10 +1,32 @@
# 🖼️ QwenLM OCR 逆向工程项目
<div align="center"> <img src="https://github.com/Cunninger/ocr-based-qwen/blob/main/ocr.png?raw=true" width="120"> </div>
本项目是对 [QwenLM](https://chat.qwenlm.ai/) 的 OCR 功能进行逆向工程的实现。通过调用 QwenLM 的 API你可以从图片中提取文字内容并且该项目支持一键部署到 **Cloudflare Workers** (CF) 上。
# QwenLM OCR
本项目基于 [QwenLM](https://chat.qwenlm.ai/) 。通过调用 QwenLM 的 ”API“你可以从图片中提取文字内容并且该项目支持一键部署到 **Cloudflare Workers** (CF) 上。
## 项目展示
![image](https://github.com/user-attachments/assets/6a292a81-98e4-4f6d-8759-a310c95499b1)
![image](https://github.com/user-attachments/assets/979fc3d3-c1a5-48b9-9cba-a0335bb5978e)
## 测试cookie
- 如果出现**处理失败: 文件上传失败的错误**说明测试Cookie 上传文件过多, 尝试获取自己账号的Cookie 使用
```
{
"code": "RateLimited",
"detail": "Reached file upload limited: too many files uploaded in (86400.0) seconds."
}
```
![image](https://github.com/user-attachments/assets/5251feec-3fdc-4003-82b5-a273a3abb9f2)
- cookie1:
```txt
cna=pklJII7LlmACAWrjg1e7Aw5T; _bl_uid=vjmdq8ej4XLdptzy8g22cbqap10w; _gcl_au=1.1.2061498123.1740790694.1095090244.1742178801.1742178800; visitor_id=69d9708501480ef09203b791ac6bf725; x-ap=ap-southeast-1; xlly_s=1; acw_tc=0a03e53417425630262545566e597ceb582665688952129fe15ad53c13a1f9; ssxmod_itna=eq0xcD9DgDnDRQGG0K3qq7K7KqKqeTx0dGMD3Mq7tDRDFqAP5DHIOFP5DUgork7Dhx=80hqDsqQY4GzDiMPGhDBmAHQYDDKCYRhc0NPY1mT2DC1uhedHmd4N7ArjRr9ZZSrtexB3DEx0==nTirDYYEDBYD74G+DDeDir3Dj4GmDGA3deDFCmbQcnre=xDwDB=DmqG2Q2rDm4DfDDd5O7=jCWroDDtDAun1PPDADAfY24Dl08OjCGDK24GWClR/iceaMawdV2rDjdPD/RG021H2o5LtXCMs+9Ye=cWDtqD986RVWaIYVQu4wIYCDqQRDPhFCIYQDblxx8DFnD47DtGA4YiiGGbjaHCGKR+63+FQwFe9x=EF7Dh+5ZUvwRy/exxfRDAuCjEYeeCtGqCIOlgtCiN/riQGQ=G4WGeuricqFeD; ssxmod_itna2=eq0xcD9DgDnDRQGG0K3qq7K7KqKqeTx0dGMD3Mq7tDRDFqAP5DHIOFP5DUgork7Dhx=80o4DW+DDwYpQkUCgDCMCnMHiqezU=ED; SERVERID=7f8d8d352ef7abbfd818d506cbe1b627|1742563117|1742563026; token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjUzZTk0Nzg4LWMwM2QtNDY4Mi05OTNhLWE0ZDNjNGUyZDY0OSIsImV4cCI6MTc0NTE1NTExN30.4g_Jz3Gv_OmBRMSJVoy641H9iCG90v39SK18wu9mCFQ; tfstk=ga7qs-x4urU2V1_4IQYZ4vDR3xTvJE2I0N96s1fMGKv0HNTwsL5Zhi11sFzwEExOcd9XQF5OL7wQRy1AMFpgdJaCSmqqdFpg5FqWr_hjUk2QRy1cFK8BDJ_jwASyHCYMihAmq7R6tFADndVyECRKjxXMS7PysCHMid0Mr3ApEdYMSOfuaCMKRtBtdBx0_VcIk0DvMnJhiLuNMaRD0mCDUV0Gzt-2K29rSVbyM_MBBrgUfpjphHtPEzg27_ANhL63-48kYMC6_tzqoEsl2ZLfPJlp0OJyxatzrYRPz6sHw_rUa_7w3HbD4fgXoERGIhS8L2O2lg-FuiFtEsXB3MYA1XyfaHSyvQxo_mYfA6_9xZ4qpLtp_t95Ky0yrhjzLAdugA_O0AmwmQdyd7Pr8_lRpTUzeHmtX3xHapNvjcn9mQdyd7PrXcKx-QJQMhf..; isg=BA0NXKJIVjFc4PIC5ORdQdZ0HCmH6kG8OYRCyE-SSaQTRi34FzpRjFvAstogsll0
```
- cookie2:
```txt
acw_tc=c2db8f77aa0023a996777b8537356b308a98c7fb128b3020323ddd0d440fee2e; x-ap=ap-southeast-1; _gcl_au=1.1.485014960.1742563291; cna=2lVkIP9JX0cCAWrgu3Se+w7K; _bl_uid=L2mdt8wtidFtCg6hOwepuqdbswp9; xlly_s=1; ssxmod_itna=eqfx9DRDgDuCq4e9irD+x0xiIt4Kk0q0dGMD3u47t=GcD8xx0POD8ne5DUhKgGg5hxPY0hqDsPexiNDAg40iDCbmd87DDqtqgUb7DPmYRE7DtUgiz1dRuKOGrh2LROs=/Dc3eOieGLDmKDU2Dre34DxPPD5xDTDWeDGDD3rxGaDmeDe1ghD04mFfovifAoD7eDXxGCz74mDYPDWxDFibw8HxowrDDCDi5flb3DixiaTzPDB1PuHhDKtzPDEDOIVEfozBdqO/PmD7H3DlPx+vdXwH/asIoyso6r3+3fDCKDjgSpxSrQTKSI5b8+Dxn0YeWeOgO+GDYhxqDty+xKGKBB3Qix70DeDxoxxQGKgGw9xqQAYOEQOO7YCpOhKKbzcqsibslTe7G3qGtuOv+GiqB=klOpOAMA5KB5e35K+D3ixTQmkeh4D; ssxmod_itna2=eqfx9DRDgDuCq4e9irD+x0xiIt4Kk0q0dGMD3u47t=GcD8xx0POD8ne5DUhKgGg5hxPY0o4DW+DDwYpQkUCgDCMSOB5qeg0/mkbxD; token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6ImQ5MWIwY2ExLTlhZmMtNDkwNi05MTQ4LWNlN2M4ZjZhN2NmYyIsImV4cCI6MTc0NTE1NTMzM30.jqUN03CY_bB6GniWCn6ISQkdnpN59hm3Gug655Dd2GI; SERVERID=4c8b4dba95825d8ac7605fad188b7907|1742563334|1742563289; tfstk=gw6qcdO43-eqJr64S3vZa2mpW7vvhK4QnOT6jGjMcEY0kO9wjUSZlss1jdywrNLchdDirF7wXqADIjvZQUth1qDcmC8kjNO0DnVvQbx6fxcMISLZDT7ECxaYMGDwCd4QRJwCDgJ9Iy_g58eDkhIkSuO0iuwfud4QR8tK5z0vIZNRCkiPqUKwjjDcS3mkyhkisNYDZ4xevdYGSN0lqntsiAcDSYqyXUYMIdbMEvFVkN3BxIqZIcF3PztMgejDzASAUnAqMiYrIAXPuI8ndUkiIT-VVmR-AvP6-6LXOQ7uFxJNqh7XPw2nULAF9GtNu-kDh_fRHK678DdV7URhFQyoz3WPA6xR4WrP4O82ttArfx9D3hbM__UEdnJfaBWVMl3lmwTVtKIsYrsyT_RpqQmZiK1CAOdhn-upPBKNlU_3KYJksgkKW3qq5OCqSfRD238Q4u7onRcc_mCrKfh9ZBxyRodi6fdD238Q4ult6IHH4eZvs; isg=BLGxZSYScp1XxN6JZK3ED2FvwD1LniUQRPVRw5PFbniWutAM2e5m4VbM3k7cRr1I
```
## 🚀 功能特性
- **图片 OCR**:使用 QwenLM 强大的 OCR 功能从图片中提取文字。
@ -14,8 +36,30 @@
- **历史记录**:保存每次识别的结果和图片,方便查看。
- **一键复制**:轻松复制识别结果到剪贴板。
- **数学公式识别**:特别优化了对数学公式的提取,支持 LaTeX 格式输出。
- **API 支持**:提供 `curl` 接口调用,支持 base64 和图片 URL 两种方式。
- **API 支持**:提供 `curl` 接口调用,支持通过图片文件、base64 和图片 URL 3种方式。(Apifox调用文档示例(**仅作为代码示例,这个网页调试有问题**)https://0vkh6v4ad8.apifox.cn/)
- **验证码识别**:新增验证码识别功能,支持常见类型的验证码(如数字、字母、混合字符等),提升自动化处理能力。
- **自定义prompt**: 在高级模式下(v1.1.0支持),用户可以自定义 prompt跳过格式化处理直接返回原始结果而在普通模式下使用默认的 prompt 并保持现有的格式化处理逻辑。
## qwen模型接口
https://chat.qwenlm.ai/api/models
## 提示词工程
```
const defaultPrompt =
'不要输出任何额外的解释或说明,禁止输出例如:识别内容、以上内容已严格按照要求进行格式化和转换等相关无意义的文字!' + '请识别图片中的内容,注意以下要求:\n' +
'对于数学公式和普通文本:\n' +
'1. 所有数学公式和数学符号都必须使用标准的LaTeX格式\n' +
'2. 行内公式使用单个$符号包裹,如:$x^2$\n' +
'3. 独立公式块使用两个$$符号包裹,如:$$\\sum_{i=1}^n i^2$$\n' +
'4. 普通文本保持原样不要使用LaTeX格式\n' +
'5. 保持原文的段落格式和换行\n' +
'6. 明显的换行使用\\n表示\n' +
'7. 确保所有数学符号都被正确包裹在$或$$中\n\n' +
'对于验证码图片:\n' +
'1. 只输出验证码字符,不要加任何额外解释\n' +
'2. 忽略干扰线和噪点\n' +
'3. 注意区分相似字符如0和O、1和l、2和Z等\n' +
'4. 验证码通常为4-6位字母数字组合\n\n' +
'';
```
## 🛠️ 部署指南
### 1. 部署到 Cloudflare Workers
@ -31,10 +75,12 @@
## 🧩 使用说明
1. **设置 Token**
- 前往 [QwenLM](https://chat.qwenlm.ai/) 获取 Token。
- 点击右上角的 **⚙️ Token设置** 按钮。
- 输入你的 QwenLM API Token多个 Token 用英文逗号分隔)。
1. **设置 Cookie**
- 前往 [QwenLM](https://chat.qwenlm.ai/) 获取对话请求中的 Cookie。
![alt text](image.png)
- 点击右上角的 **⚙️ Cookie设置** 按钮。
- 输入你的 Cookie或者使用测试Cookie
- 点击 **保存**
2. **上传图片**
@ -52,20 +98,22 @@
5. **API 调用**
- **支持 base64**
```bash
curl --location 'https://ocr.doublefenzhuan.me/api/recognize/base64' \
--header 'Content-Type: application/json' \
--data '{
"token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjUzZTk0Nzg4LWMwM2QtNDY4Mi05OTNhLWE0ZDNjNGUyZDY0OSIsImV4cCI6MTczOTA3NTE0MX0.FtwG6xDLYd2rngWUhuldg56WXCiLSTL0RI6xJJQ4vHM",
"base64Image": "xxx"
}'
curl -X POST \
'https://test-qwen-cor.aughumes8.workers.dev/api/recognize/base64' \
-H 'Content-Type: application/json' \
-H 'x-custom-cookie: YOUR_COOKIE_STRING' \
-d '{
"base64Image": "YOUR_BASE64_IMAGE_STRING"
}'
```
- **支持图片 URL**:
```bash
curl --location 'https://ocr.doublefenzhuan.me/api/recognize/url' \
--header 'Content-Type: application/json' \
--data '{
"token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjUzZTk0Nzg4LWMwM2QtNDY4Mi05OTNhLWE0ZDNjNGUyZDY0OSIsImV4cCI6MTczOTA3NTE0MX0.FtwG6xDLYd2rngWUhuldg56WXCiLSTL0RI6xJJQ4vHM",
"imageUrl": "xxxx"
curl -X POST \
'https://test-qwen-cor.aughumes8.workers.dev/api/recognize/url' \
-H 'Content-Type: application/json' \
-H 'x-custom-cookie: YOUR_COOKIE_STRING' \
-d '{
"imageUrl": "YOUR_IMAGE_URL"
}'
```
6. **验证码识别**
@ -110,29 +158,51 @@
### 2025/01/13 18点34分 支持`curl`接口调用
- **支持base64**
```
curl --location 'https://ocr.doublefenzhuan.me/api/recognize/base64' \
--header 'Content-Type: application/json' \
--data '{
"token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjUzZTk0Nzg4LWMwM2QtNDY4Mi05OTNhLWE0ZDNjNGUyZDY0OSIsImV4cCI6MTczOTA3NTE0MX0.FtwG6xDLYd2rngWUhuldg56WXCiLSTL0RI6xJJQ4vHM",
"base64Image": "xxx"
}'
```bash
curl -X POST \
'https://test-qwen-cor.aughumes8.workers.dev/api/recognize/base64' \
-H 'Content-Type: application/json' \
-H 'x-custom-cookie: YOUR_COOKIE_STRING' \
-d '{
"base64Image": "YOUR_BASE64_IMAGE_STRING"
}'
```
- 效果图:
![image](https://github.com/user-attachments/assets/ef160aae-e741-49d3-96f0-a0969b883f1a)
![image](https://github.com/user-attachments/assets/363afb39-444b-4308-a2bd-55831df81b6f)
- **支持图片URL**:
```bash
curl --location 'https://ocr.doublefenzhuan.me/api/recognize/url' \
--header 'Content-Type: application/json' \
--data '{
"token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjUzZTk0Nzg4LWMwM2QtNDY4Mi05OTNhLWE0ZDNjNGUyZDY0OSIsImV4cCI6MTczOTA3NTE0MX0.FtwG6xDLYd2rngWUhuldg56WXCiLSTL0RI6xJJQ4vHM",
"imageUrl": "xxxx"
}'
curl -X POST \
'https://test-qwen-cor.aughumes8.workers.dev/api/recognize/url' \
-H 'Content-Type: application/json' \
-H 'x-custom-cookie: YOUR_COOKIE_STRING' \
-d '{
"imageUrl": "YOUR_IMAGE_URL"
}'
```
- 效果图:
![image](https://github.com/user-attachments/assets/db0c89f9-96f1-45b1-b1e9-88ac3d01e196)
![image](https://github.com/user-attachments/assets/a816085e-8a52-4425-b02c-94ea543bf95b)
- **通过图片文件识别需要先上传获取imageId**
```bash
# 1. 先上传文件
curl -X POST \
'https://test-qwen-cor.aughumes8.workers.dev/proxy/upload' \
-H 'x-custom-cookie: YOUR_COOKIE_STRING' \
-F 'file=@/path/to/your/image.jpg'
# 2. 使用返回的imageId进行识别
curl -X POST \
'https://test-qwen-cor.aughumes8.workers.dev/recognize' \
-H 'Content-Type: application/json' \
-H 'x-custom-cookie: YOUR_COOKIE_STRING' \
-d '{
"imageId": "RETURNED_IMAGE_ID"
}'
```
## Cloudflare访问数据
![image](https://github.com/user-attachments/assets/bb456075-6107-47ee-a361-a0edba532c38)
## 致谢
![image](https://github.com/user-attachments/assets/cfc04290-6400-483d-b0a9-4dd4b409bab9)
## 趋势
[![Star History Chart](https://api.star-history.com/svg?repos=cunninger/ocr-based-qwen&type=Date&v=20231001)](https://star-history.com/#Cunninger/ocr-based-qwen&Date)
[![Star History Chart](https://api.star-history.com/svg?repos=cunninger/ocr-based-qwen&type=Date)](https://star-history.com/#Cunninger/ocr-based-qwen&Date)

BIN
image.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 327 KiB

BIN
ocr.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

807
worker.js

File diff suppressed because one or more lines are too long