Phitran21 commited on
Commit
cb633ee
·
verified ·
1 Parent(s): 9c9960f

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +381 -278
README.md CHANGED
@@ -16,20 +16,44 @@ tags:
16
  - english
17
  - computer-vision
18
  - document-ai
19
- pretty_name: Synthetic English OCR Detection and Recognition 120K
20
  size_categories:
21
  - 100K<n<1M
22
  annotations_creators:
23
  - machine-generated
24
  language_creators:
25
- - found
26
  multilinguality:
27
  - monolingual
28
  ---
29
 
30
- # Synthetic English OCR Detection and Recognition 120K
31
-
32
- A large synthetic English OCR dataset containing **120,792 full images**, **120,792 cropped text images**, polygon-based text annotations, and transcription labels.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
33
 
34
  This dataset is designed for training and evaluating:
35
 
@@ -41,30 +65,60 @@ This dataset is designed for training and evaluating:
41
  - Polygon-based text localization
42
  - Lightweight mobile and ONNX OCR models
43
 
44
- The dataset includes two complete and independent subsets:
45
 
46
  1. **Detector dataset** for locating text regions in full images.
47
  2. **Recognizer dataset** for converting cropped text images into English text.
48
 
 
 
 
 
49
  ## Dataset Summary
50
 
51
  | Property | Value |
52
  |---|---:|
53
  | Language | English |
54
- | Full detector images | 120,792 |
55
- | Recognition crops | 120,792 |
56
- | Detector annotations | 120,792 |
57
- | Recognition annotations | 120,792 |
 
 
58
  | Annotation format | JSON Lines |
59
  | Detection geometry | Multi-point polygons |
60
  | Image format | JPEG |
61
  | Data type | Synthetic OCR |
 
62
  | License | CC BY-NC 4.0 |
63
  | Creator | Trần Phi |
64
 
65
- The images contain English text rendered using different fonts, positions, sizes, rotations, backgrounds, and visual styles.
 
 
 
 
 
 
66
 
67
- The goal is to provide a practical OCR training resource for researchers and developers building text detection and recognition systems.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
68
 
69
  ## Repository Structure
70
 
@@ -77,7 +131,12 @@ synthetic-ocr-en-det-rec-120k/
77
  │ ├── part_002.zip
78
  │ ├── part_003.zip
79
  │ ├── part_004.zip
80
- ── part_005.zip
 
 
 
 
 
81
 
82
  └── recognizer/
83
  ├── recognizer.jsonl
@@ -86,41 +145,49 @@ synthetic-ocr-en-det-rec-120k/
86
  ├── part_002.zip
87
  ├── part_003.zip
88
  ├── part_004.zip
89
- ── part_005.zip
90
-
91
- The ZIP archives are divided into several approximately equal parts to make downloading, storage, verification, and extraction easier.
92
-
93
- File Descriptions
94
-
95
- detector/detector.jsonl
96
-
97
- This file contains annotations for training a text detection model.
98
-
99
- Each JSON line represents one full image and includes:
100
 
101
- Image path
 
102
 
103
- Image width and height
104
 
105
- Text polygon coordinates
 
 
 
 
 
 
106
 
107
- Ground-truth transcription
108
 
109
- Language
110
 
111
- Text direction
112
-
113
- Confidence
114
-
115
- Background information
116
-
117
- Font information
118
 
119
- Synthetic-data indicator
120
 
 
 
 
 
 
 
 
 
 
 
121
 
122
  Example:
123
 
 
124
  {
125
  "image": "images/en_00000001.jpg",
126
  "width": 960,
@@ -140,44 +207,44 @@ Example:
140
  ],
141
  "synthetic": true
142
  }
 
143
 
144
- The complete polygon contains multiple coordinate points that describe the text boundary more precisely than a simple rectangular bounding box.
 
145
 
146
  Use this file together with:
147
 
 
148
  detector/images/part_*.zip
 
149
 
150
- After extraction, the image paths should have the following structure:
151
 
 
152
  images/en_00000001.jpg
153
  images/en_00000002.jpg
154
  ...
 
 
155
 
156
- recognizer/recognizer.jsonl
157
 
158
  This file contains annotations for training a text recognition model.
159
 
160
  Each JSON line represents one cropped text image and includes:
161
 
162
- Crop image path
163
-
164
- Ground-truth text
165
-
166
- Language
167
-
168
- Text direction
169
-
170
- Original source image
171
-
172
- Original source polygon
173
-
174
- Crop box
175
-
176
- Rotation angle
177
-
178
 
179
  Example:
180
 
 
181
  {
182
  "image": "crops/en_00000001.jpg",
183
  "text": "Example English text.",
@@ -192,169 +259,215 @@ Example:
192
  "crop_box": [39, 92, 767, 314],
193
  "rotation": -3.257
194
  }
 
195
 
196
  Use this file together with:
197
 
 
198
  recognizer/crops/part_*.zip
 
199
 
200
- After extraction, the crop paths should have the following structure:
201
 
 
202
  crops/en_00000001.jpg
203
  crops/en_00000002.jpg
204
  ...
 
 
205
 
206
- Detection Dataset Format
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
207
 
208
  The detector subset follows this relationship:
209
 
 
210
  Full image
211
 
212
  Polygon annotation
213
 
214
  Text region localization
 
215
 
216
  Training input:
217
 
 
218
  images/en_XXXXXXXX.jpg
 
219
 
220
  Training target:
221
 
 
222
  items[].polygon
 
223
 
224
  Optional transcription information is available in:
225
 
 
226
  items[].text
 
227
 
228
- This makes the detector annotations suitable for:
229
 
230
- DBNet
 
 
 
 
 
 
231
 
232
- Differentiable Binarization OCR
 
233
 
234
- CRAFT-style detectors
235
-
236
- EAST-style detectors
237
-
238
- Segmentation-based OCR detection
239
-
240
- Polygon regression models
241
-
242
- Custom object detection pipelines
243
-
244
-
245
- Some frameworks require four-point quadrilaterals or rectangular boxes. In that case, the polygon coordinates can be converted during preprocessing.
246
-
247
- Recognition Dataset Format
248
 
249
  The recognizer subset follows this relationship:
250
 
 
251
  Cropped text image
252
 
253
  OCR recognition model
254
 
255
  English transcription
 
256
 
257
  Training input:
258
 
 
259
  crops/en_XXXXXXXX.jpg
 
260
 
261
  Training target:
262
 
 
263
  text
 
264
 
265
  This subset can be used with:
266
 
267
- CRNN
268
-
269
- CTC-based OCR
270
-
271
- Transformer OCR
272
-
273
- Attention-based recognition
274
-
275
- SVTR
276
-
277
- PARSeq-style systems
278
-
279
- PaddleOCR recognition models
280
-
281
- ONNX Runtime OCR pipelines
282
-
283
- Mobile OCR applications
284
 
 
285
 
286
- Downloading the Dataset
287
-
288
- Using Git:
289
 
 
290
  git lfs install
291
 
292
  git clone \
293
  https://huggingface.co/datasets/Phitran21/synthetic-ocr-en-det-rec-120k
 
294
 
295
- Using the Hugging Face CLI:
296
 
 
297
  pip install -U huggingface_hub
298
 
299
  hf download \
300
  Phitran21/synthetic-ocr-en-det-rec-120k \
301
  --repo-type dataset \
302
- --local-dir synthetic-ocr-en-det-rec-120k
 
 
 
 
303
 
304
- Extracting the Detector Images
305
 
306
  Linux or Ubuntu:
307
 
 
308
  mkdir -p extracted_detector
309
 
310
  for file in detector/images/part_*.zip; do
311
  unzip "$file" -d extracted_detector
312
  done
 
313
 
314
  Result:
315
 
 
316
  extracted_detector/
317
  └── images/
318
  ├── en_00000001.jpg
319
  ├── en_00000002.jpg
320
- ── ...
 
 
321
 
322
  The corresponding annotation file is:
323
 
 
324
  detector/detector.jsonl
 
325
 
326
- Extracting the Recognition Crops
327
 
 
328
  mkdir -p extracted_recognizer
329
 
330
  for file in recognizer/crops/part_*.zip; do
331
  unzip "$file" -d extracted_recognizer
332
  done
 
333
 
334
  Result:
335
 
 
336
  extracted_recognizer/
337
  └── crops/
338
  ├── en_00000001.jpg
339
  ├── en_00000002.jpg
340
- ── ...
 
 
341
 
342
  The corresponding annotation file is:
343
 
 
344
  recognizer/recognizer.jsonl
 
345
 
346
- Quick JSONL Inspection
347
 
348
  Inspect the first detector samples:
349
 
 
350
  head -n 5 detector/detector.jsonl
 
351
 
352
  Inspect the first recognition samples:
353
 
 
354
  head -n 5 recognizer/recognizer.jsonl
 
355
 
356
  Validate JSONL using Python:
357
 
 
358
  import json
359
  from pathlib import Path
360
 
@@ -384,17 +497,25 @@ print(
384
  "Recognizer records:",
385
  validate_jsonl("recognizer/recognizer.jsonl"),
386
  )
 
 
 
 
 
 
 
 
387
 
388
- Python Loading Example
389
 
390
  Load recognition annotations:
391
 
 
392
  import json
393
  from pathlib import Path
394
 
395
 
396
  annotation_path = Path("recognizer/recognizer.jsonl")
397
-
398
  samples = []
399
 
400
  with annotation_path.open("r", encoding="utf-8") as file:
@@ -403,9 +524,11 @@ with annotation_path.open("r", encoding="utf-8") as file:
403
 
404
  print("Number of samples:", len(samples))
405
  print("First sample:", samples[0])
 
406
 
407
  Load detector annotations:
408
 
 
409
  import json
410
  from pathlib import Path
411
 
@@ -420,31 +543,32 @@ print("Width:", first_sample["width"])
420
  print("Height:", first_sample["height"])
421
  print("Text items:", len(first_sample["items"]))
422
  print("First polygon:", first_sample["items"][0]["polygon"])
 
423
 
