Skip to content

  • 体验新版
    • 正在加载...
  • 登录
  • PaddlePaddle
  • PaddleOCR
  • Issue
  • #590

P
PaddleOCR
  • 项目概览

PaddlePaddle / PaddleOCR
大约 2 年 前同步成功

通知 1557
Star 32965
Fork 6643
  • 代码
    • 文件
    • 提交
    • 分支
    • Tags
    • 贡献者
    • 分支图
    • Diff
  • Issue 108
    • 列表
    • 看板
    • 标记
    • 里程碑
  • 合并请求 7
  • Wiki 0
    • Wiki
  • 分析
    • 仓库
    • DevOps
  • 项目成员
  • Pages
P
PaddleOCR
  • 项目概览
    • 项目概览
    • 详情
    • 发布
  • 仓库
    • 仓库
    • 文件
    • 提交
    • 分支
    • 标签
    • 贡献者
    • 分支图
    • 比较
  • Issue 108
    • Issue 108
    • 列表
    • 看板
    • 标记
    • 里程碑
  • 合并请求 7
    • 合并请求 7
  • Pages
  • 分析
    • 分析
    • 仓库分析
    • DevOps
  • Wiki 0
    • Wiki
  • 成员
    • 成员
  • 收起侧边栏
  • 动态
  • 分支图
  • 创建新Issue
  • 提交
  • Issue看板
已关闭
开放中
Opened 8月 21, 2020 by saxon_zh@saxon_zhGuest

hub server部署不支持 batch_size 参数

Created by: BobDu

根据readme config.json

{
  "modules_info": {
    "chinese_ocr_db_crnn_mobile": {
      "init_args": {
        "version": "1.0.3"
      },
      "predict_args": {
        "use_gpu": true,
        "batch_size": 20
      }
    }
  },
  "port": 3306
}

服务报错

2020-08-21 20:08:55,054-INFO: 211.103.135.176 - - [21/Aug/2020 20:08:55] "POST /predict/chinese_ocr_db_crnn_mobile HTTP/1.1" 200 -
2020-08-21 20:09:08  -  recognize_text() got an unexpected keyword argument 'batch_size'

阅读paddlehub的源码中

~/Projects/PaddleHub/hub_module/modules/image/text_recognition/chinese_ocr_db_crnn_mobile/module.py

    def recognize_text(self,
                       images=[],
                       paths=[],
                       use_gpu=False,
                       output_dir='ocr_result',
                       visualization=False,
                       box_thresh=0.5,
                       text_thresh=0.5):
        """
        Get the chinese texts in the predicted images.
        Args:
            images (list(numpy.ndarray)): images data, shape of each is [H, W, C]. If images not paths
            paths (list[str]): The paths of images. If paths not images
            use_gpu (bool): Whether to use gpu.
            batch_size(int): the program deals once with one
            output_dir (str): The directory to store output images.
            visualization (bool): Whether to save image or not.
            box_thresh(float): the threshold of the detected text box's confidence
            text_thresh(float): the threshold of the recognize chinese texts' confidence
        Returns:
            res (list): The result of chinese texts and save path of images.
        """

recognize_text 方法并没有按照文档中写的接受batch_size参数

如果生产化部署中没有 batch_size 预测 那么采用GPU机器因为其不支持 mutilprocessing 是不是就是会比CPU机器还要慢的许多?

指派人
分配到
无
里程碑
无
分配里程碑
工时统计
无
截止日期
无
标识: paddlepaddle/PaddleOCR#590
渝ICP备2023009037号

京公网安备11010502055752号

网络110报警服务 Powered by GitLab CE v13.7
开源知识
Git 入门 Pro Git 电子书 在线学 Git
Markdown 基础入门 IT 技术知识开源图谱
帮助
使用手册 反馈建议 博客
《GitCode 隐私声明》 《GitCode 服务条款》 关于GitCode
Powered by GitLab CE v13.7