Description
I tested performance for single line and single image generation, 20 lines, result as before,
pure pillow, about 2s
synthtiger: 40s
I wonder how to improve speed for synthtiger, not considering worker number.
6090675 function calls (6043707 primitive calls) in 72.690 seconds
Ordered by: internal time
ncalls tottime percall cumtime percall filename:lineno(function)
2892831 34.393 0.000 34.393 0.000 {floodFill}
104 10.388 0.100 46.299 0.445 template_cnjpkr_str.py:295(_check_visibility)
2284 2.987 0.001 2.987 0.001 {method 'getsize' of 'FontFamily' objects}
17726 2.218 0.000 2.218 0.000 {method 'astype' of 'numpy.ndarray' objects}
115572/77434 1.928 0.000 5.748 0.000 {built-in method numpy.core._multiarray_umath.implement_array_function}
150664 1.924 0.000 2.687 0.000 {built-in method numpy.array}
181 1.322 0.007 1.322 0.007 {method 'round' of 'numpy.ndarray' objects}
4434 0.745 0.000 0.745 0.000 {built-in method PIL._imaging.alpha_composite}
6 0.618 0.103 0.789 0.132 blending_functions.py:518(hard_light)
4118 0.557 0.000 4.356 0.001 image_util.py:32(paste_image)
286 0.534 0.002 0.534 0.002 {method 'decode' of 'ImagingDecoder' objects}
1910 0.500 0.000 0.500 0.000 {built-in method PIL._imagingft.getfont}
13686 0.490 0.000 0.491 0.000 {built-in method builtins.max}
4475 0.484 0.000 0.484 0.000 {built-in method builtins.min}
9 0.456 0.051 0.634 0.070 blending_functions.py:139(soft_light)
9 0.451 0.050 0.587 0.065 blending_functions.py:839(overlay)
1329 0.449 0.000 0.449 0.000 {method 'render' of 'FontFamily' objects}
955 0.419 0.000 0.419 0.000 {built-in method PIL._imagingft.getfamily}
141 0.413 0.003 0.413 0.003 {method 'repeat' of 'numpy.ndarray' objects}
54 0.385 0.007 1.911 0.035 arithmetic.py:264(_add_elementwise_to_uint8)
1974 0.378 0.000 0.378 0.000 {warpPerspective}
95 0.358 0.004 0.360 0.004 blending_functions.py:61(_compose_alpha)