Stanislav Kalinin commited on
Commit
54c5290
1 Parent(s): 86d40aa

feat: Add weights and configs for Peter models

Browse files
0_0.jpg ADDED

Git LFS Details

  • SHA256: 1f06fa0bf3eb792c1f1aafd7d6aa007a0933fe4eb92be6800e07416091d4b3b5
  • Pointer size: 132 Bytes
  • Size of remote file: 1.9 MB
inference_pipeline.ipynb ADDED
The diff for this file is too large to render. See raw diff
 
ocr/model-95-0.0293.ckpt ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:4a8cc37c8483b7d33dc5fecbcd0afabfeb48192c64db56dc11d16225efc93d40
3
+ size 50222851
ocr/ocr_config.json ADDED
@@ -0,0 +1,60 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "alphabet": " #()+/0123456789[]abdefghiklmnoprstuw|×ǂабвгдежзийклмнопрстуфхцчшщъыьэюяѣ–⊕⊗",
3
+ "save_dir": "/home/jovyan/skalinin/OCR-model/data/experiments_peter/peter_mask_and_stmix_synth_bbox-4",
4
+ "num_epochs": 100,
5
+ "pretrain_path": "",
6
+ "image": {
7
+ "width": 1024,
8
+ "height": 128
9
+ },
10
+ "train": {
11
+ "datasets": [
12
+ {
13
+ "csv_path": "/home/jovyan/data/ocr/peter_mask/train.csv",
14
+ "prob": 15
15
+ },
16
+ {
17
+ "csv_path": "/home/jovyan/skalinin/StackMIX-PETER-SYNTH/StackMix-OCR/generated_synth/stmix-peter-synth-part-3.csv",
18
+ "prob": 5
19
+ },
20
+ {
21
+ "csv_path": "/home/jovyan/skalinin/StackMIX-PETER-SYNTH/StackMix-OCR/generated_synth/stmix-peter-synth-part-4-fix.csv",
22
+ "prob": 10
23
+ },
24
+ {
25
+ "csv_path": "/home/jovyan/skalinin/StackMIX-PETER-SYNTH/StackMix-OCR/generated_synth/stmix-peter-synth-part-5-fix.csv",
26
+ "prob": 10
27
+ },
28
+ {
29
+ "csv_path": "/home/jovyan/skalinin/StackMIX-PETER-SYNTH/StackMix-OCR/generated_synth/stmix-peter-synth-mask-part1.csv",
30
+ "prob": 30
31
+ },
32
+ {
33
+ "csv_path": "/home/jovyan/skalinin/StackMIX-PETER-SYNTH/StackMix-OCR/peter_mask_crops/peter_mask/stackmix_crops_ocr_format.csv",
34
+ "prob": 20
35
+ }
36
+ ],
37
+ "epoch_size": 40000,
38
+ "batch_size": 64
39
+ },
40
+ "val": {
41
+ "datasets": [
42
+ {
43
+ "csv_path": "/home/jovyan/data/ocr/peter_mask/val.csv",
44
+ "prob": 1
45
+ }
46
+ ],
47
+ "epoch_size": null,
48
+ "batch_size": 64
49
+ },
50
+ "test": {
51
+ "datasets": [
52
+ {
53
+ "csv_path": "/home/jovyan/data/ocr/peter_mask/test.csv",
54
+ "prob": 1
55
+ }
56
+ ],
57
+ "epoch_size": null,
58
+ "batch_size": 64
59
+ }
60
+ }
pipeline_config.json ADDED
@@ -0,0 +1,39 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ { "main_process": {
2
+ "ImageToBGR": {
3
+ "input_format": "BGR"
4
+ },
5
+ "SegmPrediction": {
6
+ "model_path": "segm/model-100-0.1701.ckpt",
7
+ "config_path": "segm/segm_config.json",
8
+ "device": "cuda"
9
+ },
10
+ "RestoreImageAngle": {
11
+ "restoring_class_names": ["shrinked_text"]
12
+ },
13
+ "ClassContourPosptrocess": {},
14
+ "OCRPrediction": {
15
+ "model_path": "ocr/model-95-0.0293.ckpt",
16
+ "config_path": "ocr/ocr_config.json",
17
+ "lm_path": "",
18
+ "classes_to_ocr": ["shrinked_text"],
19
+ "device": "cuda"
20
+ },
21
+ "LineFinder": {
22
+ "line_classes": ["shrinked_text"],
23
+ "text_classes": ["shrinked_text"],
24
+ "pages_clust_dist": 0.35
25
+ },
26
+ "PrepareJSON": {}
27
+ },
28
+ "classes": {
29
+ "shrinked_text": {
30
+ "contour_posptrocess": {
31
+ "UpscaleContour": {"upscale_contour": 1.45},
32
+ "BboxFromContour": {},
33
+ "CropByBbox": {},
34
+ "MakeMaskedCrop": {},
35
+ "RotateVerticalCrops": {}
36
+ }
37
+ }
38
+ }
39
+ }
segm/model-100-0.1701.ckpt ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:137ea5f4eb979c2ddece70b5777da840afa139c2fc36a81b83c019431c62c896
3
+ size 115723399
segm/segm_config.json ADDED
@@ -0,0 +1,67 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "save_dir": "/home/jovyan/skalinin/SEGM-model/data/exp_peter/segm_baseline_pretrain_2",
3
+ "num_epochs": 1500,
4
+ "pretrain_path": "/home/jovyan/skalinin/SEGM-model/data/exp/resnet50_896_896_border_all_text_thin_border/model-1404-0.1957.ckpt",
5
+ "image": {
6
+ "width": 896,
7
+ "height": 896
8
+ },
9
+ "classes": {
10
+ "shrinked_text": {
11
+ "annotation_classes": ["text"],
12
+ "polygon2mask": {
13
+ "ShrinkMaskMaker": {"shrink_ratio": 0.75}
14
+ },
15
+ "postprocess": {
16
+ "threshold": 0.7,
17
+ "min_area": 100
18
+ }
19
+ },
20
+ "bordered_text": {
21
+ "annotation_classes": ["text"],
22
+ "polygon2mask": {
23
+ "BorderMaskMaker": {"shrink_ratio": 0.5}
24
+ },
25
+ "postprocess": {
26
+ "threshold": 0.7,
27
+ "min_area": 100
28
+ }
29
+ }
30
+ },
31
+ "train": {
32
+ "datasets": [
33
+ {
34
+ "json_path": "/home/jovyan/data/segm/peter/annotations_train.json",
35
+ "image_root": "/home/jovyan/data/segm/peter/images/",
36
+ "processed_data_path": "/home/jovyan/skalinin/SEGM-model/data/peter/annotations_train.csv",
37
+ "prob": 0.1
38
+ }
39
+ ],
40
+ "epoch_size": 2000,
41
+ "batch_size": 10
42
+ },
43
+ "val": {
44
+ "datasets": [
45
+ {
46
+ "json_path": "/home/jovyan/data/segm/peter/annotations_val.json",
47
+ "image_root": "/home/jovyan/data/segm/peter/images/",
48
+ "processed_data_path": "/home/jovyan/skalinin/SEGM-model/data/peter/annotations_val.csv",
49
+ "prob": 1
50
+ }
51
+ ],
52
+ "epoch_size": null,
53
+ "batch_size": 10
54
+ },
55
+ "test": {
56
+ "datasets": [
57
+ {
58
+ "json_path": "/home/jovyan/data/segm/peter/annotations_test.json",
59
+ "image_root": "/home/jovyan/data/segm/peter/images/",
60
+ "processed_data_path": "/home/jovyan/skalinin/SEGM-model/data/peter/annotations_test.csv",
61
+ "prob": 1
62
+ }
63
+ ],
64
+ "epoch_size": null,
65
+ "batch_size": 10
66
+ }
67
+ }