{"id":37075557,"url":"https://github.com/linuxdeepin/pdocr-rpc","last_synced_at":"2026-01-14T08:53:36.516Z","repository":{"id":212897374,"uuid":"697574703","full_name":"linuxdeepin/pdocr-rpc","owner":"linuxdeepin","description":null,"archived":false,"fork":false,"pushed_at":"2024-05-28T12:32:53.000Z","size":969,"stargazers_count":3,"open_issues_count":0,"forks_count":3,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-08-19T20:06:38.511Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://linuxdeepin.github.io/pdocr-rpc/","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/linuxdeepin.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":"2023-09-28T02:53:44.000Z","updated_at":"2024-05-28T12:32:44.000Z","dependencies_parsed_at":"2023-12-28T04:23:01.793Z","dependency_job_id":"2b197e75-81d8-45db-8836-0b894496d755","html_url":"https://github.com/linuxdeepin/pdocr-rpc","commit_stats":null,"previous_names":["linuxdeepin/pdocr-rpc"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/linuxdeepin/pdocr-rpc","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/linuxdeepin%2Fpdocr-rpc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/linuxdeepin%2Fpdocr-rpc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/linuxdeepin%2Fpdocr-rpc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/linuxdeepin%2Fpdocr-rpc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/linuxdeepin","download_url":"https://codeload.github.com/linuxdeepin/pdocr-rpc/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/linuxdeepin%2Fpdocr-rpc/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28414713,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T08:38:59.149Z","status":"ssl_error","status_checked_at":"2026-01-14T08:38:43.588Z","response_time":107,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":[],"created_at":"2026-01-14T08:53:35.850Z","updated_at":"2026-01-14T08:53:36.498Z","avatar_url":"https://github.com/linuxdeepin.png","language":"Python","readme":"# pdocr-rpc\n\n基于 `PaddleOCR` 封装的 `RPC` 服务，包含客户端和服务端。\n\n客户端提供了一个简单易用的函数 `ocr`，通过不同的参数控制返回不同的值。\n\n**为什么要分成服务端和客户端？**\n\n因为 `PaddleOCR` 安装**太重**了，如果你的使用场景是需要经常安装，那绝对是一个痛苦的事情，你要是知道它每次安装要装多少东西你肯定会忍不住摇头；\n\n而在服务端一次性安装部署之后，客户端就可以零成本的使用，非常的方便。\n\n---\n\n**Documentation**: \u003ca href=\"https://linuxdeepin.github.io/pdocr-rpc\" target=\"_blank\"\u003ehttps://linuxdeepin.github.io/pdocr-rpc\u003c/a\u003e\n\n**Source Code**: \u003ca href=\"https://github.com/linuxdeepin/pdocr-rpc\" target=\"_blank\"\u003ehttps://github.com/linuxdeepin/pdocr-rpc\u003c/a\u003e\n\n---\n\n## 1、服务端\n\n### 服务端安装\n\n```console\npip install pdocr-rpc[server]\n```\n\n### 服务端启动服务\n\n随意新建一个`py`文件，名称你可以自定义，比如：`ocr_server.py`；\n\n写入以下内容：\n\n```python\n# ocr_server.py\nfrom pdocr_rpc.server import server\n\nserver()\n```\n\n默认端口号为 `8890` 如果你想修改端口：\n\n```python\nfrom pdocr_rpc.server import server\nfrom pdocr_rpc.conf import setting\n\nsetting.PORT = 8888\nserver()\n```\n\n## 2、客户端\n\n### 客户端安装\n\n```console\npip install pdocr-rpc\n```\n\n### 客户端使用\n\n#### 2.1、识别当前屏幕的所有文字内容\n\n```python\nfrom pdocr_rpc import OCR\nfrom pdocr_rpc.conf import setting\n\n# 注意IP和端口要和你的服务端IP对应\nsetting.SERVER_IP = \"192.168.0.1\"\nsetting.PORT = 8888\n\nOCR.ocr()\n```\n\n自动识别当前整个屏幕的所有内容。\n\n#### 2.2、指定某张图片识别的所有文字内容\n\n```python\nOCR.ocr(picture_abspath=\"~/Desktop/test.png\")\n```\n\n返回识别图片 `test.png` 的内容。 \n\n#### 2.3、在全屏指定查找某个字符串的坐标\n\n```python\nOCR.ocr(\"天天向上\")\n```\n\n返回当前屏幕中，“天天向上”的坐标，如果存在多个，则返回一个字典。\n\n#### 2.4、指定某张图片查找某个字符串的坐标\n\n```python\nOCR.ocr(\"天天向上\"，picture_abspath=\"~/Desktop/test.png\")\n```\n\n#### 2.5、其他参数\n\n- 识别语言\n\n  lang： `ch`, `en`, `fr`, `german`, `korean`, `japan`\n\n  默认为ch，中文，如果要修改识别语言；\n\n  ```python\n  OCR.ocr(lang=\"ch\") \n  ```\n\n- 匹配度\n\n  similarity: float\n\n  默认为0.6，可以修改为从0到1的数；\n\n  ```shell\n  OCR.ocr(similarity=0.1)\n  ```\n\n- 返回原始数据\n\n  return_default: bool\n\n  默认为False，即默认返回识别到字符串的中心坐标，True表示返回原始数据；\n\n  ```python\n  OCR.ocr(return_default=False)\n  ```\n\n- 只返回第一个\n\n  return_first: bool\n\n  当传入要查找的字符串时，可能存在当前屏幕中有多个目标；\n\n  默认情况下是会将识别到的多个目标组装成字典返回；\n\n  return_first=True 表示返回识别到的第一个。\n\n  ```python\n  OCR.ocr(return_first=True )\n  ```\n\n  \n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flinuxdeepin%2Fpdocr-rpc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flinuxdeepin%2Fpdocr-rpc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flinuxdeepin%2Fpdocr-rpc/lists"}