424
- Suggested Train, Validation, and Test Split
425
 
426
  The dataset is currently distributed as one complete collection.
427
 
428
  A recommended split is:
429
 
430
- Split Percentage
431
-
432
- Training 90%
433
- Validation 5%
434
- Test 5%
435
-
436
 
437
- Split by filename or record index using a fixed random seed to ensure reproducibility.
 
438
 
439
  Example:
440
 
 
441
  import json
442
  import random
443
  from pathlib import Path
444
 
445
 
446
  random.seed(42)
447
-
448
  source = Path("recognizer/recognizer.jsonl")
449
 
450
  with source.open("r", encoding="utf-8") as file:
@@ -472,247 +596,226 @@ for split_name, split_rows in splits.items():
472
  )
473
 
474
  print(split_name, len(split_rows))
 
475
 
476
- Intended Uses
477
-
478
- This dataset is intended for:
479
-
480
- Academic OCR research
481
-
482
- Non-commercial OCR model training
483
-
484
- OCR benchmarking
485
-
486
- Text detection experiments
487
 
488
- Text recognition experiments
489
 
490
- Synthetic-data research
491
-
492
- Document AI research
493
-
494
- Mobile OCR development
495
-
496
- ONNX and ONNX Runtime experiments
497
-
498
- Educational projects
499
-
500
- Personal non-commercial projects
501
 
 
 
 
 
 
 
 
 
 
 
 
502
 
503
- Out-of-Scope Uses
504
 
505
  The dataset must not be used for:
506
 
507
- Commercial use without written permission
508
-
509
- Illegal surveillance
510
-
511
- Privacy-invasive identification systems
512
-
513
- Misleading or fraudulent applications
514
 
515
- Applications that violate applicable laws
516
 
517
- Claiming the dataset was manually collected or manually annotated
518
-
519
- Redistributing the dataset under incompatible terms
520
-
521
-
522
- Limitations
523
-
524
- This is a synthetic dataset and does not fully represent all real-world OCR conditions.
525
 
526
  Possible limitations include:
527
 
528
- Synthetic fonts and rendering patterns
529
-
530
- Limited background diversity
531
-
532
- Limited handwriting coverage
533
-
534
- Limited severe blur and compression artifacts
535
-
536
- Limited curved or highly distorted text
537
-
538
- Possible unnatural source sentences
539
 
540
- Possible differences from photographs taken by real cameras
 
541
 
542
- Possible imbalance among fonts, rotations, text lengths, and backgrounds
 
543
 
544
- Primarily horizontal English text
545
 
546
- No guarantee of perfect semantic or grammatical quality in every sentence
 
547
 
 
 
 
548
 
549
- Models trained exclusively on this dataset may require fine-tuning on real-world OCR data before production use.
550
 
551
- For stronger generalization, consider combining this dataset with legally compatible real-image datasets.
 
 
 
 
 
 
 
552
 
553
- Data Quality Notes
554
-
555
- The annotations were generated automatically as part of the synthetic rendering process.
556
-
557
- Because the text, polygon, crop, and transcription originate from the same generation pipeline, labels are expected to align closely with their corresponding images.
558
-
559
- However, users should still perform their own validation before training production systems.
560
 
561
  Recommended checks include:
562
 
563
- ZIP integrity
564
-
565
- Missing file detection
566
-
567
- Duplicate file detection
568
-
569
- JSONL parsing
570
-
571
- Image readability
572
-
573
- Polygon coordinate bounds
574
-
575
- Empty transcription detection
576
 
577
- Train and test leakage detection
578
-
579
-
580
- License
581
 
582
  This dataset is licensed under the:
583
 
584
- Creative Commons Attribution-NonCommercial 4.0 International License
585
- CC BY-NC 4.0
586
 
587
  You may:
588
 
589
- Use the dataset for research
590
-
591
- Use the dataset for education
592
-
593
- Use the dataset for personal projects
594
-
595
- Modify and adapt the dataset
596
-
597
- Train non-commercial models
598
-
599
- Redistribute permitted adaptations with attribution
600
-
601
 
602
  You must:
603
 
604
- Credit the original creator
605
-
606
- Link or refer to this dataset repository
607
-
608
- Clearly indicate significant modifications
609
-
610
- Keep attribution information visible
611
-
612
- Comply with the CC BY-NC 4.0 license
613
-
614
 
615
  You may not:
616
 
617
- Use the dataset commercially without prior written permission
618
-
619
- Sell the dataset or access to the dataset
620
-
621
- Include the dataset in a paid commercial product without permission
622
-
623
- Use the dataset to provide a paid OCR service without permission
624
-
625
- Re-license the original dataset under incompatible terms
626
-
627
- Claim ownership of the original dataset
628
 
629
-
630
- Commercial Licensing
631
 
632
  Commercial use is not included under the public CC BY-NC 4.0 license.
633
 
634
- For commercial use, enterprise use, paid products, paid APIs, paid applications, commercial model training, or commercial redistribution, prior written permission is required.
 
 
635
 
636
  Please contact the creator to discuss a separate commercial license.
637
 
638
- Attribution
639
 
640
  Suggested citation:
