synthocr 2.1.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,773 @@
1
+ <!doctype html>
2
+ <html lang="en" data-theme="dark">
3
+ <head>
4
+ <meta charset="utf-8" />
5
+ <meta name="viewport" content="width=device-width, initial-scale=1" />
6
+ <meta name="color-scheme" content="dark light" />
7
+ <meta name="theme-color" content="#101116" />
8
+ <title>SynthOCR — OCR dataset generator</title>
9
+ <link rel="icon" href="/assets/brand.svg" type="image/svg+xml" />
10
+ <script src="/assets/theme.js"></script>
11
+ <link rel="stylesheet" href="/assets/app.css" />
12
+ <script src="/assets/app.js" defer></script>
13
+ </head>
14
+ <body>
15
+ <a class="skip-link" href="#generation-form">Skip to settings</a>
16
+ <header class="app-header">
17
+ <a class="brand" href="/" aria-label="SynthOCR home">
18
+ <img
19
+ class="brand-mark"
20
+ src="/assets/brand.svg"
21
+ width="32"
22
+ height="32"
23
+ alt=""
24
+ />
25
+ <span>Synth<span class="brand-light">OCR</span></span>
26
+ </a>
27
+ <div class="header-meta">
28
+ <span class="header-version" id="app-version"></span>
29
+ <button
30
+ type="button"
31
+ class="theme-toggle"
32
+ id="theme-toggle"
33
+ aria-label="Switch to light mode"
34
+ >
35
+ <span data-icon="sun" aria-hidden="true"></span
36
+ ><span id="theme-label">Light mode</span>
37
+ </button>
38
+ </div>
39
+ </header>
40
+ <main class="app-main">
41
+ <section class="page-heading" aria-labelledby="page-title">
42
+ <h1 id="page-title">Make OCR training data</h1>
43
+ <p>
44
+ Choose your text and a look. You get text images, each with
45
+ its exact text label (ground truth), saved to a folder on
46
+ your computer.
47
+ </p>
48
+ </section>
49
+ <form id="generation-form" class="steps" novalidate>
50
+ <section class="card" aria-labelledby="text-title">
51
+ <h2 id="text-title">
52
+ <span class="step-number">1</span>Text
53
+ </h2>
54
+ <fieldset class="field">
55
+ <legend class="field-label">Languages</legend>
56
+ <div class="choice-grid four">
57
+ <label class="choice">
58
+ <input
59
+ type="checkbox"
60
+ name="language"
61
+ value="sorani"
62
+ aria-describedby="language-help"
63
+ checked
64
+ />
65
+ <span class="choice-card"
66
+ ><strong>Sorani</strong
67
+ ><span lang="ckb" dir="rtl" class="native"
68
+ >کوردیی ناوەندی</span
69
+ ></span
70
+ >
71
+ </label>
72
+ <label class="choice">
73
+ <input
74
+ type="checkbox"
75
+ name="language"
76
+ value="kurmanji"
77
+ aria-describedby="language-help"
78
+ />
79
+ <span class="choice-card"
80
+ ><strong>Kurmanji</strong
81
+ ><span lang="kmr" class="native"
82
+ >Kurmancî</span
83
+ ></span
84
+ >
85
+ </label>
86
+ <label class="choice">
87
+ <input
88
+ type="checkbox"
89
+ name="language"
90
+ value="ar"
91
+ aria-describedby="language-help"
92
+ />
93
+ <span class="choice-card"
94
+ ><strong>Arabic</strong
95
+ ><span lang="ar" dir="rtl" class="native"
96
+ >العربية</span
97
+ ></span
98
+ >
99
+ </label>
100
+ <label class="choice">
101
+ <input
102
+ type="checkbox"
103
+ name="language"
104
+ value="en"
105
+ aria-describedby="language-help"
106
+ />
107
+ <span class="choice-card"
108
+ ><strong>English</strong></span
109
+ >
110
+ </label>
111
+ </div>
112
+ <p
113
+ id="language-help"
114
+ class="field-error"
115
+ role="status"
116
+ aria-live="polite"
117
+ hidden
118
+ ></p>
119
+ </fieldset>
120
+ <fieldset class="field">
121
+ <legend class="field-label">
122
+ Where the text comes from
123
+ </legend>
124
+ <div class="choice-grid two">
125
+ <label class="choice">
126
+ <input
127
+ type="radio"
128
+ name="source"
129
+ value="corpus"
130
+ checked
131
+ />
132
+ <span class="choice-card"
133
+ ><strong>Built-in text</strong
134
+ ><span
135
+ >Real sentences, words and numbers</span
136
+ ></span
137
+ >
138
+ </label>
139
+ <label class="choice">
140
+ <input
141
+ type="radio"
142
+ name="source"
143
+ value="upload"
144
+ />
145
+ <span class="choice-card"
146
+ ><strong>My file</strong
147
+ ><span>Upload TXT, CSV or JSONL</span></span
148
+ >
149
+ </label>
150
+ </div>
151
+ </fieldset>
152
+ <div id="upload-field" class="field" hidden>
153
+ <label class="field-label" for="corpus-file"
154
+ >Text file</label
155
+ >
156
+ <input
157
+ id="corpus-file"
158
+ type="file"
159
+ accept=".txt,.jsonl,.csv,text/plain,application/jsonl,text/csv"
160
+ aria-describedby="upload-help upload-status"
161
+ />
162
+ <fieldset
163
+ class="field file-language"
164
+ id="file-language-field"
165
+ hidden
166
+ >
167
+ <legend class="field-label">
168
+ Language of this file
169
+ </legend>
170
+ <p class="field-help">
171
+ A TXT file has no language column, so every line
172
+ is labelled with the language you choose here.
173
+ </p>
174
+ <div
175
+ class="chip-list"
176
+ id="file-language-options"
177
+ ></div>
178
+ </fieldset>
179
+ <p class="field-help" id="upload-help">
180
+ UTF-8 text. TXT: one text per line. CSV or JSONL: a
181
+ <code>text</code> column, and optionally a
182
+ <code>language</code> column.
183
+ </p>
184
+ <p
185
+ id="upload-status"
186
+ class="field-status"
187
+ role="status"
188
+ aria-live="polite"
189
+ hidden
190
+ ></p>
191
+ </div>
192
+ <div class="field">
193
+ <label class="field-label" for="samples"
194
+ >Number of images</label
195
+ >
196
+ <input
197
+ id="samples"
198
+ name="samples"
199
+ type="number"
200
+ min="1"
201
+ max="100000"
202
+ value="1000"
203
+ required
204
+ inputmode="numeric"
205
+ />
206
+ </div>
207
+ <fieldset class="field" id="language-shares-field" hidden>
208
+ <legend class="field-label">Share of images</legend>
209
+ <div class="share-list" id="language-shares"></div>
210
+ <p class="field-help">
211
+ Changing one language adjusts the others so the
212
+ total stays 100%.
213
+ </p>
214
+ </fieldset>
215
+ </section>
216
+
217
+ <section class="card" aria-labelledby="look-title">
218
+ <h2 id="look-title">
219
+ <span class="step-number">2</span>Look
220
+ </h2>
221
+ <fieldset class="field">
222
+ <legend class="sr-only">Image style</legend>
223
+ <div class="choice-grid three" id="style-options">
224
+ <label class="choice">
225
+ <input
226
+ type="radio"
227
+ name="style"
228
+ value="clean"
229
+ />
230
+ <span class="choice-card"
231
+ ><strong data-style-label="clean"
232
+ >Clean</strong
233
+ ><span data-style-description="clean"
234
+ >Black text on white.</span
235
+ ></span
236
+ >
237
+ </label>
238
+ <label class="choice">
239
+ <input
240
+ type="radio"
241
+ name="style"
242
+ value="balanced"
243
+ checked
244
+ />
245
+ <span class="choice-card"
246
+ ><strong data-style-label="balanced"
247
+ >Balanced</strong
248
+ ><span data-style-description="balanced"
249
+ >Clean images mixed with scans, old
250
+ paper and phone photos.</span
251
+ ></span
252
+ >
253
+ </label>
254
+ <label class="choice">
255
+ <input
256
+ type="radio"
257
+ name="style"
258
+ value="varied"
259
+ />
260
+ <span class="choice-card"
261
+ ><strong data-style-label="varied"
262
+ >Varied</strong
263
+ ><span data-style-description="varied"
264
+ >Every image on a different realistic
265
+ paper.</span
266
+ ></span
267
+ >
268
+ </label>
269
+ </div>
270
+ <p class="field-help" id="style-status" hidden>
271
+ Custom settings. Pick a style to start over.
272
+ </p>
273
+ </fieldset>
274
+ <details class="customize" id="customize">
275
+ <summary>
276
+ Customize<span
277
+ data-icon="chevron"
278
+ aria-hidden="true"
279
+ ></span>
280
+ </summary>
281
+ <div class="customize-inner">
282
+ <div class="field">
283
+ <div class="label-row">
284
+ <label
285
+ class="field-label"
286
+ for="effects-amount"
287
+ >Images with effects</label
288
+ >
289
+ <output
290
+ id="effects-amount-value"
291
+ for="effects-amount"
292
+ >75%</output
293
+ >
294
+ </div>
295
+ <input
296
+ id="effects-amount"
297
+ type="range"
298
+ min="0"
299
+ max="100"
300
+ step="5"
301
+ value="75"
302
+ aria-describedby="effects-amount-help"
303
+ />
304
+ <p class="field-help" id="effects-amount-help">
305
+ The rest are clean black text on white.
306
+ </p>
307
+ </div>
308
+ <fieldset class="field" id="backgrounds-field">
309
+ <legend class="field-label">Backgrounds</legend>
310
+ <p class="field-help">
311
+ Each image with effects uses one of the
312
+ backgrounds you select.
313
+ </p>
314
+ <div
315
+ class="chip-list"
316
+ id="background-options"
317
+ ></div>
318
+ </fieldset>
319
+ <fieldset class="field" id="effects-field">
320
+ <legend class="field-label">Effects</legend>
321
+ <p class="field-help">
322
+ Auto uses each background's own amount.
323
+ </p>
324
+ <div
325
+ class="effect-list"
326
+ id="effect-options"
327
+ ></div>
328
+ </fieldset>
329
+ <fieldset class="field" id="geometry-field">
330
+ <legend class="field-label">
331
+ Tilt, blur and contrast
332
+ </legend>
333
+ <p class="field-help">
334
+ Each image gets a random amount up to the
335
+ value you set. 0 turns it off.
336
+ </p>
337
+ <div class="slider-list">
338
+ <div class="slider-row">
339
+ <label for="tilt-amount">Tilt</label>
340
+ <input
341
+ id="tilt-amount"
342
+ type="range"
343
+ min="0"
344
+ max="10"
345
+ step="0.5"
346
+ value="2"
347
+ />
348
+ <output
349
+ id="tilt-amount-value"
350
+ for="tilt-amount"
351
+ >2°</output
352
+ >
353
+ </div>
354
+ <div class="slider-row">
355
+ <label for="blur-amount">Blur</label>
356
+ <input
357
+ id="blur-amount"
358
+ type="range"
359
+ min="0"
360
+ max="2"
361
+ step="0.05"
362
+ value="0.55"
363
+ />
364
+ <output
365
+ id="blur-amount-value"
366
+ for="blur-amount"
367
+ >0.55 px</output
368
+ >
369
+ </div>
370
+ <div class="slider-row">
371
+ <label for="contrast-amount"
372
+ >Contrast</label
373
+ >
374
+ <input
375
+ id="contrast-amount"
376
+ type="range"
377
+ min="0"
378
+ max="50"
379
+ step="5"
380
+ value="10"
381
+ />
382
+ <output
383
+ id="contrast-amount-value"
384
+ for="contrast-amount"
385
+ >10%</output
386
+ >
387
+ </div>
388
+ </div>
389
+ </fieldset>
390
+ <div class="field">
391
+ <div class="label-row">
392
+ <label class="field-label" for="text-size"
393
+ >Text size</label
394
+ >
395
+ <output id="text-size-value" for="text-size"
396
+ >48 px</output
397
+ >
398
+ </div>
399
+ <input
400
+ id="text-size"
401
+ type="range"
402
+ min="24"
403
+ max="96"
404
+ step="4"
405
+ value="48"
406
+ aria-describedby="text-size-help"
407
+ />
408
+ <p class="field-help" id="text-size-help">
409
+ How tall the letters are in pixels. Long
410
+ lines shrink to fit.
411
+ </p>
412
+ </div>
413
+ </div>
414
+ </details>
415
+ <details class="customize" id="fonts-panel">
416
+ <summary>
417
+ <span
418
+ >Fonts
419
+ <span class="summary-note" id="fonts-summary"
420
+ >All</span
421
+ ></span
422
+ ><span
423
+ data-icon="chevron"
424
+ aria-hidden="true"
425
+ ></span>
426
+ </summary>
427
+ <div class="customize-inner">
428
+ <p class="field-help">
429
+ Each image uses one of the chosen fonts that can
430
+ draw all of its text. Fonts you add stay in this
431
+ app on your computer.
432
+ </p>
433
+ <div class="font-actions">
434
+ <button
435
+ type="button"
436
+ class="text-button"
437
+ id="fonts-all"
438
+ >
439
+ All
440
+ </button>
441
+ <button
442
+ type="button"
443
+ class="text-button"
444
+ id="fonts-languages"
445
+ >
446
+ Only for my languages
447
+ </button>
448
+ <button
449
+ type="button"
450
+ class="text-button"
451
+ id="fonts-none"
452
+ >
453
+ None
454
+ </button>
455
+ <label class="secondary-button add-font">
456
+ <span
457
+ data-icon="plus"
458
+ aria-hidden="true"
459
+ ></span
460
+ >Add font…
461
+ <input
462
+ id="font-file"
463
+ class="sr-only"
464
+ type="file"
465
+ accept=".ttf,.otf,.ttc,.otc"
466
+ multiple
467
+ />
468
+ </label>
469
+ </div>
470
+ <p
471
+ class="field-status"
472
+ id="font-status"
473
+ role="status"
474
+ aria-live="polite"
475
+ ></p>
476
+ <p class="field-error" id="font-error" hidden></p>
477
+ <div
478
+ class="font-list"
479
+ id="font-list"
480
+ role="group"
481
+ aria-label="Fonts"
482
+ ></div>
483
+ </div>
484
+ </details>
485
+ <div class="preview" id="preview" aria-busy="true">
486
+ <div class="preview-heading">
487
+ <span class="field-label">Preview</span>
488
+ <button
489
+ type="button"
490
+ class="text-button"
491
+ id="refresh-preview"
492
+ >
493
+ <span
494
+ data-icon="refresh"
495
+ aria-hidden="true"
496
+ ></span
497
+ >Another example
498
+ </button>
499
+ </div>
500
+ <p class="field-help" id="preview-loading">
501
+ Rendering examples…
502
+ </p>
503
+ <p
504
+ class="field-error"
505
+ id="preview-error"
506
+ role="status"
507
+ hidden
508
+ ></p>
509
+ <div class="preview-grid" id="preview-grid"></div>
510
+ <div class="label-box">
511
+ <span class="label-title"
512
+ >Text label (ground truth)</span
513
+ >
514
+ <p id="preview-text" dir="auto">…</p>
515
+ </div>
516
+ </div>
517
+ </section>
518
+
519
+ <section class="card" aria-labelledby="generate-title">
520
+ <h2 id="generate-title">
521
+ <span class="step-number">3</span>Generate
522
+ </h2>
523
+ <div class="field">
524
+ <span class="field-label" id="folder-label"
525
+ >Save to</span
526
+ >
527
+ <div class="folder-row">
528
+ <span
529
+ class="folder-name"
530
+ id="folder-name"
531
+ aria-labelledby="folder-label"
532
+ >No folder chosen</span
533
+ >
534
+ <button
535
+ type="button"
536
+ class="secondary-button"
537
+ id="choose-folder"
538
+ >
539
+ <span
540
+ data-icon="folder"
541
+ aria-hidden="true"
542
+ ></span
543
+ >Choose folder…
544
+ </button>
545
+ </div>
546
+ <p
547
+ class="field-help"
548
+ id="folder-status"
549
+ role="status"
550
+ aria-live="polite"
551
+ >
552
+ Choose a folder on your computer. The dataset is
553
+ saved there when it is ready.
554
+ </p>
555
+ </div>
556
+ <div class="field">
557
+ <label class="field-label" for="dataset-name"
558
+ >Dataset name</label
559
+ >
560
+ <input
561
+ id="dataset-name"
562
+ name="name"
563
+ value="kurdish-dataset"
564
+ maxlength="64"
565
+ pattern="[A-Za-z0-9][A-Za-z0-9_\-]*"
566
+ required
567
+ aria-describedby="dataset-name-help"
568
+ />
569
+ <p class="field-help" id="dataset-name-help">
570
+ A new folder with this name is created. Letters,
571
+ numbers, - and _.
572
+ </p>
573
+ </div>
574
+ <fieldset class="field">
575
+ <legend class="field-label">Label format</legend>
576
+ <div class="format-list">
577
+ <label class="format-option">
578
+ <input
579
+ type="radio"
580
+ name="download-format"
581
+ value="dataset"
582
+ checked
583
+ />
584
+ <span
585
+ ><strong>Images + labels.jsonl</strong
586
+ ><small
587
+ >One JSON line per image with its text.
588
+ Works with any training code.</small
589
+ ></span
590
+ >
591
+ </label>
592
+ <label class="format-option">
593
+ <input
594
+ type="radio"
595
+ name="download-format"
596
+ value="csv"
597
+ />
598
+ <span
599
+ ><strong>Images + labels.csv</strong
600
+ ><small
601
+ >A spreadsheet: image file name and
602
+ text.</small
603
+ ></span
604
+ >
605
+ </label>
606
+ <label class="format-option">
607
+ <input
608
+ type="radio"
609
+ name="download-format"
610
+ value="tesseract"
611
+ />
612
+ <span
613
+ ><strong>Images + .gt.txt files</strong
614
+ ><small
615
+ >One text file next to each image, for
616
+ Tesseract training.</small
617
+ ></span
618
+ >
619
+ </label>
620
+ <label class="format-option">
621
+ <input
622
+ type="radio"
623
+ name="download-format"
624
+ value="imagefolder"
625
+ />
626
+ <span
627
+ ><strong>Hugging Face ImageFolder</strong
628
+ ><small
629
+ >Images + metadata.jsonl for
630
+ <code>load_dataset</code>.</small
631
+ ></span
632
+ >
633
+ </label>
634
+ </div>
635
+ </fieldset>
636
+ <div
637
+ class="form-error"
638
+ id="form-error"
639
+ role="alert"
640
+ hidden
641
+ ></div>
642
+ <button
643
+ class="primary-button"
644
+ id="generate-button"
645
+ type="submit"
646
+ >
647
+ <span id="generate-label">Generate dataset</span
648
+ ><span
649
+ data-icon="arrow-right"
650
+ aria-hidden="true"
651
+ ></span>
652
+ </button>
653
+ </section>
654
+ </form>
655
+
656
+ <section
657
+ class="card result"
658
+ id="generation-results"
659
+ aria-labelledby="run-title"
660
+ hidden
661
+ >
662
+ <div class="result-heading">
663
+ <h2 id="run-title">Your dataset</h2>
664
+ <span class="status-badge" id="job-status">Preparing</span>
665
+ </div>
666
+ <p class="job-name" id="job-name"></p>
667
+ <div class="progress-track">
668
+ <div
669
+ id="job-progress"
670
+ class="progress-bar"
671
+ style="width: 0%"
672
+ ></div>
673
+ </div>
674
+ <div class="progress-details">
675
+ <span id="job-message" role="status" aria-live="polite"
676
+ >Preparing…</span
677
+ ><span id="job-count"></span>
678
+ </div>
679
+ <button type="button" class="secondary-button" id="cancel-job">
680
+ Cancel
681
+ </button>
682
+ <div
683
+ class="field-error"
684
+ id="job-error"
685
+ role="alert"
686
+ hidden
687
+ ></div>
688
+ <div class="save-panel" id="save-panel" hidden>
689
+ <p
690
+ class="save-status"
691
+ id="save-status"
692
+ role="status"
693
+ aria-live="polite"
694
+ ></p>
695
+ <p
696
+ class="field-error"
697
+ id="save-error"
698
+ role="alert"
699
+ hidden
700
+ ></p>
701
+ <div class="save-actions">
702
+ <button
703
+ type="button"
704
+ class="primary-button"
705
+ id="save-button"
706
+ >
707
+ <span data-icon="folder" aria-hidden="true"></span
708
+ ><span id="save-label">Save to a folder…</span>
709
+ </button>
710
+ <button
711
+ type="button"
712
+ class="secondary-button"
713
+ id="download-button"
714
+ >
715
+ <span data-icon="download" aria-hidden="true"></span
716
+ >Download ZIP instead
717
+ </button>
718
+ </div>
719
+ <p
720
+ id="download-status"
721
+ class="field-help"
722
+ role="status"
723
+ aria-live="polite"
724
+ ></p>
725
+ <p
726
+ id="download-error"
727
+ class="field-error"
728
+ role="alert"
729
+ hidden
730
+ ></p>
731
+ </div>
732
+ <section class="gallery" id="gallery-section" hidden>
733
+ <div class="gallery-heading">
734
+ <h3>Examples from your dataset</h3>
735
+ <span id="gallery-count"></span>
736
+ </div>
737
+ <div class="sample-gallery" id="sample-gallery"></div>
738
+ <div
739
+ class="gallery-pagination"
740
+ id="gallery-pagination"
741
+ hidden
742
+ >
743
+ <button
744
+ type="button"
745
+ class="secondary-button"
746
+ id="gallery-previous"
747
+ >
748
+ Previous
749
+ </button>
750
+ <button
751
+ type="button"
752
+ class="secondary-button"
753
+ id="gallery-next"
754
+ >
755
+ Next
756
+ </button>
757
+ </div>
758
+ </section>
759
+ </section>
760
+
761
+ <section
762
+ class="card history"
763
+ id="recent-section"
764
+ aria-labelledby="history-title"
765
+ hidden
766
+ >
767
+ <h2 id="history-title">Earlier datasets</h2>
768
+ <div id="recent-runs"></div>
769
+ </section>
770
+ </main>
771
+ <div id="toast" class="toast" role="status" hidden></div>
772
+ </body>
773
+ </html>