Skip to content

Commit

Permalink
Merge pull request baidubce#145 from ide-rea/fix_name_2
Browse files Browse the repository at this point in the history
修改HandwriteOCR中文名字
  • Loading branch information
seiriosPlus committed Feb 28, 2024
2 parents 4ccaf12 + d32a7d0 commit 5544539
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 12 deletions.
11 changes: 6 additions & 5 deletions appbuilder/core/components/handwrite_ocr/README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# 手写体OCR识别 (HandwriteOCR)
# 手写文字识别 (HandwriteOCR)

## 简介
手写体OCR识别 (HandwriteOCR),图片中的手写中文、手写数字进行检测和识别,针对不规则的手写字体进行专项优化,识别准确率可达90%以上。
手写文字识别 (HandwriteOCR),图片中的手写中文、手写数字进行检测和识别,针对不规则的手写字体进行专项优化,识别准确率可达90%以上。


### 功能介绍
Expand All @@ -17,7 +17,7 @@

## 基本用法

下面是手写体的代码示例
下面是手写文字识别的代码示例
```python
import os
import requests
Expand All @@ -32,7 +32,7 @@ raw_image = requests.get(image_url).content
inp = appbuilder.Message(content={"raw_image": raw_image})
# inp = Message(content={"url": image_url})

# 运行手写体识别
# 运行手写文字识别
handwrite_ocr = appbuilder.HandwriteOCR()
out = handwrite_ocr.run(inp)
# 打印识别结果
Expand Down Expand Up @@ -149,4 +149,5 @@ os.environ["APPBUILDER_TOKEN"] = "..."


## 更新记录和贡献
* 手写体OCR识别 (2024-01)
* 手写文字识别 (2024-01)
* 手写文字识别 (2024-02)
6 changes: 3 additions & 3 deletions appbuilder/core/components/handwrite_ocr/component.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.

r"""手写体识别组件"""
r"""手写文字识别组件"""
import base64

from appbuilder.core._exception import AppBuilderServerException
Expand All @@ -20,7 +20,7 @@
from appbuilder.core._client import HTTPClient

class HandwriteOCR(Component):
r""" 手写体识别识别
r""" 手写文字识别组件
Examples:
.. code-block:: python
Expand Down Expand Up @@ -74,7 +74,7 @@ def run(self, message: Message, timeout: float = None, retry: int = 0) -> Messag
height=w.location.height
)))
for w in response.words_result]
return Message(content=out.dict())
return Message(content=dict(out))

def _recognize(self, request: HandwriteOCRRequest, timeout: float = None, retry: int = 0) -> HandwriteOCRResponse:
r"""调用底层接口进行通用文字识别
Expand Down
8 changes: 4 additions & 4 deletions appbuilder/core/components/handwrite_ocr/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@
# See the License for the specific language governing permissions and
# limitations under the License.

"""手写体OCR数据类"""
"""手写文字识别数据类"""
import proto
from typing import List
from pydantic import BaseModel


class HandwriteOCRRequest(proto.Message):
""" 手写体ocr识别请求体
""" 手写文字识别组件请求参数
属性:
image (str):
可选。图像内容的base64编码。
Expand Down Expand Up @@ -125,7 +125,7 @@ class HandwriteLocation(proto.Message):


class HandwriteWordResult(proto.Message):
""" 手写体识别结果列表.
""" 手写文字识别结果列表
属性:
words (str): 识别出的文本
Expand Down Expand Up @@ -165,7 +165,7 @@ class HandwriteProbability(proto.Message):


class HandwriteOCRResponse(proto.Message):
"""手写体ocr识别结果
"""手写文字识别结果
属性:
request_id(str): 请求ID
Expand Down

0 comments on commit 5544539

Please sign in to comment.