mirror of
https://github.com/qurator-spk/eynollah.git
synced 2026-06-16 09:59:13 +02:00
integrating transformer ocr
This commit is contained in:
parent
e9839a8b54
commit
7f86a55ccb
3 changed files with 170 additions and 1 deletions
82
train/config_params_trocr.json
Normal file
82
train/config_params_trocr.json
Normal file
|
|
@ -0,0 +1,82 @@
|
|||
{
|
||||
"backbone_type" : "transformer",
|
||||
"task": "transformer-ocr",
|
||||
"n_classes" : 2,
|
||||
"max_len": 192,
|
||||
"n_epochs" : 1,
|
||||
"input_height" : 32,
|
||||
"input_width" : 512,
|
||||
"weight_decay" : 1e-6,
|
||||
"n_batch" : 1,
|
||||
"learning_rate": 1e-5,
|
||||
"save_interval": 1500,
|
||||
"patches" : false,
|
||||
"pretraining" : false,
|
||||
"augmentation" : true,
|
||||
"flip_aug" : false,
|
||||
"blur_aug" : true,
|
||||
"scaling" : false,
|
||||
"adding_rgb_background": true,
|
||||
"adding_rgb_foreground": true,
|
||||
"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,
|
||||
"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,
|
||||
"transformer_projection_dim": 64,
|
||||
"transformer_mlp_head_units": [128, 64],
|
||||
"transformer_layers": 1,
|
||||
"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" : [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,
|
||||
"dir_of_start_model" : " ",
|
||||
"weighted_loss": false,
|
||||
"is_loss_soft_dice": false,
|
||||
"data_is_provided": false,
|
||||
"dir_train": "/home/vahid/extracted_lines/1919_bin/train",
|
||||
"dir_eval": "/home/vahid/Documents/test/sbb_pixelwise_segmentation/test_label/pageextractor_test/eval_new",
|
||||
"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/extracted_lines/1919_bin/images_bin"
|
||||
|
||||
}
|
||||
|
|
@ -8,3 +8,6 @@ tensorflow-addons # for connected_components, depublished and only compatible wi
|
|||
tensorflow < 2.16 # for tensorflow-addons, so only needed in training
|
||||
tf_data < 2.16 # for tensorflow-addons, so only needed in training
|
||||
protobuf < 5 # for tensorflow-addons, so only needed in training
|
||||
torch
|
||||
transformers <= 4.30.2 ; python_version < '3.10'
|
||||
transformers >= 5 ; python_version >= '3.10'
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue