CTC decoder using multiple processes.
(gather_info_list,
logits_map,
Lexicon_Table,
pts_num=6,
point_gather_mode=None)
| 111 | |
| 112 | |
| 113 | def ctc_decoder_for_image(gather_info_list, |
| 114 | logits_map, |
| 115 | Lexicon_Table, |
| 116 | pts_num=6, |
| 117 | point_gather_mode=None): |
| 118 | """ |
| 119 | CTC decoder using multiple processes. |
| 120 | """ |
| 121 | decoder_str = [] |
| 122 | decoder_xys = [] |
| 123 | for gather_info in gather_info_list: |
| 124 | if len(gather_info) < pts_num: |
| 125 | continue |
| 126 | dst_str, xys_list = instance_ctc_greedy_decoder( |
| 127 | gather_info, |
| 128 | logits_map, |
| 129 | pts_num=pts_num, |
| 130 | point_gather_mode=point_gather_mode, ) |
| 131 | dst_str_readable = "".join([Lexicon_Table[idx] for idx in dst_str]) |
| 132 | if len(dst_str_readable) < 2: |
| 133 | continue |
| 134 | decoder_str.append(dst_str_readable) |
| 135 | decoder_xys.append(xys_list) |
| 136 | return decoder_str, decoder_xys |
| 137 | |
| 138 | |
| 139 | def sort_with_direction(pos_list, f_direction): |
no test coverage detected