mirror of
https://github.com/PaddlePaddle/FastDeploy.git
synced 2025-10-05 16:48:03 +08:00
[Model] Support PP-OCRv4 pipeline (#1913)
* 添加paddleclas模型 * 更新README_CN * 更新README_CN * 更新README * update get_model.sh * update get_models.sh * update paddleseg models * update paddle_seg models * update paddle_seg models * modified test resources * update benchmark_gpu_trt.sh * add paddle detection * add paddledetection to benchmark * modified benchmark cmakelists * update benchmark scripts * modified benchmark function calling * modified paddledetection documents * upadte getmodels.sh * add PaddleDetectonModel * reset examples/paddledetection * resolve conflict * update pybind * resolve conflict * fix bug * delete debug mode * update checkarch log * update trt inputs example * Update README.md * add ppocr_v4 * update ppocr_v4 * update ocr_v4 * update ocr_v4 * update ocr_v4 * update ocr_v4 --------- Co-authored-by: DefTruth <31974251+DefTruth@users.noreply.github.com>
This commit is contained in:
@@ -317,6 +317,30 @@ if __name__ == '__main__':
|
||||
runtime_option=rec_option)
|
||||
model = fd.vision.ocr.PPOCRv3(
|
||||
det_model=det_model, cls_model=cls_model, rec_model=rec_model)
|
||||
elif "OCRv4" in args.model_dir:
|
||||
det_option = option
|
||||
if args.backend in ["trt", "paddle_trt"]:
|
||||
det_option.trt_option.set_shape(
|
||||
"x", [1, 3, 64, 64], [1, 3, 640, 640], [1, 3, 960, 960])
|
||||
det_model = fd.vision.ocr.DBDetector(
|
||||
det_model_file, det_params_file, runtime_option=det_option)
|
||||
cls_option = option
|
||||
if args.backend in ["trt", "paddle_trt"]:
|
||||
cls_option.trt_option.set_shape(
|
||||
"x", [1, 3, 48, 10], [10, 3, 48, 320], [64, 3, 48, 1024])
|
||||
cls_model = fd.vision.ocr.Classifier(
|
||||
cls_model_file, cls_params_file, runtime_option=cls_option)
|
||||
rec_option = option
|
||||
if args.backend in ["trt", "paddle_trt"]:
|
||||
rec_option.trt_option.set_shape(
|
||||
"x", [1, 3, 48, 10], [10, 3, 48, 320], [64, 3, 48, 2304])
|
||||
rec_model = fd.vision.ocr.Recognizer(
|
||||
rec_model_file,
|
||||
rec_params_file,
|
||||
rec_label_file,
|
||||
runtime_option=rec_option)
|
||||
model = fd.vision.ocr.PPOCRv4(
|
||||
det_model=det_model, cls_model=cls_model, rec_model=rec_model)
|
||||
else:
|
||||
raise Exception("model {} not support now in ppocr series".format(
|
||||
args.model_dir))
|
||||
|
Reference in New Issue
Block a user