MCPcopy Create free account

hub / github.com/Sanster/text_renderer / functions

Functions135 in github.com/Sanster/text_renderer

↓ 14 callersMethoddmsg
(self, msg)
textrenderer/renderer.py:124
↓ 13 callersFunctionapply
:param cfg_item: a sub cfg item in default.yml, it should contain enable and fraction. such as prydown: enabl
libs/utils.py:116
↓ 8 callersMethodis_bgr
(self)
textrenderer/renderer.py:657
↓ 6 callersFunctionfailmsg
libs/gpu/pyopencv_converter.cpp:9
↓ 5 callersFunctionremap_y
(x)
gists/cv2_remap.py:64
↓ 4 callersMethodint_around
(self, val)
textrenderer/renderer.py:208
↓ 4 callersFunctionload_chars
(filepath)
libs/utils.py:95
↓ 4 callersFunctionprob
percent: 0 ~ 1, e.g: 如果 percent=0.1,有 10% 的可能性
libs/utils.py:31
↓ 4 callersMethodrun
Generate a labels.txt file
tools/balancer.py:42
↓ 3 callersMethodapply
:param word_img: word image with big background :param text_box_pnts: left-top, right-top, right-bottom, left-bottom of text word
textrenderer/liner.py:54
↓ 3 callersFunctionbytes_feature
(value: bytes)
tools/make_tfrecord.py:22
↓ 3 callersFunctiondraw_box
:param img: gray image, will be convert to BGR image :param pnts: left-top, right-top, right-bottom, left-bottom :param color: :retur
libs/utils.py:41
↓ 3 callersMethodload
Read corpus from disk to memory
textrenderer/corpus/corpus.py:19
↓ 3 callersMethodload_corpus_path
Load txt file path in corpus_dir
textrenderer/corpus/corpus.py:33
↓ 2 callersFunctionanalyze_labels
(path: str)
tools/char_frequency_check.py:10
↓ 2 callersMethodapply_gauss_blur
(self, img, ks=None)
textrenderer/renderer.py:577
↓ 2 callersMethodchar_freq_counted
(self)
tools/balancer.py:90
↓ 2 callersFunctioncheck_font_chars
Get font supported chars and unsupported chars :param ttf: TTFont ojbect :param charset: chars :return: unsupported_chars, supported_
libs/font_utils.py:62
↓ 2 callersFunctioncheck_fraction
Check whether sum of all fractions in cfg equal to 1 :param cfg: noise/line cfg
libs/config.py:15
↓ 2 callersMethodcrop_img
Crop text from large input image :param img: image to crop :param text_box_pnts_transformed: text_bbox_pnts after apply_persp
textrenderer/renderer.py:151
↓ 2 callersFunctiondraw_border_text
(draw, text, x, y, font, thickness, border_color, text_color)
gists/outline.py:24
↓ 2 callersFunctiondraw_four_vectors
:param line: [[x1,y1],[x2,y2],[x3,y3],[x4,y4]] 矩形四点坐标的顺序: left-top, right-top, right-bottom, left-bottom
gists/cv2_remap.py:11
↓ 2 callersMethoddraw_text_wrapper
:param x/y: 应该是移除了 offset 的
textrenderer/renderer.py:389
↓ 2 callersFunctionget_fonts_chars
loads/saves font supported chars from cache file :param fonts: list of font path. e.g ['./data/fonts/msyh.ttc'] :param chars_file: arg fr
libs/font_utils.py:87
↓ 2 callersMethodget_line_color
(self)
textrenderer/liner.py:31
↓ 2 callersMethodget_random_point
(self, img)
textrenderer/liner.py:50
↓ 2 callersMethodget_word_size
Get word size removed offset :param font: truetype :param word: :return: size: word size, removed offset
textrenderer/renderer.py:531
↓ 2 callersFunctionload_config
(filepath)
libs/config.py:5
↓ 2 callersFunctionload_font
Read ttc, ttf, otf font file, return a TTFont object
libs/font_utils.py:43
↓ 2 callersFunctionmd5
(string)
libs/utils.py:110
↓ 2 callersFunctionparse_args
()
parse_args.py:6
↓ 2 callersFunctionprint_info
(chars_count_list, total_chars_count, name, max_count=15)
tools/char_frequency_check.py:26
↓ 2 callersMethodrandom_xy_offset
Get random left-top point for putting a small rect in a large rect. Normally dst_height>src_height and dst_width>src_width
textrenderer/renderer.py:128
↓ 2 callersFunctionshow_plot
(log=False)
tools/char_frequency_check.py:57
↓ 1 callersMethod_remap_y
(self, x, max_val)
textrenderer/remaper.py:60
↓ 1 callersMethodallocate
libs/gpu/pyopencv_converter.cpp:88
↓ 1 callersMethodapply_blur_on_output
(self, img)
textrenderer/renderer.py:571
↓ 1 callersMethodapply_crop
Random crop text box height top or bottom, we don't need image information in this step, only change box pnts :param text_box_pnts: b
textrenderer/renderer.py:631
↓ 1 callersMethodapply_emboss
(self, word_img)
textrenderer/renderer.py:625
↓ 1 callersMethodapply_norm_blur
(self, img, ks=None)
textrenderer/renderer.py:589
↓ 1 callersMethodapply_perspective_transform
Apply perspective transform on image :param img: origin numpy image :param text_box_pnts: four corner points of text
textrenderer/renderer.py:544
↓ 1 callersMethodapply_prydown
模糊图像,模拟小图片放大的效果
textrenderer/renderer.py:597
↓ 1 callersMethodapply_sharp
(self, word_img)
textrenderer/renderer.py:628
↓ 1 callersFunctionbuild_img_paths
Image name should be eight length with continue num. e.g. 00000000.jpg, 00000001.jpg
tools/make_tfrecord.py:36
↓ 1 callersFunctioncorpus_factory
(corpus_mode: str, chars_file: str, corpus_dir: str, length: int)
textrenderer/corpus/corpus_utils.py:7
↓ 1 callersMethodcount_char_freq
统计已经生成的 labels 中的字符频率 - 计算每个字符数量 - 计算字符平均数量 - 保存当前的低频词在语料中的索引
tools/balancer.py:118
↓ 1 callersMethodcreate_kernals
(self)
textrenderer/renderer.py:612
↓ 1 callersFunctiondict_to_args
(config: dict)
help_runner.py:19
↓ 1 callersFunctiondraw_bbox
(img, bbox, color)
libs/utils.py:69
↓ 1 callersMethoddraw_border_text
:param x/y: 应该是移除了 offset 的
textrenderer/renderer.py:398
↓ 1 callersMethoddraw_text_on_bg
Draw word in the center of background :param word: word to draw :param font: font to draw word :param bg: background
textrenderer/renderer.py:246
↓ 1 callersMethoddraw_text_seamless
(self, font, bg, word, word_color, word_height, word_width, offset)
textrenderer/renderer.py:299
↓ 1 callersMethoddraw_text_with_random_space
If random_space applied, text_x, text_y, word_width, word_height may change
textrenderer/renderer.py:350
↓ 1 callersMethodend
(self, msg, tid=None)
libs/timer.py:21
↓ 1 callersMethodfreq_check
(self, text: str)
tools/balancer.py:93
↓ 1 callersMethodgen_bg
(self, width, height)
textrenderer/renderer.py:450
↓ 1 callersMethodgen_bg_from_image
Resize background, let bg_width>=width, bg_height >=height, and random crop from resized background
textrenderer/renderer.py:473
↓ 1 callersMethodgen_img
(self, img_index)
textrenderer/renderer.py:48
↓ 1 callersFunctiongen_img_retry
(renderer, img_index)
main.py:73
↓ 1 callersMethodgen_rand_bg
Generate random background
textrenderer/renderer.py:457
↓ 1 callersFunctionget_font_paths
Load font path recursively from a folder :param fonts_dir: folder contains ttf、otf or ttc format font :return: path of all fonts
libs/font_utils.py:12
↓ 1 callersMethodget_gray_word_color
Only use word roi area to get word color
textrenderer/renderer.py:211
↓ 1 callersFunctionget_num_processes
(flags)
main.py:134
↓ 1 callersFunctionget_rotate_matrix
按照 zyx 的顺序旋转,输入角度单位为 degrees, 均为顺时针旋转 :param x: X-axis :param y: Y-axis :param z: Z-axis :return:
libs/math_utils.py:10
↓ 1 callersMethodget_sample
(self)
tools/balancer.py:71
↓ 1 callersMethodget_sample
Get word line from corpus in memory :return: string
textrenderer/corpus/corpus.py:26
↓ 1 callersMethodget_warp_matrix
(self, W, H, x, y, z, scale, fV)
libs/math_utils.py:118
↓ 1 callersMethodget_warped_pnts
(self, ptsIn, ptsOut, W, H, sidelength)
libs/math_utils.py:101
↓ 1 callersMethodget_word_color
(self)
textrenderer/renderer.py:227
↓ 1 callersFunctionload_labels
(filepath)
tools/make_tfrecord.py:28
↓ 1 callersFunctionmain
(args)
tools/make_tfrecord.py:51
↓ 1 callersFunctionmain
(args)
tools/check_tfrecord.py:10
↓ 1 callersFunctionparse_args
()
tools/balancer.py:150
↓ 1 callersFunctionparse_arguments
()
tools/make_tfrecord.py:87
↓ 1 callersFunctionparse_arguments
()
tools/check_tfrecord.py:58
↓ 1 callersMethodpick_font
:param img_index when use list corpus, this param is used :return: font: truetype size: word size, removed of
textrenderer/renderer.py:501
↓ 1 callersFunctionprocess_dir
(label_dir, log=False)
tools/char_frequency_check.py:65
↓ 1 callersFunctionprocess_file
(label_file: str, log=False)
tools/char_frequency_check.py:80
↓ 1 callersFunctionread_image
(path, size=None)
tools/make_tfrecord.py:10
↓ 1 callersFunctionread_image_raw
(img_path)
tools/make_tfrecord.py:18
↓ 1 callersFunctionrestore_exist_labels
(label_path)
main.py:123
↓ 1 callersMethodreverse_img
(self, word_img)
textrenderer/renderer.py:608
↓ 1 callersFunctionsort_labels
(tmp_label_fname, label_fname)
main.py:112
↓ 1 callersMethodstart
(self, tid=None)
libs/timer.py:15
↓ 1 callersMethodtransform_image
(self, src, gpu=False)
libs/math_utils.py:76
↓ 1 callersMethodtransform_pnts
:param pnts: 2D pnts, left-top, right-top, right-bottom, left-bottom :param M33: output from transform_image() :return: 2D pn
libs/math_utils.py:89
↓ 1 callersFunctionwarpPerspective
(src, M33, sl, gpu)
libs/math_utils.py:56
MethodArgInfo
libs/gpu/pyopencv_converter.cpp:28
MethodNumpyAllocator
libs/gpu/pyopencv_converter.cpp:85
MethodPyAllowThreads
libs/gpu/pyopencv_converter.cpp:41
MethodPyEnsureGIL
libs/gpu/pyopencv_converter.cpp:53
Method__init__
(self, args)
tools/balancer.py:26
Method__init__
(self, corpus, fonts, bgs, cfg, width=256, height=32, clip_max_chars=False, debug=False, gpu=
textrenderer/renderer.py:20
Method__init__
(self, cfg)
textrenderer/liner.py:27
Method__init__
(self, cfg)
textrenderer/noiser.py:7
Method__init__
(self, cfg)
textrenderer/remaper.py:7
Method__init__
(self, chars_file, corpus_dir=None, length=None)
textrenderer/corpus/corpus.py:8
Method__init__
(self, show_type=MILLISECOND)
libs/timer.py:12
Method__init__
(self, x, y, z, scale, fovy)
libs/math_utils.py:69
Methodapply
:param img: word image with big background
textrenderer/noiser.py:10
next →1–100 of 135, ranked by callers