tree_en.md 14 KB
Newer Older
WenmuZhou's avatar
WenmuZhou committed
1
2
3
4
# Overall directory structure

The overall directory structure of PaddleOCR is introduced as follows:

WenmuZhou's avatar
WenmuZhou committed
5

WenmuZhou's avatar
WenmuZhou committed
6
7
```
PaddleOCR
WenmuZhou's avatar
WenmuZhou committed
8
9
10
11
12
├── configs                                 // Configuration file, you can config the model structure and modify the hyperparameters through the yml file
│   ├── cls                                 // Angle classifier config files
│   │   ├── cls_mv3.yml                     // Training config, including backbone network, head, loss, optimizer and data
│   ├── det                                 // Text detection config files
│   │   ├── det_mv3_db.yml                  // Training config
WenmuZhou's avatar
WenmuZhou committed
13
│   │   ...  
WenmuZhou's avatar
WenmuZhou committed
14
15
│   └── rec                                 // Text recognition config files
│       ├── rec_mv3_none_bilstm_ctc.yml     // CRNN config
WenmuZhou's avatar
WenmuZhou committed
16
│       ...  
WenmuZhou's avatar
WenmuZhou committed
17
18
├── deploy                                  // Depoly
│   ├── android_demo                        // Android demo
WenmuZhou's avatar
WenmuZhou committed
19
│   │   ...
WenmuZhou's avatar
WenmuZhou committed
20
21
22
│   ├── cpp_infer                           // C++ infer
│   │   ├── CMakeLists.txt                  // Cmake file
│   │   ├── docs                            // Docs
WenmuZhou's avatar
WenmuZhou committed
23
│   │   │   └── windows_vs2019_build.md
WenmuZhou's avatar
WenmuZhou committed
24
25
26
27
28
29
30
31
32
33
│   │   ├── include                         // Head Files
│   │   │   ├── clipper.h                   // clipper
│   │   │   ├── config.h                    // Inference config
│   │   │   ├── ocr_cls.h                   // Angle class
│   │   │   ├── ocr_det.h                   // Text detection
│   │   │   ├── ocr_rec.h                   // Text recognition
│   │   │   ├── postprocess_op.h            // Post-processing
│   │   │   ├── preprocess_op.h             // Pre-processing
│   │   │   └── utility.h                   // tools
│   │   ├── readme.md                       // Documentation
WenmuZhou's avatar
WenmuZhou committed
34
│   │   ├── ...
WenmuZhou's avatar
WenmuZhou committed
35
│   │   ├── src                             // Source code files
WenmuZhou's avatar
WenmuZhou committed
36
37
38
39
40
41
42
43
44
│   │   │   ├── clipper.cpp  
│   │   │   ├── config.cpp
│   │   │   ├── main.cpp
│   │   │   ├── ocr_cls.cpp
│   │   │   ├── ocr_det.cpp
│   │   │   ├── ocr_rec.cpp
│   │   │   ├── postprocess_op.cpp
│   │   │   ├── preprocess_op.cpp
│   │   │   └── utility.cpp
WenmuZhou's avatar
WenmuZhou committed
45
46
47
48
│   │   └── tools                           // Compile and execute script
│   │       ├── build.sh                    // Compile script
│   │       ├── config.txt                  // Config file
│   │       └── run.sh                      // Execute script
WenmuZhou's avatar
WenmuZhou committed
49
50
51
52
53
54
55
56
57
│   ├── docker
│   │   └── hubserving
│   │       ├── cpu
│   │       │   └── Dockerfile
│   │       ├── gpu
│   │       │   └── Dockerfile
│   │       ├── README_cn.md
│   │       ├── README.md
│   │       └── sample_request.txt
WenmuZhou's avatar
WenmuZhou committed
58
59
60
61
62
63
64
65
│   ├── hubserving                          // hubserving
│   │   ├── ocr_cls                         // Angle class
│   │   │   ├── config.json                 // Serving config
│   │   │   ├── __init__.py  
│   │   │   ├── module.py                   // Model
│   │   │   └── params.py                   // Parameters
│   │   ├── ocr_det                         // Text detection
│   │   │   ├── config.json                 // serving config
WenmuZhou's avatar
WenmuZhou committed
66
│   │   │   ├── __init__.py  
WenmuZhou's avatar
WenmuZhou committed
67
68
69
│   │   │   ├── module.py                   // Model
│   │   │   └── params.py                   // Parameters
│   │   ├── ocr_rec                         // Text recognition
WenmuZhou's avatar
WenmuZhou committed
70
71
72
73
│   │   │   ├── config.json
│   │   │   ├── __init__.py
│   │   │   ├── module.py
│   │   │   └── params.py
WenmuZhou's avatar
WenmuZhou committed
74
│   │   └── ocr_system                      // Inference System
WenmuZhou's avatar
WenmuZhou committed
75
76
77
78
│   │       ├── config.json
│   │       ├── __init__.py
│   │       ├── module.py
│   │       └── params.py
WenmuZhou's avatar
WenmuZhou committed
79
│   ├── imgs                                // Inference images
WenmuZhou's avatar
WenmuZhou committed
80
81
│   │   ├── cpp_infer_pred_12.png
│   │   └── demo.png
WenmuZhou's avatar
WenmuZhou committed
82
│   ├── ios_demo                            // IOS demo
WenmuZhou's avatar
WenmuZhou committed
83
│   │   ...
WenmuZhou's avatar
WenmuZhou committed
84
85
│   ├── lite                                // Lite depoly
│   │   ├── cls_process.cc                  // Pre-process for angle class
WenmuZhou's avatar
WenmuZhou committed
86
│   │   ├── cls_process.h
WenmuZhou's avatar
WenmuZhou committed
87
88
│   │   ├── config.txt                      // Config file
│   │   ├── crnn_process.cc                 // Pre-process for CRNN
WenmuZhou's avatar
WenmuZhou committed
89
│   │   ├── crnn_process.h
WenmuZhou's avatar
WenmuZhou committed
90
│   │   ├── db_post_process.cc              // Pre-process for DB
WenmuZhou's avatar
WenmuZhou committed
91
│   │   ├── db_post_process.h
WenmuZhou's avatar
WenmuZhou committed
92
93
94
95
│   │   ├── Makefile                        // Compile file
│   │   ├── ocr_db_crnn.cc                  // Inference system
│   │   ├── prepare.sh                      // Prepare bash script
│   │   ├── readme.md                       // Documentation
WenmuZhou's avatar
WenmuZhou committed
96
│   │   ...
WenmuZhou's avatar
WenmuZhou committed
97
98
99
100
101
102
103
104
105
│   ├── pdserving                           // Pdserving depoly
│   │   ├── det_local_server.py             // Text detection fast version, easy to deploy and fast to predict
│   │   ├── det_web_server.py               // Text detection full version, high stability distributed deployment
│   │   ├── ocr_local_server.py             // Text detection + recognition fast version
│   │   ├── ocr_web_client.py               // client
│   │   ├── ocr_web_server.py               // Text detection + recognition full version
│   │   ├── readme.md                       // Documentation
│   │   ├── rec_local_server.py             // Text recognition fast version
│   │   └── rec_web_server.py               // Text recognition full version
WenmuZhou's avatar
WenmuZhou committed
106
│   └── slim  
WenmuZhou's avatar
WenmuZhou committed
107
108
109
110
111
│       └── quantization                    // Quantization
│           ├── export_model.py             // Export model
│           ├── quant.py                    // Quantization script
│           └── README.md                   // Documentation
├── doc                                     // Documentation and Tutorials
WenmuZhou's avatar
WenmuZhou committed
112
│   ...
WenmuZhou's avatar
WenmuZhou committed
113
114
115
116
117
118
119
120
├── ppocr                                   // Core code
│   ├── data                                // Data processing
│   │   ├── imaug                           // Image and label processing code
│   │   │   ├── text_image_aug              // Tia data augment for text recognition
│   │   │   │   ├── __init__.py
│   │   │   │   ├── augment.py              // Tia_distort,tia_stretch and tia_perspective
│   │   │   │   ├── warp_mls.py 
│   │   │   ├── __init__.py
WenmuZhou's avatar
WenmuZhou committed
121
│   │   │   ├── east_process.py             // Data processing steps of EAST algorithm
WenmuZhou's avatar
WenmuZhou committed
122
123
124
125
126
127
128
│   │   │   ├── iaa_augment.py              // Data augmentation operations
│   │   │   ├── label_ops.py                // label encode operations
│   │   │   ├── make_border_map.py          // Generate boundary map
│   │   │   ├── make_shrink_map.py          // Generate shrink graph
│   │   │   ├── operators.py                // Basic image operations, such as reading and normalization
│   │   │   ├── randaugment.py              // Random data augmentation operation
│   │   │   ├── random_crop_data.py         // Random crop
WenmuZhou's avatar
WenmuZhou committed
129
130
│   │   │   ├── rec_img_aug.py              // Data augmentation for text recognition
│   │   │   └── sast_process.py             // Data processing steps of SAST algorithm
WenmuZhou's avatar
WenmuZhou committed
131
132
133
134
135
136
137
138
│   │   ├── __init__.py                     // Construct dataloader code
│   │   ├── lmdb_dataset.py                 // Read lmdb dataset
│   │   ├── simple_dataset.py               // Read the dataset stored in text format
│   ├── losses                              // Loss function
│   │   ├── __init__.py                     // Construct loss code
│   │   ├── cls_loss.py                     // Angle class loss
│   │   ├── det_basic_loss.py               // Text detection basic loss
│   │   ├── det_db_loss.py                  // DB loss
WenmuZhou's avatar
WenmuZhou committed
139
140
│   │   ├── det_east_loss.py                // EAST loss
│   │   ├── det_sast_loss.py                // SAST loss
WenmuZhou's avatar
WenmuZhou committed
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
│   │   ├── rec_ctc_loss.py                 // ctc loss
│   ├── metrics                             // Metrics
│   │   ├── __init__.py                     // Construct metric code
│   │   ├── cls_metric.py                   // Angle class metric
│   │   ├── det_metric.py                   // Text detection metric
    │   ├── eval_det_iou.py                 // Text detection iou code
│   │   ├── rec_metric.py                   // Text recognition metric
│   ├── modeling                            // Network
│   │   ├── architectures                   // Architecture
│   │   │   ├── __init__.py                 // Construct model code
│   │   │   ├── base_model.py               // Base model
│   │   ├── backbones                       // backbones
│   │   │   ├── __init__.py                 // Construct backbone code
│   │   │   ├── det_mobilenet_v3.py         // Text detection mobilenet_v3
│   │   │   ├── det_resnet_vd.py            // Text detection resnet
WenmuZhou's avatar
WenmuZhou committed
156
│   │   │   ├── det_resnet_vd_sast.py       // Text detection resnet backbone of the SAST algorithm
WenmuZhou's avatar
WenmuZhou committed
157
158
159
160
│   │   │   ├── rec_mobilenet_v3.py         // Text recognition mobilenet_v3
│   │   │   └── rec_resnet_vd.py            // Text recognition resnet
│   │   ├── necks                           // Necks
│   │   │   ├── __init__.py                 // Construct neck code
WenmuZhou's avatar
WenmuZhou committed
161
162
163
│   │   │   ├── db_fpn.py                   // Standard fpn
│   │   │   ├── east_fpn.py                 // EAST algorithm fpn network
│   │   │   ├── sast_fpn.py                 // SAST algorithm fpn network
WenmuZhou's avatar
WenmuZhou committed
164
165
166
167
168
│   │   │   ├── rnn.py                      // Character recognition sequence encoding
│   │   ├── heads                           // Heads
│   │   │   ├── __init__.py                 // Construct head code
│   │   │   ├── cls_head.py                 // Angle class head
│   │   │   ├── det_db_head.py              // DB head
WenmuZhou's avatar
WenmuZhou committed
169
170
│   │   │   ├── det_east_head.py            // EAST head
│   │   │   ├── det_sast_head.py            // SAST head
WenmuZhou's avatar
WenmuZhou committed
171
172
173
174
175
176
177
178
179
180
181
182
│   │   │   ├── rec_ctc_head.py             // Ctc head
│   │   ├── transforms                      // Transforms
│   │   │   ├── __init__.py                 // Construct transform code
│   │   │   └── tps.py                      // TPS transform
│   ├── optimizer                           // Optimizer
│   │   ├── __init__.py                     // Construct optimizer code
│   │   └── learning_rate.py                // Learning rate decay
│   │   └── optimizer.py                    // Optimizer
│   │   └── regularizer.py                  // Network regularization
│   ├── postprocess                         // Post-processing
│   │   ├── cls_postprocess.py              // Angle class post-processing
│   │   ├── db_postprocess.py               // DB post-processing
WenmuZhou's avatar
WenmuZhou committed
183
184
185
186
│   │   ├── east_postprocess.py             // EAST post-processing
│   │   ├── locality_aware_nms.py           // NMS
│   │   ├── rec_postprocess.py              // Text recognition post-processing
│   │   └── sast_postprocess.py             // SAST post-processing
WenmuZhou's avatar
WenmuZhou committed
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
│   └── utils                               // utils
│       ├── dict                            // Minor language dictionary
│            ....                            
│       ├── ic15_dict.txt                   // English number dictionary, case sensitive
│       ├── ppocr_keys_v1.txt               // Chinese dictionary for training Chinese models
│       ├── logging.py                      // logger
│       ├── save_load.py                    // Model saving and loading functions
│       ├── stats.py                        // Training status statistics
│       └── utility.py                      // Utility function
├── tools
│   ├── eval.py                             // Evaluation function
│   ├── export_model.py                     // Export inference model
│   ├── infer                               // Inference based on Inference engine
│   │   ├── predict_cls.py
│   │   ├── predict_det.py
│   │   ├── predict_rec.py
│   │   ├── predict_system.py
│   │   └── utility.py
│   ├── infer_cls.py                        // Angle classification inference based on training engine
│   ├── infer_det.py                        // Text detection inference based on training engine
│   ├── infer_rec.py                        // Text recognition inference based on training engine
│   ├── program.py                          // Inference system
│   ├── test_hubserving.py
│   └── train.py                            // Start training script
├── paddleocr.py 
├── README_ch.md                            // Chinese documentation
├── README_en.md                            // English documentation
├── README.md                               // Home page documentation
├── requirments.txt                         // Requirments
├── setup.py                                // Whl package packaging script
├── train.sh                                // Start training bash script