-
Notifications
You must be signed in to change notification settings - Fork 386
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge code from #66
- Loading branch information
weiqingchu
committed
Sep 22, 2019
1 parent
7082899
commit d8c43fc
Showing
10 changed files
with
286 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,155 @@ | ||
# Small font_size will make text looks like blured/prydown | ||
font_size: | ||
min: 14 | ||
max: 23 | ||
|
||
# choose Text color range | ||
# color boundary is in R,G,B format | ||
font_color: | ||
enable: true | ||
blue: | ||
fraction: 0.5 | ||
l_boundary: [0,0,150] | ||
h_boundary: [60,60,255] | ||
brown: | ||
fraction: 0.5 | ||
l_boundary: [139,70,19] | ||
h_boundary: [160,82,43] | ||
|
||
# By default, text is drawed by Pillow with (https://stackoverflow.com/questions/43828955/measuring-width-of-text-python-pil) | ||
# If `random_space` is enabled, some text will be drawed char by char with a random space | ||
random_space: | ||
enable: true | ||
fraction: 0.3 | ||
min: -0.1 # -0.1 will make chars very close or even overlapped | ||
max: 0.1 | ||
|
||
# Do remap with sin() | ||
# Currently this process is very slow! | ||
curve: | ||
enable: true | ||
fraction: 0.5 | ||
period: 360 # degree, sin 函数的周期 | ||
min: 1 # sin 函数的幅值范围 | ||
max: 5 | ||
|
||
# random crop text height | ||
crop: | ||
enable: true | ||
fraction: 0.5 | ||
|
||
# top and bottom will applied equally | ||
top: | ||
min: 5 | ||
max: 10 # in pixel, this value should small than img_height | ||
bottom: | ||
min: 5 | ||
max: 10 # in pixel, this value should small than img_height | ||
|
||
# Use image in bg_dir as background for text | ||
img_bg: | ||
enable: true | ||
fraction: 0.5 | ||
|
||
# Not work when random_space applied | ||
text_border: | ||
enable: true | ||
fraction: 0.5 | ||
|
||
# lighter than word color | ||
light: | ||
enable: true | ||
fraction: 0.5 | ||
|
||
# darker than word color | ||
dark: | ||
enable: true | ||
fraction: 0.5 | ||
|
||
# https://docs.opencv.org/3.4/df/da0/group__photo__clone.html#ga2bf426e4c93a6b1f21705513dfeca49d | ||
# https://www.cs.virginia.edu/~connelly/class/2014/comp_photo/proj2/poisson.pdf | ||
# Use opencv seamlessClone() to draw text on background | ||
# For some background image, this will make text image looks more real | ||
seamless_clone: | ||
enable: true | ||
fraction: 0.5 | ||
|
||
perspective_transform: | ||
max_x: 25 | ||
max_y: 25 | ||
max_z: 3 | ||
|
||
blur: | ||
enable: true | ||
fraction: 0.03 | ||
|
||
# If an image is applied blur, it will not be applied prydown | ||
prydown: | ||
enable: true | ||
fraction: 0.03 | ||
max_scale: 1.5 # Image will first resize to 1.5x, and than resize to 1x | ||
|
||
noise: | ||
enable: true | ||
fraction: 0.3 | ||
|
||
gauss: | ||
enable: true | ||
fraction: 0.25 | ||
|
||
uniform: | ||
enable: true | ||
fraction: 0.25 | ||
|
||
salt_pepper: | ||
enable: true | ||
fraction: 0.25 | ||
|
||
poisson: | ||
enable: true | ||
fraction: 0.25 | ||
|
||
line: | ||
enable: true | ||
fraction: 0.5 | ||
|
||
under_line: | ||
enable: true | ||
fraction: 0.2 | ||
|
||
table_line: | ||
enable: true | ||
fraction: 0.3 | ||
|
||
middle_line: | ||
enable: true | ||
fraction: 0.5 | ||
|
||
line_color: | ||
enable: true | ||
black: | ||
fraction: 0.5 | ||
l_boundary: [0,0,0] | ||
h_boundary: [64,64,64] | ||
blue: | ||
fraction: 0.5 | ||
l_boundary: [0,0,150] | ||
h_boundary: [60,60,255] | ||
|
||
# These operates are applied on the final output image, | ||
# so actually it can also be applied in training process as an data augmentation method. | ||
|
||
# By default, text is darker than background. | ||
# If `reverse_color` is enabled, some images will have dark background and light text | ||
reverse_color: | ||
enable: true | ||
fraction: 0.5 | ||
|
||
emboss: | ||
enable: true | ||
fraction: 0.1 | ||
|
||
sharp: | ||
enable: true | ||
fraction: 0.1 | ||
|
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.