641
 
642
- Synthetic English OCR Detection and Recognition 120K
 
 
643
  Created by Trần Phi
644
  Hugging Face: Phitran21/synthetic-ocr-en-det-rec-120k
645
  License: CC BY-NC 4.0
 
646
 
647
  Suggested attribution for model cards:
648
 
 
649
  This model was trained using the Synthetic English OCR Detection
650
- and Recognition 120K dataset created by Trần Phi:
651
- Phitran21/synthetic-ocr-en-det-rec-120k.
 
652
 
653
- Creator
 
654
 
655
- Trần Phi
 
 
656
 
657
  Hugging Face:
658
 
659
  https://huggingface.co/Phitran21
660
 
661
- Contact
662
 
663
  For dataset questions, issue reports, collaboration, or commercial licensing:
664
 
665
666
-
667
- Facebook: https://www.facebook.com/share/1PqDzPQJYf/
668
 
669
- Website: https://toren.io.vn
 
670
 
671
-
672
- Email responses may be limited or delayed. For public technical questions, using the Hugging Face Community tab is recommended.
673
-
674
- Reporting Issues
675
 
676
  When reporting a problem, please include:
677
 
678
- Affected file name
679
-
680
- ZIP part name
681
-
682
- JSONL line number
683
-
684
- Description of the issue
685
-
686
- Minimal reproduction steps
687
-
688
- Screenshot or sample when appropriate
689
-
690
-
691
- Please use the Community tab of this repository for public bug reports and technical discussions.
692
-
693
- Version
694
-
695
- Current release:
696
-
697
- v1.0
698
-
699
- This release contains:
700
 
701
- 120,792 detector images
 
702
 
703
- 120,792 recognition crops
704
 
705
- Detector JSONL annotations
706
 
707
- Recognition JSONL annotations
 
 
 
 
 
 
 
 
708
 
709
- Five detector ZIP archives
710
 
711
- Five recognizer ZIP archives
 
 
 
 
712
 
 
 
713
 
714
- Acknowledgements
715
 
716
- Thank you to the open-source OCR, computer vision, Python, font, and machine-learning communities whose tools and research make synthetic dataset creation possible.
 
 
717
 
718
- If this dataset is useful in your research or project, please consider giving the repository a like and citing the dataset.
 
 
16
  - english
17
  - computer-vision
18
  - document-ai
19
+ pretty_name: Synthetic English OCR Detection and Recognition 240K
20
  size_categories:
21
  - 100K<n<1M
22
  annotations_creators:
23
  - machine-generated
24
  language_creators:
25
+ - machine-generated
26
  multilinguality:
27
  - monolingual
28
  ---
29
 
30
+ # Synthetic English OCR Detection and Recognition 240K
31
+
32
+ > ## 📌 Current dataset size: 240,000 paired OCR samples
33
+ >
34
+ > The current **v2.0 release contains exactly 240,000 detector images and
35
+ > 240,000 matching recognition crops**.
36
+ >
37
+ > Each sample ID corresponds to:
38
+ >
39
+ > - one full image for text detection;
40
+ > - one cropped text image for text recognition;
41
+ > - one detector JSONL record;
42
+ > - one recognizer JSONL record.
43
+ >
44
+ > Therefore, the dataset contains **240,000 aligned OCR pairs** and
45
+ > **480,000 JPEG files in total**. The detector image and recognition crop are
46
+ > two representations of the same OCR sample, not 480,000 independent texts.
47
+ >
48
+ > The repository identifier still ends in
49
+ > `synthetic-ocr-en-det-rec-120k` because that was the name of the original
50
+ > release. The old repository name is intentionally retained to preserve
51
+ > existing links, citations, download scripts, and bookmarks. **The repository
52
+ > name is legacy; the current dataset size is 240K.**
53
+
54
+ A large synthetic English OCR dataset containing **240,000 full detector
55
+ images**, **240,000 cropped text images**, polygon-based text annotations, and
56
+ aligned transcription labels.
57
 
58
  This dataset is designed for training and evaluating:
59
 
 
65
  - Polygon-based text localization
66
  - Lightweight mobile and ONNX OCR models
67
 
68
+ The dataset includes two aligned subsets:
69
 
70
  1. **Detector dataset** for locating text regions in full images.
71
  2. **Recognizer dataset** for converting cropped text images into English text.
72
 
73
+ Both subsets use the same numeric sample IDs. For example,
74
+ `images/en_00000001.jpg` and `crops/en_00000001.jpg` belong to the same OCR
75
+ sample and share the same ground-truth transcription.
76
+
77
  ## Dataset Summary
78
 
79
  | Property | Value |
80
  |---|---:|
81
  | Language | English |
82
+ | Paired OCR samples | 240,000 |
83
+ | Full detector images | 240,000 |
84
+ | Recognition crops | 240,000 |
85
+ | Total JPEG files | 480,000 |
86
+ | Detector annotations | 240,000 |
87
+ | Recognition annotations | 240,000 |
88
  | Annotation format | JSON Lines |
89
  | Detection geometry | Multi-point polygons |
90
  | Image format | JPEG |
