SYMBOL INDEX (255 symbols across 28 files) FILE: benchmark/recog_pp.py function batched (line 15) | def batched(iterable, n, *, strict=False): function evaluate_recognition (line 25) | def evaluate_recognition(dataset, args): function print_results (line 72) | def print_results(results): function main (line 90) | def main(): FILE: benchmark/recognition.py function batched (line 18) | def batched(iterable, n, *, strict=False): function evaluate_recognition (line 28) | def evaluate_recognition(dataset, args): function print_results (line 91) | def print_results(results): function main (line 110) | def main(): FILE: benchmark/utils/scoring.py function reduce_underscores (line 7) | def reduce_underscores(text: str) -> str: function normalize_text (line 11) | def normalize_text(text): function clean_string (line 26) | def clean_string(input_string): function calculate_cer (line 43) | def calculate_cer(preds, gts, depunctuation=False): FILE: demo.py function zh_en_demo (line 4) | def zh_en_demo(): function jp_demo (line 23) | def jp_demo(): function ko_demo (line 40) | def ko_demo(): function ru_demo (line 57) | def ru_demo(): function ppocr_demo (line 74) | def ppocr_demo(): FILE: phocr/cal_rec_boxes/main.py class Direction (line 13) | class Direction(Enum): class CalRecBoxes (line 18) | class CalRecBoxes: method __call__ (line 22) | def __call__( method get_box_direction (line 51) | def get_box_direction(box: np.ndarray) -> Direction: method cal_ocr_word_box (line 69) | def cal_ocr_word_box( method calc_en_num_box (line 115) | def calc_en_num_box( method calc_box (line 130) | def calc_box( method calc_avg_char_width (line 156) | def calc_avg_char_width(word_col: List[int], each_col_width: float) ->... method calc_all_char_avg_width (line 161) | def calc_all_char_avg_width(width_list: List[float], bbox_x0: float, b... method adjust_box_overlap (line 171) | def adjust_box_overlap( method reverse_rotate_crop_image (line 185) | def reverse_rotate_crop_image( method s_rotate (line 237) | def s_rotate(angle, valuex, valuey, pointx, pointy): method order_points (line 248) | def order_points(ori_box: List[List[int]]) -> List[List[int]]: FILE: phocr/cls/main.py class TextClassifier (line 27) | class TextClassifier: method __init__ (line 28) | def __init__(self, cfg: Dict[str, Any]): method __call__ (line 36) | def __call__(self, img_list: Union[np.ndarray, List[np.ndarray]]) -> T... method resize_norm_img (line 75) | def resize_norm_img(self, img: np.ndarray) -> np.ndarray: FILE: phocr/cls/utils.py class TextClsOutput (line 28) | class TextClsOutput: method __len__ (line 33) | def __len__(self): method vis (line 38) | def vis(self, save_path: Optional[Union[str, Path]] = None) -> Optiona... class ClsPostProcess (line 55) | class ClsPostProcess: method __init__ (line 56) | def __init__(self, label_list: List[str]): method __call__ (line 59) | def __call__(self, preds: np.ndarray) -> List[Tuple[str, float]]: FILE: phocr/det/main.py class TextDetector (line 25) | class TextDetector: method __init__ (line 26) | def __init__(self, cfg: Dict[str, Any]): method __call__ (line 45) | def __call__(self, img: np.ndarray) -> TextDetOutput: method get_preprocess (line 66) | def get_preprocess(self, max_wh: int) -> DetPreProcess: method sorted_boxes (line 78) | def sorted_boxes(dt_boxes: np.ndarray) -> List[np.ndarray]: FILE: phocr/det/utils.py class TextDetOutput (line 17) | class TextDetOutput: method __len__ (line 23) | def __len__(self): method vis (line 28) | def vis(self, save_path: Optional[str] = None) -> Optional[np.ndarray]: class DetPreProcess (line 42) | class DetPreProcess: method __init__ (line 43) | def __init__(self, limit_side_len: int = 736, limit_type: str = "min",... method __call__ (line 57) | def __call__(self, img: np.ndarray) -> Optional[np.ndarray]: method normalize (line 67) | def normalize(self, img: np.ndarray) -> np.ndarray: method permute (line 70) | def permute(self, img: np.ndarray) -> np.ndarray: method resize (line 73) | def resize(self, img: np.ndarray) -> Optional[np.ndarray]: class ResizeImgError (line 110) | class ResizeImgError(Exception): class DBPostProcess (line 114) | class DBPostProcess: method __init__ (line 117) | def __init__( method __call__ (line 137) | def __call__(self, pred: np.ndarray, ori_shape: Tuple[int, int]) -> Tu... method boxes_from_bitmap (line 149) | def boxes_from_bitmap( method get_mini_boxes (line 193) | def get_mini_boxes(self, contour: np.ndarray) -> Tuple[np.ndarray, flo... method box_score_fast (line 216) | def box_score_fast(bitmap: np.ndarray, _box: np.ndarray) -> float: method box_score_slow (line 230) | def box_score_slow(self, bitmap: np.ndarray, contour: np.ndarray) -> f... method unclip (line 249) | def unclip(self, box: np.ndarray) -> np.ndarray: method filter_det_res (line 258) | def filter_det_res( method order_points_clockwise (line 275) | def order_points_clockwise(self, pts: np.ndarray) -> np.ndarray: method clip_det_res (line 300) | def clip_det_res(self, points: np.ndarray, img_height: int, img_width:... FILE: phocr/inference_engine/base.py function get_engine (line 20) | def get_engine(engine_type: EngineType): class FileInfo (line 33) | class FileInfo: class InferSession (line 41) | class InferSession(abc.ABC): method __init__ (line 47) | def __init__(self, config): method __call__ (line 51) | def __call__(self, input_content: np.ndarray) -> np.ndarray: method _verify_model (line 55) | def _verify_model(model_path: Union[str, Path, None]): method have_key (line 67) | def have_key(self, key: str = "character") -> bool: method get_model_url (line 71) | def get_model_url(cls, file_info: FileInfo) -> Dict[str, str]: method get_dict_key_url (line 90) | def get_dict_key_url(cls, file_info: FileInfo) -> str: FILE: phocr/inference_engine/onnxruntime/main.py class OrtInferSession (line 15) | class OrtInferSession(InferSession): method __init__ (line 16) | def __init__(self, cfg: Dict[str, Any]): method _init_sess_opts (line 63) | def _init_sess_opts(cfg: Dict[str, Any]) -> SessionOptions: method __call__ (line 80) | def __call__(self, input_content: Union[np.ndarray, Tuple[np.ndarray, ... method get_input_names (line 89) | def get_input_names(self) -> List[str]: method get_output_names (line 92) | def get_output_names(self) -> List[str]: method get_character_list (line 95) | def get_character_list(self, key: str = "character") -> List[str]: method have_key (line 99) | def have_key(self, key: str = "character") -> bool: class ONNXRuntimeError (line 106) | class ONNXRuntimeError(Exception): FILE: phocr/inference_engine/onnxruntime/provider_config.py class EP (line 10) | class EP(Enum): class ProviderConfig (line 17) | class ProviderConfig: method __init__ (line 18) | def __init__(self, engine_cfg: Dict[str, Any]): method get_ep_list (line 30) | def get_ep_list(self) -> List[Tuple[str, Dict[str, Any]]]: method cpu_ep_cfg (line 46) | def cpu_ep_cfg(self) -> Dict[str, Any]: method cuda_ep_cfg (line 49) | def cuda_ep_cfg(self) -> Dict[str, Any]: method dml_ep_cfg (line 52) | def dml_ep_cfg(self) -> Dict[str, Any]: method cann_ep_cfg (line 60) | def cann_ep_cfg(self) -> Dict[str, Any]: method verify_providers (line 63) | def verify_providers(self, session_providers: Sequence[str]): method is_cuda_available (line 82) | def is_cuda_available(self) -> bool: method is_dml_available (line 105) | def is_dml_available(self) -> bool: method is_cann_available (line 140) | def is_cann_available(self) -> bool: method print_log (line 161) | def print_log(self, log_list: List[str]): FILE: phocr/main.py class PHOCR (line 27) | class PHOCR: method __init__ (line 28) | def __init__(self, config_path: Optional[str] = None, params: Optional... method load_config (line 35) | def load_config(self, config_path: Optional[str], params: Optional[Dic... method initialize (line 45) | def initialize(self, cfg: DictConfig): method __call__ (line 70) | def __call__( method finalize_results (line 112) | def finalize_results( method calc_word_boxes (line 127) | def calc_word_boxes( method update_params (line 153) | def update_params( method preprocess_img (line 170) | def preprocess_img(self, ori_img: np.ndarray) -> Tuple[np.ndarray, Dic... method get_det_res (line 176) | def get_det_res(self, img: np.ndarray, op_record: Dict[str, Any]) -> T... method get_crop_img_list (line 185) | def get_crop_img_list(self, img: np.ndarray, det_res: TextDetOutput) -... method get_cls_res (line 193) | def get_cls_res(self, img: List[np.ndarray]) -> Tuple[List[np.ndarray]... method get_rec_res (line 199) | def get_rec_res(self, img: List[np.ndarray]) -> TextRecOutput: method get_final_res (line 203) | def get_final_res( method filter_by_text_score (line 239) | def filter_by_text_score(self, ocr_res: PHOCROutput) -> PHOCROutput: method _add_letterbox (line 252) | def _add_letterbox(self, img: np.ndarray, op_record: Dict[str, Any]) -... method _get_origin_points (line 269) | def _get_origin_points( class PHOCRError (line 295) | class PHOCRError(Exception): FILE: phocr/rec/main.py class Preprocess (line 17) | class Preprocess: method __init__ (line 18) | def __init__(self, cfg: Dict[str, Any]): method _pad_image_to_width (line 25) | def _pad_image_to_width(self, img: np.ndarray, max_width: int) -> np.n... method _resize_image (line 32) | def _resize_image( method _preprocess_batch (line 85) | def _preprocess_batch( method __call__ (line 120) | def __call__(self, images: List[np.ndarray]) -> Tuple[np.ndarray, np.n... class Postprocess (line 132) | class Postprocess: method __init__ (line 133) | def __init__(self, cfg: Dict[str, Any]): method __call__ (line 137) | def __call__(self, outputs: np.ndarray) -> List[str]: method _convert_score (line 153) | def _convert_score(self, score: np.ndarray) -> float: class ImageSegmenter (line 157) | class ImageSegmenter: method __init__ (line 158) | def __init__(self): method _get_patches (line 165) | def _get_patches(self, img: np.ndarray) -> List[np.ndarray]: method __call__ (line 204) | def __call__(self, image_list: List[np.ndarray]) -> Tuple[List[int], L... method postprocess (line 208) | def postprocess(self, groups: List[int], rec_res: List[Tuple[str, floa... method is_chinese (line 225) | def is_chinese(label: str) -> bool: class TextRecognizer (line 232) | class TextRecognizer: method __init__ (line 233) | def __init__(self, cfg: Dict[str, Any]): method __call__ (line 246) | def __call__(self, args: TextRecInput) -> TextRecOutput: method load_charset (line 280) | def load_charset(self, charset_path: str) -> List[str]: FILE: phocr/rec/typings.py class TextRecConfig (line 16) | class TextRecConfig: class TextRecInput (line 29) | class TextRecInput: class TextRecOutput (line 34) | class TextRecOutput: method __len__ (line 41) | def __len__(self): method vis (line 46) | def vis(self, save_path: Optional[Union[str, Path]] = None) -> Optiona... class WordType (line 60) | class WordType(Enum): class WordInfo (line 68) | class WordInfo: FILE: phocr/rec/utils.py class CTCLabelDecode (line 10) | class CTCLabelDecode: method __init__ (line 11) | def __init__( method __call__ (line 19) | def __call__( method get_character (line 38) | def get_character( method read_character_file (line 61) | def read_character_file(character_path: Union[str, Path]) -> List[str]: method insert_special_char (line 71) | def insert_special_char(character_list: List[str], special_char: str, ... method decode (line 75) | def decode( method get_word_info (line 119) | def get_word_info(text: str, selection: np.ndarray) -> WordInfo: method get_ignored_tokens (line 174) | def get_ignored_tokens() -> List[int]: FILE: phocr/utils/download_file.py class DownloadFileInput (line 14) | class DownloadFileInput: class DownloadFile (line 21) | class DownloadFile: method run (line 26) | def run(cls, input_params: DownloadFileInput): method _ensure_parent_dir_exists (line 38) | def _ensure_parent_dir_exists(path: Path): method _should_skip_download (line 42) | def _should_skip_download(cls, path: Path, expected_sha256: Optional[s... method _make_http_request (line 58) | def _make_http_request(cls, url: str, logger: logging.Logger) -> reque... method _save_response_with_progress (line 70) | def _save_response_with_progress(cls, response: requests.Response, sav... method check_file_sha256 (line 88) | def check_file_sha256(file_path: Union[str, Path], gt_sha256: str) -> ... method check_is_atty (line 92) | def check_is_atty() -> bool: class DownloadFileException (line 100) | class DownloadFileException(Exception): FILE: phocr/utils/load_image.py class LoadImage (line 16) | class LoadImage: method __init__ (line 17) | def __init__(self): method __call__ (line 20) | def __call__(self, img: InputType) -> np.ndarray: method load_img (line 29) | def load_img(self, img: InputType) -> np.ndarray: method img_to_ndarray (line 56) | def img_to_ndarray(self, img: Image.Image) -> np.ndarray: method convert_img (line 64) | def convert_img(self, img: np.ndarray, origin_img_type: Any) -> np.nda... method cvt_two_to_three (line 89) | def cvt_two_to_three(img: np.ndarray) -> np.ndarray: method cvt_four_to_three (line 103) | def cvt_four_to_three(img: np.ndarray) -> np.ndarray: method verify_exist (line 121) | def verify_exist(file_path: Union[str, Path]): class LoadImageError (line 126) | class LoadImageError(Exception): FILE: phocr/utils/logger.py class Logger (line 6) | class Logger: method __init__ (line 7) | def __init__(self, log_level=logging.DEBUG, logger_name=None): method get_log (line 33) | def get_log(self): FILE: phocr/utils/onnx_helper.py class KVCache (line 18) | class KVCache: method __init__ (line 19) | def __init__(self, device_id=0): method alloc (line 24) | def alloc(self, name, batchxbeam, max_seq_len): method has_name (line 44) | def has_name(self, name): method alloc_view (line 47) | def alloc_view(self, buffer_name, name, batchxbeam, seq_len): method clear_view (line 60) | def clear_view(self): method bind_input (line 63) | def bind_input(self, io_binding, name): method bind_output (line 73) | def bind_output(self, io_binding, name): method get_tensor (line 83) | def get_tensor(self, name): function numpy_obj_to_dtype (line 90) | def numpy_obj_to_dtype(arr: np.ndarray): function inspect_ortvalue (line 109) | def inspect_ortvalue(ov): function sequence_mask_np (line 118) | def sequence_mask_np(lengths, max_len=None): function log_softmax (line 131) | def log_softmax(x, axis=-1): function gather_nd (line 138) | def gather_nd(params: np.ndarray, indices: np.ndarray) -> np.ndarray: function gather_tree_numpy (line 153) | def gather_tree_numpy(values, parents): function finalize (line 171) | def finalize(beam_size, output_ids, parent_ids, out_seq_lens, end_id, ma... function topk (line 204) | def topk(a, k, axis=-1, largest=True, sorted=True): class ORTSeq2Seq (line 221) | class ORTSeq2Seq(object): method __init__ (line 226) | def __init__(self, cfg: Dict[str, Any]): method _load_vocab (line 295) | def _load_vocab(self, decoder_path): method batch_decode (line 308) | def batch_decode(self, outputs): method clear_io_binding (line 321) | def clear_io_binding(self): method _bind_io_for_encoder (line 327) | def _bind_io_for_encoder(self, inputs: Dict[str, np.ndarray]): method _bind_io_for_decoder (line 347) | def _bind_io_for_decoder(self, inputs: Dict[str, Any], cache=None): method forward_encoder (line 381) | def forward_encoder(self, inputs: List[np.ndarray]): method forward_decoder (line 395) | def forward_decoder(self, inputs: List[Any], cache=None): method greedy_search (line 411) | def greedy_search(self, images: np.ndarray, images_shape: np.ndarray): method beam_search (line 464) | def beam_search(self, images: np.ndarray, images_shape: np.ndarray, be... method run (line 567) | def run(self, inputs: List[np.ndarray], beam_size: int = 5): FILE: phocr/utils/output.py class PHOCROutput (line 15) | class PHOCROutput: method __post_init__ (line 24) | def __post_init__(self): method __len__ (line 27) | def __len__(self): method to_json (line 32) | def to_json(self): method to_markdown (line 35) | def to_markdown(self) -> str: method vis (line 38) | def vis(self, save_path: Optional[str] = None, font_path: Optional[str... FILE: phocr/utils/parse_parameters.py class ParseParams (line 18) | class ParseParams(OmegaConf): method __init__ (line 19) | def __init__(self): method load (line 23) | def load(cls, file_path: Union[str, Path]) -> DictConfig: method update_batch (line 32) | def update_batch(cls, cfg: DictConfig, params: Dict[str, Any]) -> Dict... method _convert_value_to_enum (line 52) | def _convert_value_to_enum(cls, cfg: DictConfig): method LangType (line 61) | def LangType(task_type: TaskType, lang_type: str): FILE: phocr/utils/process_img.py function get_padding_h (line 7) | def get_padding_h(h: int, w: int, width_height_ratio: float, min_height:... function get_rotate_crop_image (line 13) | def get_rotate_crop_image(img: np.ndarray, points: np.ndarray) -> np.nda... function resize_image_within_bounds (line 48) | def resize_image_within_bounds( function reduce_max_side (line 64) | def reduce_max_side(img: np.ndarray, max_side_len: float = 2000) -> Tupl... function increase_min_side (line 92) | def increase_min_side(img: np.ndarray, min_side_len: float = 30) -> Tupl... function add_round_letterbox (line 120) | def add_round_letterbox(img: np.ndarray, padding_tuple: Tuple[int, int, ... class ResizeImgError (line 133) | class ResizeImgError(Exception): FILE: phocr/utils/to_markdown.py class ToMarkdown (line 5) | class ToMarkdown: method to (line 7) | def to(cls, boxes, txts) -> str: method get_box_properties (line 84) | def get_box_properties(box: np.ndarray) -> dict: FILE: phocr/utils/typings.py class LangDet (line 4) | class LangDet(Enum): class LangCls (line 10) | class LangCls(Enum): class LangRec (line 14) | class LangRec(Enum): class OCRVersion (line 22) | class OCRVersion(Enum): class EngineType (line 28) | class EngineType(Enum): class ModelType (line 35) | class ModelType(Enum): class TaskType (line 41) | class TaskType(Enum): FILE: phocr/utils/utils.py function quads_to_rect_bbox (line 12) | def quads_to_rect_bbox(bbox: np.ndarray) -> Tuple[float, float, float, f... function has_chinese_char (line 25) | def has_chinese_char(text: str) -> bool: function get_file_sha256 (line 29) | def get_file_sha256(file_path: Union[str, Path], chunk_size: int = 65536... function save_img (line 41) | def save_img(save_path: Union[str, Path], img: np.ndarray): function is_url (line 48) | def is_url(url: str) -> bool: function import_package (line 56) | def import_package(name, package=None): function batched (line 64) | def batched(iterable, n, *, strict=False): FILE: phocr/utils/vis_res.py class VisRes (line 28) | class VisRes: method __init__ (line 29) | def __init__(self, text_score: float = 0.5): method __call__ (line 37) | def __call__( method draw_dt_boxes (line 52) | def draw_dt_boxes( method get_font_path (line 80) | def get_font_path( method draw_rec_res (line 126) | def draw_rec_res( method draw_one_rec_res (line 139) | def draw_one_rec_res( method draw_ocr_box_txt (line 180) | def draw_ocr_box_txt( method get_random_color (line 231) | def get_random_color() -> Tuple[int, int, int]: method get_box_height (line 239) | def get_box_height(box: List[List[Union[float, int]]]) -> float: method get_box_width (line 243) | def get_box_width(box: List[List[Union[float, int]]]) -> float: method get_char_size (line 247) | def get_char_size(font, char_str: str) -> float: method concat_imgs (line 260) | def concat_imgs(imgs: List[np.ndarray], direction: str = "horizontal")... FILE: setup.py function read_readme (line 7) | def read_readme(): function read_requirements (line 13) | def read_requirements(): function get_package_data (line 21) | def get_package_data():