| name: "ocr" |
| platform: "ensemble" |
|
|
| input [ |
| { |
| name: "IMAGE_BYTES" |
| data_type: TYPE_STRING |
| dims: [1] |
| } |
| ] |
| output [ |
| { |
| name: "TEXT_LIST" |
| data_type: TYPE_STRING |
| dims: [-1] |
| }, |
| { |
| name: "OCR_BOX_LIST" |
| data_type: TYPE_FP32 |
| dims: [-1, 4, 2] |
| } |
| ] |
|
|
| ensemble_scheduling { |
| step { |
| model_name: "ocr_td_preprocess" |
| model_version: -1 |
|
|
| input_map { key: "image_bytes" value: "IMAGE_BYTES" } |
|
|
| output_map { key: "resized_image" value: "resized_image" }, |
| output_map { key: "resize_ratio" value: "resize_ratio" }, |
| output_map { key: "original_image" value: "original_image" } |
| } |
| step { |
| model_name: "ocr_td_engine" |
| model_version: -1 |
|
|
| input_map { key: "input" value: "resized_image" } |
|
|
| output_map { key: "output" value: "td_output" } |
| } |
| step { |
| model_name: "ocr_td_postprocess" |
| model_version: -1 |
|
|
| input_map { key: "td_output" value: "td_output" }, |
| input_map { key: "resize_ratio" value: "resize_ratio" } |
|
|
| output_map { key: "detected_text_box_list" value: "detected_text_box_list" } |
| } |
| step { |
| model_name: "ocr_tr_bls" |
| model_version: -1 |
|
|
| input_map { key: "original_image" value: "original_image" }, |
| input_map { key: "detected_text_box_list" value: "detected_text_box_list" } |
|
|
| output_map { key: "text_list" value: "TEXT_LIST" }, |
| output_map { key: "box_list" value: "OCR_BOX_LIST" } |
| } |
| } |
|
|