91
  | Data type | Synthetic OCR |
92
+ | Current release | v2.0 |
93
  | License | CC BY-NC 4.0 |
94
  | Creator | Trần Phi |
95
 
96
+ The images contain English text rendered using different fonts, positions,
97
+ sizes, rotations, backgrounds, colors, and visual styles.
98
+
99
+ The goal is to provide a practical OCR training resource for researchers and
100
+ developers building text detection and recognition systems.
101
+
102
+ ## Repository Name Notice
103
 
104
+ The Hugging Face repository URL remains:
105
+
106
+ ```text
107
+ Phitran21/synthetic-ocr-en-det-rec-120k
108
+ ```
109
+
110
+ The `120k` suffix refers to the original release size. The dataset was expanded
111
+ in place to 240,000 paired samples so that existing users would not lose access
112
+ through old links or citations.
113
+
114
+ Use the following values when describing the current release:
115
+
116
+ ```text
117
+ Current title: Synthetic English OCR Detection and Recognition 240K
118
+ Current version: v2.0
119
+ Current paired samples: 240,000
120
+ Legacy repository slug: synthetic-ocr-en-det-rec-120k
121
+ ```
122
 
123
  ## Repository Structure
124
 
 
131
  │ ├── part_002.zip
132
  │ ├── part_003.zip
133
  │ ├── part_004.zip
134
+ ── part_005.zip
135
+ │ ├── part_006.zip
136
+ │ ├── part_007.zip
137
+ │ ├── part_008.zip
138
+ │ ├── part_009.zip
139
+ │ └── part_010.zip
140
 
141
  └── recognizer/
142
  ├── recognizer.jsonl
 
145
  ├── part_002.zip
146
  ├── part_003.zip
147
  ├── part_004.zip
148
+ ── part_005.zip
149
+ ├── part_006.zip
150
+ ├── part_007.zip
151
+ ├── part_008.zip
152
+ ├── part_009.zip
153
+ └── part_010.zip
154
+ ```
 
 
 
 
155
 
156
+ The ZIP archives are divided into approximately equal parts to make
157
+ downloading, storage, verification, and extraction easier.
158
 
159
+ The v2.0 extension is stored in `part_006.zip` through `part_010.zip`:
160
 
161
+ | ZIP part | Sample ID range | Files per detector/recognizer archive |
162
+ |---|---:|---:|
163
+ | `part_006.zip` | 120791–144632 | 23,842 |
164
+ | `part_007.zip` | 144633–168474 | 23,842 |
165
+ | `part_008.zip` | 168475–192316 | 23,842 |
166
+ | `part_009.zip` | 192317–216158 | 23,842 |
167
+ | `part_010.zip` | 216159–240000 | 23,842 |
168
 
169
+ ## File Descriptions
170
 
171
+ ### `detector/detector.jsonl`
172
 
173
+ This file contains annotations for training a text detection model.
 
 
 
 
 
 
174
 
175
+ Each JSON line represents one full image and includes:
176
 
177
+ - Image path
178
+ - Image width and height
179
+ - Text polygon coordinates
180
+ - Ground-truth transcription
181
+ - Language
182
+ - Text direction
183
+ - Confidence
184
+ - Background information
185
+ - Font information
186
+ - Synthetic-data indicator
187
 
188
  Example:
189
 
190
+ ```json
191
  {
192
  "image": "images/en_00000001.jpg",
193
  "width": 960,
 
207
  ],
208
  "synthetic": true
209
  }
210
+ ```
211
 
212
+ The complete polygon contains multiple coordinate points that describe the
213
+ text boundary more precisely than a simple rectangular bounding box.
214
 
215
  Use this file together with:
216
 
217
+ ```text
218
  detector/images/part_*.zip
219
+ ```
220
 
221
+ After extraction, the image paths have the following structure:
222
 
223
+ ```text
224
  images/en_00000001.jpg
225
  images/en_00000002.jpg
226
  ...
227
+ images/en_00240000.jpg
228
+ ```
229
 
230
+ ### `recognizer/recognizer.jsonl`
231
 
232
  This file contains annotations for training a text recognition model.
233
 
234
  Each JSON line represents one cropped text image and includes:
235
 
236
+ - Crop image path
237
+ - Ground-truth text
238
+ - Language
239
+ - Text direction
240
+ - Original source image
241
+ - Original source polygon
242
+ - Crop box
243
+ - Rotation angle
 
 
 
 
 
 
 
 
244
 
245
  Example:
246
 
247
+ ```json
248
  {
249
  "image": "crops/en_00000001.jpg",
250
  "text": "Example English text.",
 
259
  "crop_box": [39, 92, 767, 314],
260
  "rotation": -3.257
261
  }
262
+ ```
263
 
264
  Use this file together with:
265
 
266
+ ```text
267
  recognizer/crops/part_*.zip
268
+ ```
269
 
270
+ After extraction, the crop paths have the following structure:
271
 
272
+ ```text
273
  crops/en_00000001.jpg
274
  crops/en_00000002.jpg
275
  ...
