@@ -56,6 +56,16 @@ def __init__(self):
56
56
self .extract_font_properties = True
57
57
self .distort_image = False
58
58
59
+ def __eq__ (self , other ):
60
+ return (argparse .Namespace .__eq__ (self , other ) and
61
+ self .uname = other .uname and self .lang_code = other .lang_code and
62
+ self .timestamp = other .timestamp and self .font_config_cache = other .font_config_cache and
63
+ self .fonts_dir = other .fonts_dir and self .max_pages = other .max_pages and
64
+ self .save_box_tiff = other .save_box_tiff and self .overwrite = other .overwrite and
65
+ self .linedata = other .linedata and self .run_shape_clustering = other .run_shape_clustering and
66
+ self .extract_font_properties = other .extract_font_properties and
67
+ self .distort_image = other .distort_image )
68
+
59
69
60
70
def err_exit (msg ):
61
71
log .critical (msg )
@@ -356,7 +366,7 @@ def generate_font_image(ctx, font, exposure, char_spacing):
356
366
357
367
358
368
# Phase I : Generate (I)mages from training text for each font.
359
- def phase_I_generate_image (ctx , par_factor ):
369
+ def phase_I_generate_image (ctx , par_factor = None ):
360
370
if not par_factor or par_factor <= 0 :
361
371
par_factor = 1
362
372
@@ -386,7 +396,7 @@ def phase_I_generate_image(ctx, par_factor):
386
396
387
397
with tqdm (
388
398
total = len (ctx .fonts )
389
- ) as pbar , concurrent .futures .ThreadPoolExecutor (max_workers = 8 ) as executor :
399
+ ) as pbar , concurrent .futures .ThreadPoolExecutor (max_workers = par_factor ) as executor :
390
400
futures = [
391
401
executor .submit (generate_font_image , ctx , font , exposure , char_spacing )
392
402
for font in ctx .fonts
0 commit comments