-
Notifications
You must be signed in to change notification settings - Fork 469
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Hackthon_4th 242] Support en_ppstructure_mobile_v2.0_SLANet #1816
Conversation
paddle inference以及onnxruntime测试验证通过 TRT报错: 验证, 性能benchmark, 结果输出无差异: ======= Backend Info ======= [WARNING] fastdeploy/fastdeploy_model.cc(48)::IsSupported In benchmark mode, we don't check to see if the backend [Backend::PDINFER] is supported for current model! 模型串联:文本检测+文本识别+表格识别:
实际(fastdeploy输出):
结论: 输出结果一致 |
LGTM |
fastdeploy/vision/ocr/ppocr/table.cc
Outdated
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
#include "fastdeploy/vision/ocr/ppocr/table.h" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ppstructure相关的模型,需要使用ppstructure进行区分。
ppocr_table.cc -> ppstructurev2_table.cc
ppocr_table.h -> ppstructurev2_table.h
table.cc -> structurev2_table.cc
table.h -> structurev2_table.h
table_preprocessor.cc -> structurev2_table_preprocessor.cc
table_preprocessor.h -> structurev2_table_preprocessor.h
table_postprocessor.cc -> structurev2_table_postprocessor.cc
table_postprocessor.h -> structurev2_table_postprocessor.h
命名空间约束,保持现状即可,但需要规范相关类名。如下:
fastdeploy::vision::ocr::Table -> fastdeploy::vision::ocr::StructureV2Table;
fastdeploy::vision::ocr::TablePostprocessor -> fastdeploy::vision::ocr::StructureV2TablePostprocessor;
fastdeploy::vision::ocr::TablePreprocessor -> fastdeploy::vision::ocr::StructureV2TablePreprocessor;
pipeline命名需要修改成:
fastdeploy::pipeline::PPOCRTable -> fastdeploy::pipeline::PPStructureV2Table;
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
同理,Python 按照类似规范进行修改
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@DefTruth 已修改完成
支持使用英文模型和英文表格字典推理结果: 支持使用中文模型和中文表格字典推理结果:
|
@thunder95 LGTM ! |
确实 SLANet不支持用openvino推理,可能是了GRU的原因? |
OCRResult中相应结果需要提供 python binding diff --git a/fastdeploy/vision/vision_pybind.cc b/fastdeploy/vision/vision_pybind.cc
index 664e6cc1..c1f26fbd 100644
--- a/fastdeploy/vision/vision_pybind.cc
+++ b/fastdeploy/vision/vision_pybind.cc
@@ -160,6 +160,9 @@ void BindVision(pybind11::module& m) {
.def_readwrite("rec_scores", &vision::OCRResult::rec_scores)
.def_readwrite("cls_scores", &vision::OCRResult::cls_scores)
.def_readwrite("cls_labels", &vision::OCRResult::cls_labels)
+ .def_readwrite("table_boxes", &vision::OCRResult::table_boxes)
+ .def_readwrite("table_structure", &vision::OCRResult::table_structure)
+ .def_readwrite("table_html", &vision::OCRResult::table_html)
.def("__repr__", &vision::OCRResult::Str)
.def("__str__", &vision::OCRResult::Str); |
PR types(PR类型)
Model
Description
完成ppstructure中表格识别模型en_ppstructure_mobile_v2.0_SLANet算法前后处理,及精度对齐,开发Python部署示例和C++部署示例