276
+ crops/en_00240000.jpg
277
+ ```
278
 
279
+ ## Pair Alignment
280
+
281
+ Detector and recognizer records are aligned by their numeric IDs:
282
+
283
+ ```text
284
+ Detector image: images/en_00012345.jpg
285
+ Recognizer crop: crops/en_00012345.jpg
286
+ Detector record: detector JSONL record for ID 00012345
287
+ Recognizer record: recognizer JSONL record for ID 00012345
288
+ Ground-truth text: identical in both records
289
+ ```
290
+
291
+ This alignment allows the two subsets to be trained independently or combined
292
+ in an end-to-end OCR pipeline.
293
+
294
+ ## Detection Dataset Format
295
 
296
  The detector subset follows this relationship:
297
 
298
+ ```text
299
  Full image
300
 
301
  Polygon annotation
302
 
303
  Text region localization
304
+ ```
305
 
306
  Training input:
307
 
308
+ ```text
309
  images/en_XXXXXXXX.jpg
310
+ ```
311
 
312
  Training target:
313
 
314
+ ```text
315
  items[].polygon
316
+ ```
317
 
318
  Optional transcription information is available in:
319
 
320
+ ```text
321
  items[].text
322
+ ```
323
 
324
+ The detector annotations are suitable for:
325
 
326
+ - DBNet
327
+ - Differentiable Binarization OCR
328
+ - CRAFT-style detectors
329
+ - EAST-style detectors
330
+ - Segmentation-based OCR detection
331
+ - Polygon regression models
332
+ - Custom object detection pipelines
333
 
334
+ Some frameworks require four-point quadrilaterals or rectangular boxes. In
335
+ that case, polygon coordinates can be converted during preprocessing.
336
 
337
+ ## Recognition Dataset Format
 
 
 
 
 
 
 
 
 
 
 
 
 
338
 
339
  The recognizer subset follows this relationship:
340
 
341
+ ```text
342
  Cropped text image
343
 
344
  OCR recognition model
345
 
346
  English transcription
347
+ ```
348
 
349
  Training input:
350
 
351
+ ```text
352
  crops/en_XXXXXXXX.jpg
353
+ ```
354
 
355
  Training target:
356
 
357
+ ```text
358
  text
359
+ ```
360
 
361
  This subset can be used with:
362
 
363
+ - CRNN
364
+ - CTC-based OCR
365
+ - Transformer OCR
366
+ - Attention-based recognition
367
+ - SVTR
368
+ - PARSeq-style systems
369
+ - PaddleOCR recognition models
370
+ - ONNX Runtime OCR pipelines
371
+ - Mobile OCR applications
 
 
 
 
 
 
 
 
372
 
373
+ ## Downloading the Dataset
374
 
375
+ ### Using Git
 
 
376
 
377
+ ```bash
378
  git lfs install
379
 
380
  git clone \
381
  https://huggingface.co/datasets/Phitran21/synthetic-ocr-en-det-rec-120k
382
+ ```
383
 
384
+ ### Using the Hugging Face CLI
385
 
386
+ ```bash
387
  pip install -U huggingface_hub
388
 
389
  hf download \
390
  Phitran21/synthetic-ocr-en-det-rec-120k \
391
  --repo-type dataset \
392
+ --local-dir synthetic-ocr-en-det-rec-240k
393
+ ```
394
+
395
+ The local directory may use `240k` even though the stable remote repository
396
+ slug still uses `120k`.
397
 
398
+ ## Extracting the Detector Images
399
 
400
  Linux or Ubuntu:
401
 
402
+ ```bash
403
  mkdir -p extracted_detector
404
 
405
  for file in detector/images/part_*.zip; do
406
  unzip "$file" -d extracted_detector
407
  done
408
+ ```
409
 
410
  Result:
411
 
412
+ ```text
413
  extracted_detector/
414
  └── images/
415
  ├── en_00000001.jpg
416
  ├── en_00000002.jpg
417
+ ── ...
418
+ └── en_00240000.jpg
419
+ ```
420
 
421
  The corresponding annotation file is:
422
 
423
+ ```text
424
  detector/detector.jsonl
425
+ ```
426
 
427
+ ## Extracting the Recognition Crops
428
 
429
+ ```bash
430
  mkdir -p extracted_recognizer
431
 
432
  for file in recognizer/crops/part_*.zip; do
433
  unzip "$file" -d extracted_recognizer
434
  done
435
+ ```
436
 
437
  Result:
438
 
439
+ ```text
440
  extracted_recognizer/
441
  └── crops/
442
  ├── en_00000001.jpg
443
  ├── en_00000002.jpg
444
+ ── ...
445
+ └── en_00240000.jpg
446
+ ```
447
 
448
  The corresponding annotation file is:
449
 
450
+ ```text
451
  recognizer/recognizer.jsonl
452
+ ```
453
 
454
+ ## Quick JSONL Inspection
455
 
456
  Inspect the first detector samples:
457
 
458
+ ```bash
459
  head -n 5 detector/detector.jsonl
460
+ ```
461
 
462
  Inspect the first recognition samples:
463
 
464
+ ```bash
465
  head -n 5 recognizer/recognizer.jsonl
