diff --git a/deploy/hubserving/readme.md b/deploy/hubserving/readme.md index d38ef0ea1f710fbee7448cfcdd5e8daf4007f824..ff04aa8bf680bbb7e2463563d39f93d9fd779634 100755 --- a/deploy/hubserving/readme.md +++ b/deploy/hubserving/readme.md @@ -177,15 +177,17 @@ hub serving start -c deploy/hubserving/ocr_system/config.json |text|str|文本内容| |confidence|float| 文本识别置信度或文本角度分类置信度| |text_region|list|文本位置坐标| +|html|str|表格的html字符串| 不同模块返回的字段不同,如,文本识别服务模块返回结果不含`text_region`字段,具体信息如下: -| 字段名/模块名 | ocr_det | ocr_cls | ocr_rec | ocr_system | -| ---- | ---- | ---- | ---- | ---- | -|angle| | ✔ | | ✔ | -|text| | |✔|✔| -|confidence| |✔ |✔| | -|text_region| ✔| | |✔ | +| 字段名/模块名 | ocr_det | ocr_cls | ocr_rec | ocr_system | structure_table | +| ---- | ---- | ---- | ---- | ---- | ---- | +|angle| | ✔ | | ✔ | | +|text| | |✔|✔| | +|confidence| |✔ |✔| | | +|text_region| ✔| | |✔ | | +|html| | | | |✔ | **说明:** 如果需要增加、删除、修改返回字段,可在相应模块的`module.py`文件中进行修改,完整流程参考下一节自定义修改服务模块。 diff --git a/deploy/hubserving/readme_en.md b/deploy/hubserving/readme_en.md index 2e5268f263b9914b9be47537c4ec9dcb9c03769c..f8fd3fa14b8417dcf50fb3b0767d96c5c89a6364 100755 --- a/deploy/hubserving/readme_en.md +++ b/deploy/hubserving/readme_en.md @@ -187,12 +187,13 @@ The returned result is a list. Each item in the list is a dict. The dict may con The fields returned by different modules are different. For example, the results returned by the text recognition service module do not contain `text_region`. The details are as follows: -| field name/module name | ocr_det | ocr_cls | ocr_rec | ocr_system | -| ---- | ---- | ---- | ---- | ---- | -|angle| | ✔ | | ✔ | -|text| | |✔|✔| -|confidence| |✔ |✔| | -|text_region| ✔| | |✔ | +| field name/module name| ocr_det | ocr_cls | ocr_rec | ocr_system | structure_table | +| ---- | ---- | ---- | ---- | ---- | ---- | +|angle| | ✔ | | ✔ | | +|text| | |✔|✔| | +|confidence| |✔ |✔| | | +|text_region| ✔| | |✔ | | +|html| | | | |✔ | **Note:** If you need to add, delete or modify the returned fields, you can modify the file `module.py` of the corresponding module. For the complete process, refer to the user-defined modification service module in the next section. diff --git a/deploy/hubserving/structure_table/module.py b/deploy/hubserving/structure_table/module.py index d9af4a7d34bbfc54636d9f8b59d4866197ef8cb7..106abe0c7aa1def7f4e68fce9e2a0ca21f5b21bb 100644 --- a/deploy/hubserving/structure_table/module.py +++ b/deploy/hubserving/structure_table/module.py @@ -109,7 +109,7 @@ class TableSystem(hub.Module): elapse = time.time() - starttime logger.info("Predict time: {}".format(elapse)) - all_results.append(pred_html) + all_results.append({'html': pred_html}) return all_results @serving