{"id":25463718,"url":"https://github.com/xiaomingx/openai-captcha-detection","last_synced_at":"2025-07-15T14:03:10.524Z","repository":{"id":262400973,"uuid":"887121839","full_name":"XiaomingX/openai-captcha-detection","owner":"XiaomingX","description":"openai-captcha-detection 是一个使用 OpenAI 进行验证码识别的工具。通过调用 OpenAI 的 API，这个项目可以实现对复杂验证码图片的文本识别，帮助开发者在验证码处理场景中进行自动化操作。","archived":false,"fork":false,"pushed_at":"2024-11-12T07:54:12.000Z","size":0,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-11-12T08:29:43.947Z","etag":null,"topics":["captcha","detection","openai","security"],"latest_commit_sha":null,"homepage":"https://twitter.com/seclink","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/XiaomingX.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-11-12T07:52:14.000Z","updated_at":"2024-11-12T07:55:41.000Z","dependencies_parsed_at":"2024-11-12T08:41:25.552Z","dependency_job_id":null,"html_url":"https://github.com/XiaomingX/openai-captcha-detection","commit_stats":null,"previous_names":["xiaomingx/openai-captcha-detection"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/XiaomingX%2Fopenai-captcha-detection","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/XiaomingX%2Fopenai-captcha-detection/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/XiaomingX%2Fopenai-captcha-detection/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/XiaomingX%2Fopenai-captcha-detection/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/XiaomingX","download_url":"https://codeload.github.com/XiaomingX/openai-captcha-detection/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239421745,"owners_count":19635818,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["captcha","detection","openai","security"],"created_at":"2025-02-18T06:30:19.317Z","updated_at":"2025-02-18T06:30:48.953Z","avatar_url":"https://github.com/XiaomingX.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# openai-captcha-detection\n\n## 项目简介\n\nopenai-captcha-detection 是一个使用 OpenAI 进行验证码识别的工具。目前验证码识别准确率100%，通过调用 OpenAI 的 API，这个项目可以实现对复杂验证码图片的文本识别，帮助开发者在验证码处理场景中进行自动化操作。\n\n## 功能特点\n- 利用 OpenAI 的 GPT-4 模型进行 OCR（光学字符识别），可以识别各种类型的验证码。\n- 提供简单易用的 API 接口，方便在其他项目中集成使用。\n\n## 环境准备\n\n在使用此项目前，请确保已经安装好以下工具：\n- Python 3.7 及以上版本\n- pip 包管理工具\n\n## 安装与使用\n\n### 克隆项目并运行验证\n1. 克隆仓库并进入项目目录：\n    ```sh\n    git clone --depth 1 https://github.com/zgimszhd61/openai-capcha-detection\n    cd openai-capcha-detection\n    ```\n\n2. 设置 OpenAI API 密钥：\n    ```sh\n    export OPENAI_API_KEY=[你的API_KEY]\n    ```\n\n3. 安装所需依赖包：\n    ```sh\n    pip install -r requirements.txt\n    ```\n\n4. 运行验证码识别脚本：\n    ```sh\n    python3 src/gpt4_ocr_demo.py\n    ```\n\n### 在其他项目中集成使用\n你可以在自己的项目中集成 `openai-captcha-detection` 来实现验证码识别。以下是一个使用示例：\n\n```python\nfrom gpt4_ocr_demo import OCRClient\n\ndef recognize_captcha(image_path):\n    # 创建 OCRClient 实例\n    ocr_client = OCRClient()\n\n    # 将图片编码为 base64 格式\n    encoded_image = ocr_client.encode_image_to_base64(image_path)\n\n    # 调用 GPT-4 OCR 函数进行识别\n    captcha_text = ocr_client.invoke_gpt4_ocr(encoded_image)\n\n    return captcha_text\n\nif __name__ == \"__main__\":\n    image_path = \"226md.png\"\n    recognized_text = recognize_captcha(image_path)\n    print(\"识别出的验证码是：\", recognized_text)\n```\n\n## 项目结构\n- `src/gpt4_ocr_demo.py`：封装了与 OpenAI API 交互的客户端类，包括图像编码与验证码识别的主要功能。演示如何使用 GPT-4 模型进行验证码识别的脚本。\n- \n## 注意事项\n- 请确保您在使用 OpenAI API 时具有有效的 API Key，并注意使用频率以免超出额度。\n- 识别效果取决于验证码的复杂程度以及 GPT-4 模型的能力，某些复杂验证码可能会存在识别错误的情况。\n\n## 未来规划\n- 提升对复杂验证码类型的识别精度。\n- 增加更多的 API 支持，以更好地适应多样化的验证码类型。\n- 提供更便捷的命令行界面以供用户直接使用。\n\n## 许可证\n此项目遵循 MIT 许可证，详细内容请查看 [LICENSE](LICENSE) 文件。\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxiaomingx%2Fopenai-captcha-detection","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fxiaomingx%2Fopenai-captcha-detection","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxiaomingx%2Fopenai-captcha-detection/lists"}