466
+ ```
467
 
468
  Validate JSONL using Python:
469
 
470
+ ```python
471
  import json
472
  from pathlib import Path
473
 
 
497
  "Recognizer records:",
498
  validate_jsonl("recognizer/recognizer.jsonl"),
499
  )
500
+ ```
501
+
502
+ Expected result for v2.0:
503
+
504
+ ```text
505
+ Detector records: 240000
506
+ Recognizer records: 240000
507
+ ```
508
 
509
+ ## Python Loading Example
510
 
511
  Load recognition annotations:
512
 
513
+ ```python
514
  import json
515
  from pathlib import Path
516
 
517
 
518
  annotation_path = Path("recognizer/recognizer.jsonl")
 
519
  samples = []
520
 
521
  with annotation_path.open("r", encoding="utf-8") as file:
 
524
 
525
  print("Number of samples:", len(samples))
526
  print("First sample:", samples[0])
527
+ ```
528
 
529
  Load detector annotations:
530
 
531
+ ```python
532
  import json
533
  from pathlib import Path
534
 
 
543
  print("Height:", first_sample["height"])
544
  print("Text items:", len(first_sample["items"]))
545
  print("First polygon:", first_sample["items"][0]["polygon"])
546
+ ```
547
 
548
+ ## Suggested Train, Validation, and Test Split
549
 
550
  The dataset is currently distributed as one complete collection.
551
 
552
  A recommended split is:
553
 
554
+ | Split | Percentage | Approximate samples |
555
+ |---|---:|---:|
556
+ | Training | 90% | 216,000 |
557
+ | Validation | 5% | 12,000 |
558
+ | Test | 5% | 12,000 |
 
559
 
560
+ Split by filename or record index using a fixed random seed to ensure
561
+ reproducibility.
562
 
563
  Example:
564
 
565
+ ```python
566
  import json
567
  import random
568
  from pathlib import Path
569
 
570
 
571
  random.seed(42)
 
572
  source = Path("recognizer/recognizer.jsonl")
573
 
574
  with source.open("r", encoding="utf-8") as file:
 
596
  )
597
 
598
  print(split_name, len(split_rows))
599
+ ```
600
 
601
+ When creating detector and recognizer splits, use the same sample IDs for both
602
+ subsets so that pair alignment is preserved.
 
 
 
 
 
 
 
 
 
603
 
604
+ ## Intended Uses
605
 
606
+ This dataset is intended for:
 
 
 
 
 
 
 
 
 
 
607
 
608
+ - Academic OCR research
609
+ - Non-commercial OCR model training
610
+ - OCR benchmarking
611
+ - Text detection experiments
612
+ - Text recognition experiments
613
+ - Synthetic-data research
614
+ - Document AI research
615
+ - Mobile OCR development
616
+ - ONNX and ONNX Runtime experiments
617
+ - Educational projects
618
+ - Personal non-commercial projects
619
 
620
+ ## Out-of-Scope Uses
621
 
622
  The dataset must not be used for:
623
 
624
+ - Commercial use without written permission
625
+ - Illegal surveillance
626
+ - Privacy-invasive identification systems
627
+ - Misleading or fraudulent applications
628
+ - Applications that violate applicable laws
629
+ - Claiming the dataset was manually collected or manually annotated
630
+ - Redistributing the dataset under incompatible terms
631
 
632
+ ## Limitations
633
 
634
+ This is a synthetic dataset and does not fully represent all real-world OCR
635
+ conditions.
 
 
 
 
 
 
636
 
637
  Possible limitations include:
638
 
639
+ - Synthetic fonts and rendering patterns
640
+ - Limited background diversity
641
+ - Limited handwriting coverage
642
+ - Limited severe blur and compression artifacts
643
+ - Limited curved or highly distorted text
644
+ - Possible unnatural source sentences
645
+ - Possible differences from photographs taken by real cameras
646
+ - Possible imbalance among fonts, rotations, text lengths, and backgrounds
647
+ - Primarily horizontal English text
648
+ - No guarantee of perfect semantic or grammatical quality in every sentence
 
649
 
650
+ Models trained exclusively on this dataset may require fine-tuning on real-world
651
+ OCR data before production use.
652
 
653
+ For stronger generalization, consider combining this dataset with legally
654
+ compatible real-image datasets.
655
 
656
+ ## Data Quality Notes
657
 
658
+ The annotations were generated automatically as part of the synthetic
659
+ rendering process.
660
 
661
+ Because the text, polygon, crop, and transcription originate from the same
662
+ generation pipeline, labels are expected to align closely with their
663
+ corresponding images.
664
 
665
+ The v2.0 release was packaged with:
666
 
667
+ - Aligned detector and recognizer IDs
668
+ - Matching detector and recognizer text
669
+ - Continuous IDs from `00000001` through `00240000`
670
+ - JSONL syntax validation
671
+ - Missing-file checks
672
+ - Duplicate-ID checks
673
+ - Duplicate-text checks for the newly generated extension
674
+ - ZIP path and CRC verification
675
 
676
+ Users should still perform their own validation before training production
677
+ systems.
 
 
 
 
 
678
 
679
  Recommended checks include:
680
 
681
+ - ZIP integrity
682
+ - Missing file detection
683
+ - Duplicate file detection
684
+ - JSONL parsing
685
+ - Image readability
686
+ - Polygon coordinate bounds
687
+ - Empty transcription detection
688
+ - Train and test leakage detection
 
 
 
 
 
689
 
690
+ ## License
 
 
 
691
 
692
  This dataset is licensed under the:
693
 
694
+ **Creative Commons Attribution-NonCommercial 4.0 International License
695
+ CC BY-NC 4.0**
696
 
697
  You may:
698
 
699
+ - Use the dataset for research
700
+ - Use the dataset for education
701
+ - Use the dataset for personal projects
702
+ - Modify and adapt the dataset
703
+ - Train non-commercial models
704
+ - Redistribute permitted adaptations with attribution
 
 
 
 
 
 
705
 
706
  You must:
707
 
708
+ - Credit the original creator
709
+ - Link or refer to this dataset repository
710
+ - Clearly indicate significant modifications
711
+ - Keep attribution information visible
712
+ - Comply with the CC BY-NC 4.0 license
 
 
 
 
 
713
 
714
  You may not:
715
 
716
+ - Use the dataset commercially without prior written permission
717
+ - Sell the dataset or access to the dataset
718
+ - Include the dataset in a paid commercial product without permission
719
+ - Use the dataset to provide a paid OCR service without permission
720
+ - Re-license the original dataset under incompatible terms
721
+ - Claim ownership of the original dataset
 
 
 
 
 
722
 
723
+ ## Commercial Licensing
 
724
 
725
  Commercial use is not included under the public CC BY-NC 4.0 license.
726
 
727
+ For commercial use, enterprise use, paid products, paid APIs, paid
728
+ applications, commercial model training, or commercial redistribution, prior
729
+ written permission is required.
730
 
731
  Please contact the creator to discuss a separate commercial license.
732
 
733
+ ## Attribution
734
 
735
  Suggested citation:
736
 
737
+ ```text
738
+ Synthetic English OCR Detection and Recognition 240K
739
+ Version 2.0
740
  Created by Trần Phi
