MCPcopy Create free account

hub / github.com/Topdu/OpenOCR / functions

Functions1,872 in github.com/Topdu/OpenOCR

↓ 3 callersMethod__init__
(self, reduction='mean')
opendet/losses/det_basic_loss.py:153
↓ 3 callersMethod__init__
(self, in_channels=3, layers=50, **kwargs)
openrec/modeling/encoders/rec_resnet_vd.py:164
↓ 3 callersMethod__init__
(self, channel, reduction=4)
openrec/modeling/encoders/rec_mv1_enhance.py:226
↓ 3 callersMethod__init__
(self, dim)
openrec/modeling/encoders/convnextv2.py:52
↓ 3 callersMethod__init__
(self, in_channels, num_fiducial, loc_lr, model_name)
openrec/modeling/transforms/tps.py:222
↓ 3 callersMethod__init__
( self, dim, num_heads=8, qkv_bias=False, qk_scale=None, attn_
openrec/modeling/decoders/cppd_decoder.py:13
↓ 3 callersMethod__init__
(self, decoder_layer, num_layers, norm)
openrec/modeling/decoders/parseq_decoder.py:127
↓ 3 callersMethod__init__
( self, d_model=512, nhead=8, num_layers=4, dim_feedforward=2048,
openrec/modeling/decoders/abinet_decoder.py:10
↓ 3 callersMethod__init__
(self, in_channels, char_num, max_text_length,
openrec/modeling/decoders/srn_decoder.py:10
↓ 3 callersMethod_build_wds_pipeline
Constructs the WebDataset pipeline.
tools/data/cmer_web_dataset.py:203
↓ 3 callersFunction_flatten
(sources, lengths)
openrec/losses/visionlan_loss.py:18
↓ 3 callersMethod_fuse_bn_tensor
(self, branch)
openrec/modeling/encoders/rec_lcnetv3.py:225
↓ 3 callersFunction_get_clones
(module, N)
openrec/modeling/decoders/lpv_decoder.py:56
↓ 3 callersFunction_get_image_name_and_dir
根据图片名创建子目录并返回(img_name, img_dir)
tools/infer_doc_onnx.py:183
↓ 3 callersFunction_get_mask
Generate a square mask for the sequence. The masked positions are filled with float('-inf'). Unmasked positions are filled with float(0.0).
openrec/modeling/decoders/abinet_decoder.py:258
↓ 3 callersFunction_merge_dict
Recursive dict merge. Inspired by :meth:``dict.update()``, instead of updating only top-level keys, dict_merge recurses down into dicts nested to
tools/engine/config.py:63
↓ 3 callersMethod_try_parse_filename_list
(self, file_name)
tools/data/simple_dataset.py:94
↓ 3 callersMethod_write_merged_text
将合并的文本写入文件
tools/infer_doc_onnx.py:1193
↓ 3 callersFunctionadd_id
Add id for gather feature, for inference.
tools/utils/e2e_utils/extract_textpoint_slow.py:205
↓ 3 callersFunctioncheck_and_download_font
(font_path)
tools/infer_e2e.py:37
↓ 3 callersFunctioncheck_and_download_model
检查预训练模型是否存在,若不存在则从 ModelScope 或 HuggingFace 下载到固定缓存目录。 优先从 ModelScope 下载,失败后回退到 HuggingFace。 Args: model_name (str): 模型文件的名称,例如
tools/infer_rec.py:33
↓ 3 callersFunctioncheck_and_read
(img_path)
tools/utils/utility.py:76
↓ 3 callersMethodcombine_results
(self, results)
opendet/metrics/eval_det_iou.py:163
↓ 3 callersMethoddecode
convert text-index into text-label.
openrec/postprocess/ctc_postprocess.py:55
↓ 3 callersMethoddecode
convert text-index into text-label.
openrec/postprocess/char_postprocess.py:58
↓ 3 callersFunctiondetection_filtering
(detections, groundtruths, threshold=0.5)
tools/utils/e2e_metric/Deteval.py:58
↓ 3 callersFunctiondownload_example_images
Download example images from ModelScope dataset. Returns: Dict with paths to example image directories: {'ocr': path, 'doc': path, 'unire
tools/download_example_images.py:7
↓ 3 callersFunctiondraw_ocr_box_txt
( image, boxes, txts=None, scores=None, drop_score=0.5, font_path='./doc/fonts/simfang
tools/infer/utility.py:132
↓ 3 callersFunctiondynamic_import
(class_name)
openrec/preprocess/__init__.py:128
↓ 3 callersMethodevaluate_image
(self, gt, pred)
opendet/metrics/eval_det_iou.py:16
↓ 3 callersFunctionflatten_label
(target)
openrec/losses/visionlan_loss.py:6
↓ 3 callersMethodflops
(self)
openrec/modeling/encoders/focalsvtr.py:624
↓ 3 callersMethodforward_decoder
(self, q, x, mask=None)
openrec/modeling/decoders/bus_decoder.py:71
↓ 3 callersFunctionget_example_images_path
Get the path to example images for a specific demo type. Args: demo_type: Type of demo ('ocr', 'doc', or 'unirec') Returns:
tools/download_example_images.py:203
↓ 3 callersFunctionget_intersection
(pD, pG)
opendet/preprocess/crop_paste.py:143
↓ 3 callersMethodget_mini_boxes
(self, contour)
opendet/postprocess/db_postprocess.py:149
↓ 3 callersFunctiongt_reading_mod
This helper reads groundtruths from mat files
tools/utils/e2e_metric/Deteval.py:26
↓ 3 callersMethodinfer_single_image
(self, img_numpy, ori_img, cr
tools/infer_e2e.py:155
↓ 3 callersFunctionis_poly_outside_rect
(poly, x, y, w, h)
opendet/preprocess/crop_resize.py:41
↓ 3 callersFunctionmerge_blocks
Merge blocks based on alignment and overlap logic, except for those with labels in non_merge_labels. Args: blocks (List[Dict]): List
tools/utils/opendoc_onnx_utils/utils.py:258
↓ 3 callersMethodparse_args
(self, argv=None)
tools/engine/config.py:21
↓ 3 callersMethodreset
(self)
openrec/metrics/rec_metric.py:253
↓ 3 callersFunctionsigma_calculation
sigma = inter_area / gt_area
tools/utils/e2e_metric/Deteval.py:76
↓ 3 callersFunctionstream_match
(text)
openrec/metrics/rec_metric.py:14
↓ 3 callersFunctiontau_calculation
(det_x, det_y, gt_x, gt_y)
tools/utils/e2e_metric/Deteval.py:84
↓ 3 callersMethodtrain
(self)
tools/engine/trainer.py:237
↓ 3 callersFunctionwibbledmean
(array)
openrec/preprocess/cmer_label_encode.py:352
↓ 2 callersMethod_2d_attation
(self, feat, tokens, data, training)
openrec/modeling/decoders/sar_decoder.py:124
↓ 2 callersMethod__init__
(self, config_path, BASE_KEY='_BASE_')
tools/engine/config.py:105
↓ 2 callersMethod__init__
(self, config: UniRecConfig)
openrec/modeling/unirec_modeling/modeling_unirec.py:140
↓ 2 callersMethod__init__
(self, in_planes, num_ctrlpoints, activation='none')
openrec/modeling/transforms/aster_tps.py:28
↓ 2 callersMethod__init__
(self, in_channels, out_channels, num_layer=2,
openrec/modeling/decoders/smtr_decoder.py:116
↓ 2 callersMethod__init__
(self, channels_list=[64, 128, 256, 512], strides_list=[[2, 2], [1, 1], [1,
openrec/modeling/decoders/dan_decoder.py:13
↓ 2 callersMethod__init__
(self, dim, max_len=25)
openrec/modeling/decoders/ote_decoder.py:11
↓ 2 callersMethod__init__
(self, in_timestep, in_planes, mid_dim=4096, embed_dim=300)
openrec/modeling/decoders/aster_decoder.py:9
↓ 2 callersMethod__init__
(self)
openrec/modeling/decoders/ctc_decoder.py:17
↓ 2 callersMethod__init__
( self, dim, nextq2subs_head2=None, dynq2img_heads=2, mlp_ratio=4.0,
openrec/modeling/decoders/smtr_decoder_nattn.py:62
↓ 2 callersMethod__init__
(self, charset: str)
openrec/preprocess/dptr_label_encode.py:105
↓ 2 callersMethod__len__
(self)
tools/data/lmdb_dataset.py:141
↓ 2 callersMethod__len__
(self)
tools/data/text_lmdb_dataset.py:130
↓ 2 callersMethod__len__
(self)
tools/data/strlmdb_dataset.py:143
↓ 2 callersFunction_check_image_file
(path)
tools/utils/utility.py:29
↓ 2 callersMethod_compute_single_pair
(self, pred, label)
openrec/metrics/rec_metric_cmer.py:255
↓ 2 callersMethod_create_env
(self)
tools/data/lmdb_dataset_test.py:92
↓ 2 callersFunction_drain_pool_pandas
(pool)
tools/data/cmer_web_dataset.py:135
↓ 2 callersFunction_get_ngrams
(segment, max_order)
openrec/metrics/rec_metric_cmer.py:11
↓ 2 callersMethod_get_ref_points
(self, H_key, W_key, B, dtype, device)
openrec/modeling/encoders/cam_encoder.py:459
↓ 2 callersMethod_infer_single_image
Run inference on a single PIL Image. Args: image: PIL Image object (RGB format) max_length: Maximum generation length
tools/infer_unirec_onnx.py:635
↓ 2 callersFunction_make_divisible
This function is taken from the original tf repo. It ensures that all layers have a channel number that is divisible by 8 It can be seen
opendet/modeling/backbones/repvit.py:11
↓ 2 callersFunction_make_divisible
This function is taken from the original tf repo. It ensures that all layers have a channel number that is divisible by 8 It can be seen
openrec/modeling/encoders/repvit.py:11
↓ 2 callersMethod_normalize_text
(self, text)
openrec/metrics/rec_metric_long.py:27
↓ 2 callersMethod_pos_emb
word_Seq: bsz len pos: bsz len
openrec/modeling/decoders/srn_decoder.py:131
↓ 2 callersMethod_resize_uint8
(self, img_uint8: np.ndarray, th: int, tw: int, backend: str)
openrec/preprocess/cmer_label_encode.py:573
↓ 2 callersFunction_transform
(n_px)
openrec/modeling/decoders/dptr_parseq_clip_b_decoder.py:348
↓ 2 callersMethodbox_score_fast
box_score_fast: use bbox mean score as the mean score
opendet/postprocess/db_postprocess.py:172
↓ 2 callersFunctionbuild_loss
(config)
openrec/losses/__init__.py:29
↓ 2 callersFunctionbuild_post_process
(config, global_config=None)
openrec/postprocess/__init__.py:27
↓ 2 callersFunctionbuild_rec_process
(cfg)
tools/infer_rec.py:158
↓ 2 callersFunctionbytes_to_unicode
Returns list of utf-8 byte and a corresponding list of unicode strings. The reversible bpe codes work on unicode strings. This means you
openrec/modeling/decoders/dptr_parseq_clip_b_decoder.py:55
↓ 2 callersFunctioncalculate_overlap_ratio
Calculate the overlap ratio between two bounding boxes using NumPy. Args: bbox1 (np.ndarray, list or tuple): The first bounding box,
tools/utils/opendoc_onnx_utils/utils.py:33
↓ 2 callersMethodchar_decode
convert text-index into text-label.
openrec/postprocess/mgp_postprocess.py:80
↓ 2 callersFunctioncheck_and_download_model
检查预训练模型是否存在,若不存在则从 ModelScope 或 HuggingFace 下载到固定缓存目录。 优先从 ModelScope 下载,失败后回退到 HuggingFace。 Args: model_name (str): 模型文件的名称,例如
tools/infer_det.py:36
↓ 2 callersFunctionclean_special_tokens
Clean special tokens from decoded text.
tools/infer_unirec_onnx.py:334
↓ 2 callersFunctioncompute_partial_repr
(input_points, control_points)
openrec/modeling/transforms/aster_tps.py:111
↓ 2 callersFunctionconv1x1
1x1 convolution.
openrec/modeling/encoders/resnet31_rnn.py:14
↓ 2 callersFunctionconv3x3
(in_channel, out_channel, stride=1)
openrec/modeling/encoders/rec_resnet_31.py:6
↓ 2 callersFunctionconvert_otsl_to_html
Convert OTSL-v1.0 string to HTML. Only 6 tags allowed: <fcel>, <ecel>, <nl>, <lcel>, <ucel>, <xcel>. Args: otsl_content (str): OTSL
tools/utils/opendoc_onnx_utils/utils.py:906
↓ 2 callersMethodcreate_batch
(self)
tools/data/ratio_sampler.py:120
↓ 2 callersFunctioncreate_font
(txt, sz, font_path="./doc/fonts/simfang.ttf")
tools/utils/visual.py:85
↓ 2 callersFunctioncreate_font
(txt, sz, font_path='./doc/fonts/simfang.ttf')
tools/infer/utility.py:81
↓ 2 callersMethodcrop_by_boxes
根据检测框裁剪图像区域 Args: image: BGR格式的原始图像 boxes: 检测框列表 Returns: 包含裁剪图像的块列表
tools/infer_doc_onnx.py:312
↓ 2 callersFunctioncrop_margin
(img)
tools/utils/opendoc_onnx_utils/utils.py:1023
↓ 2 callersFunctionctc_decoder_for_image
CTC decoder using multiple processes.
tools/utils/e2e_utils/extract_textpoint_slow.py:153
↓ 2 callersMethoddecode
convert text-index into text-label.
openrec/postprocess/smtr_postprocess.py:46
↓ 2 callersMethoddecode
convert text-index into text-label.
openrec/postprocess/ce_postprocess.py:29
↓ 2 callersMethoddecode
convert text-index into text-label.
openrec/postprocess/lister_postprocess.py:36
↓ 2 callersMethoddecode
convert text-index into text-label.
openrec/postprocess/srn_postprocess.py:24
↓ 2 callersMethoddecode_step
Unified decoder step with or without cache.
tools/infer_unirec_onnx.py:500
↓ 2 callersFunctiondownload_layout_model
Download layout detection ONNX model from ModelScope or HuggingFace. Args: model_dir: Directory to save model file. If None, use default
tools/infer_doc_onnx.py:44
↓ 2 callersFunctiondownload_model_files
Download ONNX model files from ModelScope or HuggingFace. Args: model_dir: Directory to save model files. If None, use default cache dire
tools/infer_unirec_onnx.py:21
← previousnext →101–200 of 1,872, ranked by callers