The cnn-rnn ocr model can be trained now

This commit is contained in:
vahidrezanezhad 2025-12-09 17:22:12 +01:00
parent 84a72a128b
commit 4fc3ff33cb
3 changed files with 138 additions and 57 deletions

View file

@ -3,30 +3,48 @@
"task": "cnn-rnn-ocr",
"n_classes" : 2,
"max_len": 280,
"n_epochs" : 0,
"n_epochs" : 3,
"input_height" : 32,
"input_width" : 512,
"weight_decay" : 1e-6,
"n_batch" : 1,
"learning_rate": 1e-4,
"n_batch" : 4,
"learning_rate": 1e-5,
"save_interval": 1500,
"patches" : false,
"pretraining" : true,
"augmentation" : false,
"augmentation" : true,
"flip_aug" : false,
"blur_aug" : false,
"blur_aug" : true,
"scaling" : false,
"adding_rgb_background": true,
"adding_rgb_foreground": true,
"add_red_textlines": false,
"channels_shuffling": false,
"degrading": false,
"brightening": false,
"add_red_textlines": true,
"white_noise_strap": true,
"textline_right_in_depth": true,
"textline_left_in_depth": true,
"textline_up_in_depth": true,
"textline_down_in_depth": true,
"textline_right_in_depth_bin": true,
"textline_left_in_depth_bin": true,
"textline_up_in_depth_bin": true,
"textline_down_in_depth_bin": true,
"bin_deg": true,
"textline_skewing": true,
"textline_skewing_bin": true,
"channels_shuffling": true,
"degrading": true,
"brightening": true,
"binarization" : true,
"pepper_aug": true,
"pepper_bin_aug": true,
"image_inversion": true,
"scaling_bluring" : false,
"scaling_binarization" : false,
"scaling_flip" : false,
"rotation": false,
"rotation_not_90": false,
"color_padding_rotation": true,
"padding_white": true,
"rotation_not_90": true,
"transformer_num_patches_xy": [56, 56],
"transformer_patchsize_x": 4,
"transformer_patchsize_y": 4,
@ -36,12 +54,17 @@
"transformer_num_heads": 1,
"transformer_cnn_first": false,
"blur_k" : ["blur","gauss","median"],
"padd_colors" : ["white", "black"],
"scales" : [0.6, 0.7, 0.8, 0.9],
"brightness" : [1.3, 1.5, 1.7, 2],
"degrade_scales" : [0.2, 0.4],
"pepper_indexes": [0.01, 0.005],
"skewing_amplitudes" : [5, 8],
"flip_index" : [0, 1, -1],
"shuffle_indexes" : [ [0,2,1], [1,2,0], [1,0,2] , [2,1,0]],
"thetha" : [5, -5],
"thetha" : [0.1, 0.2, -0.1, -0.2],
"thetha_padd": [-0.6, -1, -1.4, -1.8, 0.6, 1, 1.4, 1.8],
"white_padds" : [0.1, 0.3, 0.5, 0.7, 0.9],
"number_of_backgrounds_per_image": 2,
"continue_training": false,
"index_start" : 0,
@ -54,7 +77,7 @@
"dir_output": "/home/vahid/extracted_lines/1919_bin/output",
"dir_rgb_backgrounds": "/home/vahid/Documents/1_2_test_eynollah/set_rgb_background",
"dir_rgb_foregrounds": "/home/vahid/Documents/1_2_test_eynollah/out_set_rgb_foreground",
"dir_img_bin": "/home/vahid/Documents/test/sbb_pixelwise_segmentation/test_label/pageextractor_test/train_new/images_bin",
"dir_img_bin": "/home/vahid/extracted_lines/1919_bin/images_bin",
"characters_txt_file":"/home/vahid/Downloads/models_eynollah/model_eynollah_ocr_cnnrnn_20250930/characters_org.txt"
}