741
  Hugging Face: Phitran21/synthetic-ocr-en-det-rec-120k
742
  License: CC BY-NC 4.0
743
+ ```
744
 
745
  Suggested attribution for model cards:
746
 
747
+ ```text
748
  This model was trained using the Synthetic English OCR Detection
749
+ and Recognition 240K dataset (v2.0), created by Trần Phi:
750
+ https://huggingface.co/datasets/Phitran21/synthetic-ocr-en-det-rec-120k
751
+ ```
752
 
753
+ The repository URL contains the legacy `120k` identifier, while the current
754
+ release contains 240,000 paired samples.
755
 
756
+ ## Creator
757
+
758
+ **Trần Phi**
759
 
760
  Hugging Face:
761
 
762
  https://huggingface.co/Phitran21
763
 
764
+ ## Contact
765
 
766
  For dataset questions, issue reports, collaboration, or commercial licensing:
767
 
768
+ - Email: [email protected]
769
+ - Facebook: https://www.facebook.com/share/1PqDzPQJYf/
770
+ - Website: https://toren.io.vn
771
 
772
+ Email responses may be limited or delayed. For public technical questions,
773
+ using the Hugging Face Community tab is recommended.
774
 
775
+ ## Reporting Issues
 
 
 
776
 
777
  When reporting a problem, please include:
778
 
779
+ - Affected file name
780
+ - ZIP part name
781
+ - JSONL line number
782
+ - Description of the issue
783
+ - Minimal reproduction steps
784
+ - Screenshot or sample when appropriate
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
785
 
786
+ Please use the Community tab of this repository for public bug reports and
787
+ technical discussions.
788
 
789
+ ## Version History
790
 
791
+ ### v2.0 — Current
792
 
793
+ - 240,000 detector images
794
+ - 240,000 recognition crops
795
+ - 240,000 aligned detector/recognizer pairs
796
+ - 480,000 JPEG files in total
797
+ - Detector JSONL annotations
798
+ - Recognition JSONL annotations
799
+ - Ten detector ZIP archives
800
+ - Ten recognizer ZIP archives
801
+ - Continuous sample IDs through `en_00240000.jpg`
802
 
803
+ ### v1.0 Legacy 120K release
804
 
805
+ - Initial approximately 120K paired OCR release
806
+ - Five detector ZIP archives
807
+ - Five recognizer ZIP archives
808
+ - Original repository name established as
809
+ `synthetic-ocr-en-det-rec-120k`
810
 
811
+ The repository name was retained for backward compatibility when v2.0 expanded
812
+ the dataset to 240K.
813
 
814
+ ## Acknowledgements
815
 
816
+ Thank you to the open-source OCR, computer vision, Python, font, and
817
+ machine-learning communities whose tools and research make synthetic dataset
818
+ creation possible.
819
 
820
+ If this dataset is useful in your research or project, please consider giving
821
+ the repository a like and citing the dataset.