Omnibus commited on
Commit
a4b0a46
·
1 Parent(s): 3335757

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1526 -43
app.py CHANGED
@@ -88,6 +88,87 @@ model17 = gr.Interface.load("spaces/Omnibus/detect-language-ocr")
88
  model18 = gr.Interface.load("spaces/Omnibus/detect-language-ocr")
89
  model19 = gr.Interface.load("spaces/Omnibus/detect-language-ocr")
90
  model20 = gr.Interface.load("spaces/Omnibus/detect-language-ocr")
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
91
  mylist = []
92
  myval = []
93
  for key in ocr_id.keys():
@@ -95,25 +176,1394 @@ for key in ocr_id.keys():
95
  ser_len=len(ocr_id)
96
 
97
 
98
- def set_targ():
99
- targ = 0
100
- return targ
101
-
102
- num1 = []
103
- targ = []
104
- targ_lang=[]
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
105
 
106
- def proc0(img):
107
- num1.clear()
108
- num1.append(0)
109
- targ.clear()
110
- targ.append(0)
111
- targ_lang.clear()
112
- targ_lang.append(mylist[0])
113
- print ("LISTS CLEARED")
114
- #def main_proc()
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
115
 
116
-
117
  def proc1(img):
118
  rand = random.randint(1,3000)
119
  time.sleep(rand/1000)
@@ -387,9 +1837,10 @@ def proc10(img):
387
  out_p = f'{targ_lang[0]}: {targ[0]}'
388
  return (out_a, out_p)
389
  ##################
390
- def proc11(img):
 
391
  rand = random.randint(1,3000)
392
- time.sleep(rand/1000)
393
  new_num=len(num1)-1
394
  num = new_num
395
  print (f"new_num: {new_num}")
@@ -397,7 +1848,7 @@ def proc11(img):
397
  num1.append(1)
398
  lang = f"{ocr_id[mylist[int(num)]]}"
399
  print(f"lang: {lang}")
400
- out = model11(img,lang)
401
  print (f'bounds: {out}')
402
  try:
403
  if float(out) > float(targ[0]):
@@ -415,9 +1866,9 @@ def proc11(img):
415
  out_p = f'{targ_lang[0]}: {targ[0]}'
416
  return (out_a, out_p)
417
 
418
- def proc12(img):
419
  rand = random.randint(1,3000)
420
- time.sleep(rand/1000)
421
  new_num=len(num1)-1
422
  num = new_num
423
  print (f"new_num: {new_num}")
@@ -425,7 +1876,7 @@ def proc12(img):
425
  num1.append(1)
426
  lang = f"{ocr_id[mylist[int(num)]]}"
427
  print(f"lang: {lang}")
428
- out = model12(img,lang)
429
  print (f'bounds: {out}')
430
  try:
431
  if float(out) > float(targ[0]):
@@ -442,9 +1893,9 @@ def proc12(img):
442
  out_p = f'{targ_lang[0]}: {targ[0]}'
443
  return (out_a, out_p)
444
 
445
- def proc13(img):
446
  rand = random.randint(1,3000)
447
- time.sleep(rand/1000)
448
  new_num=len(num1)-1
449
  num = new_num
450
  print (f"new_num: {new_num}")
@@ -452,7 +1903,7 @@ def proc13(img):
452
  num1.append(1)
453
  lang = f"{ocr_id[mylist[int(num)]]}"
454
  print(f"lang: {lang}")
455
- out = model13(img,lang)
456
  print (f'bounds: {out}')
457
  try:
458
  if float(out) > float(targ[0]):
@@ -470,9 +1921,9 @@ def proc13(img):
470
  out_p = f'{targ_lang[0]}: {targ[0]}'
471
  return (out_a, out_p)
472
 
473
- def proc14(img):
474
  rand = random.randint(1,3000)
475
- time.sleep(rand/1000)
476
  new_num=len(num1)-1
477
  num = new_num
478
  print (f"new_num: {new_num}")
@@ -480,7 +1931,7 @@ def proc14(img):
480
  num1.append(1)
481
  lang = f"{ocr_id[mylist[int(num)]]}"
482
  print(f"lang: {lang}")
483
- out = model14(img,lang)
484
  print (f'bounds: {out}')
485
  try:
486
  if float(out) > float(targ[0]):
@@ -498,9 +1949,9 @@ def proc14(img):
498
  out_p = f'{targ_lang[0]}: {targ[0]}'
499
  return (out_a, out_p)
500
 
501
- def proc15(img):
502
  rand = random.randint(1,3000)
503
- time.sleep(rand/1000)
504
  new_num=len(num1)-1
505
  num = new_num
506
  print (f"new_num: {new_num}")
@@ -508,7 +1959,7 @@ def proc15(img):
508
  num1.append(1)
509
  lang = f"{ocr_id[mylist[int(num)]]}"
510
  print(f"lang: {lang}")
511
- out = model15(img,lang)
512
  print (f'bounds: {out}')
513
  try:
514
  if float(out) > float(targ[0]):
@@ -525,7 +1976,7 @@ def proc15(img):
525
  out_p = f'{targ_lang[0]}: {targ[0]}'
526
  return (out_a, out_p)
527
 
528
- def proc16(img):
529
  rand = random.randint(1,3000)
530
  time.sleep(rand/1000)
531
  new_num=len(num1)-1
@@ -535,7 +1986,7 @@ def proc16(img):
535
  num1.append(1)
536
  lang = f"{ocr_id[mylist[int(num)]]}"
537
  print(f"lang: {lang}")
538
- out = model16(img,lang)
539
  print (f'bounds: {out}')
540
  try:
541
  if float(out) > float(targ[0]):
@@ -552,7 +2003,7 @@ def proc16(img):
552
  out_p = f'{targ_lang[0]}: {targ[0]}'
553
  return (out_a, out_p)
554
 
555
- def proc17(img):
556
  rand = random.randint(1,3000)
557
  time.sleep(rand/1000)
558
  new_num=len(num1)-1
@@ -562,7 +2013,7 @@ def proc17(img):
562
  num1.append(1)
563
  lang = f"{ocr_id[mylist[int(num)]]}"
564
  print(f"lang: {lang}")
565
- out = model17(img,lang)
566
  print (f'bounds: {out}')
567
  try:
568
  if float(out) > float(targ[0]):
@@ -579,7 +2030,7 @@ def proc17(img):
579
  out_p = f'{targ_lang[0]}: {targ[0]}'
580
  return (out_a, out_p)
581
 
582
- def proc18(img):
583
  rand = random.randint(1,3000)
584
  time.sleep(rand/1000)
585
  new_num=len(num1)-1
@@ -589,7 +2040,7 @@ def proc18(img):
589
  num1.append(1)
590
  lang = f"{ocr_id[mylist[int(num)]]}"
591
  print(f"lang: {lang}")
592
- out = model18(img,lang)
593
  print (f'bounds: {out}')
594
  try:
595
  if float(out) > float(targ[0]):
@@ -606,7 +2057,7 @@ def proc18(img):
606
  out_p = f'{targ_lang[0]}: {targ[0]}'
607
  return (out_a, out_p)
608
 
609
- def proc19(img):
610
  rand = random.randint(1,3000)
611
  time.sleep(rand/1000)
612
  new_num=len(num1)-1
@@ -616,7 +2067,7 @@ def proc19(img):
616
  num1.append(1)
617
  lang = f"{ocr_id[mylist[int(num)]]}"
618
  print(f"lang: {lang}")
619
- out = model19(img,lang)
620
  print (f'bounds: {out}')
621
  try:
622
  if float(out) > float(targ[0]):
@@ -633,7 +2084,7 @@ def proc19(img):
633
  out_p = f'{targ_lang[0]}: {targ[0]}'
634
  return (out_a, out_p)
635
 
636
- def proc20(img):
637
  rand = random.randint(1,3000)
638
  time.sleep(rand/1000)
639
  new_num=len(num1)-1
@@ -643,7 +2094,7 @@ def proc20(img):
643
  num1.append(1)
644
  lang = f"{ocr_id[mylist[int(num)]]}"
645
  print(f"lang: {lang}")
646
- out = model20(img,lang)
647
  print (f'bounds: {out}')
648
  try:
649
  if float(out) > float(targ[0]):
@@ -659,7 +2110,7 @@ def proc20(img):
659
  pass
660
  out_p = f'{targ_lang[0]}: {targ[0]}'
661
  return (out_a, out_p)
662
-
663
 
664
 
665
  with gr.Blocks() as app:
@@ -715,6 +2166,38 @@ with gr.Blocks() as app:
715
  det_btn.click(proc19,[im],[out19,prob_lang], show_progress=False)
716
  det_btn.click(proc20,[im],[out20,prob_lang], show_progress=False)
717
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
718
 
719
  out1.change(proc1,[im],[out1,prob_lang], show_progress=False)
720
  out2.change(proc2,[im],[out2,prob_lang], show_progress=False)
 
88
  model18 = gr.Interface.load("spaces/Omnibus/detect-language-ocr")
89
  model19 = gr.Interface.load("spaces/Omnibus/detect-language-ocr")
90
  model20 = gr.Interface.load("spaces/Omnibus/detect-language-ocr")
91
+ model21 = gr.Interface.load("spaces/Omnibus/detect-language-ocr")
92
+ model22 = gr.Interface.load("spaces/Omnibus/detect-language-ocr")
93
+ model23 = gr.Interface.load("spaces/Omnibus/detect-language-ocr")
94
+ model24 = gr.Interface.load("spaces/Omnibus/detect-language-ocr")
95
+ model25 = gr.Interface.load("spaces/Omnibus/detect-language-ocr")
96
+ model26 = gr.Interface.load("spaces/Omnibus/detect-language-ocr")
97
+ model27 = gr.Interface.load("spaces/Omnibus/detect-language-ocr")
98
+ model28 = gr.Interface.load("spaces/Omnibus/detect-language-ocr")
99
+ model29 = gr.Interface.load("spaces/Omnibus/detect-language-ocr")
100
+ model30 = gr.Interface.load("spaces/Omnibus/detect-language-ocr")
101
+ model31 = gr.Interface.load("spaces/Omnibus/detect-language-ocr")
102
+ model32 = gr.Interface.load("spaces/Omnibus/detect-language-ocr")
103
+ model33 = gr.Interface.load("spaces/Omnibus/detect-language-ocr")
104
+ model34 = gr.Interface.load("spaces/Omnibus/detect-language-ocr")
105
+ model35 = gr.Interface.load("spaces/Omnibus/detect-language-ocr")
106
+ model36 = gr.Interface.load("spaces/Omnibus/detect-language-ocr")
107
+ model37 = gr.Interface.load("spaces/Omnibus/detect-language-ocr")
108
+ model38 = gr.Interface.load("spaces/Omnibus/detect-language-ocr")
109
+ model39 = gr.Interface.load("spaces/Omnibus/detect-language-ocr")
110
+ model40 = gr.Interface.load("spaces/Omnibus/detect-language-ocr")
111
+ model41 = gr.Interface.load("spaces/Omnibus/detect-language-ocr")
112
+ model42 = gr.Interface.load("spaces/Omnibus/detect-language-ocr")
113
+ model43 = gr.Interface.load("spaces/Omnibus/detect-language-ocr")
114
+ model44 = gr.Interface.load("spaces/Omnibus/detect-language-ocr")
115
+ model45 = gr.Interface.load("spaces/Omnibus/detect-language-ocr")
116
+ model46 = gr.Interface.load("spaces/Omnibus/detect-language-ocr")
117
+ model47 = gr.Interface.load("spaces/Omnibus/detect-language-ocr")
118
+ model48 = gr.Interface.load("spaces/Omnibus/detect-language-ocr")
119
+ model49 = gr.Interface.load("spaces/Omnibus/detect-language-ocr")
120
+ model50 = gr.Interface.load("spaces/Omnibus/detect-language-ocr")
121
+ model51 = gr.Interface.load("spaces/Omnibus/detect-language-ocr")
122
+ model52 = gr.Interface.load("spaces/Omnibus/detect-language-ocr")
123
+ model53 = gr.Interface.load("spaces/Omnibus/detect-language-ocr")
124
+ model54 = gr.Interface.load("spaces/Omnibus/detect-language-ocr")
125
+ model55 = gr.Interface.load("spaces/Omnibus/detect-language-ocr")
126
+ model56 = gr.Interface.load("spaces/Omnibus/detect-language-ocr")
127
+ model57 = gr.Interface.load("spaces/Omnibus/detect-language-ocr")
128
+ model58 = gr.Interface.load("spaces/Omnibus/detect-language-ocr")
129
+ model59 = gr.Interface.load("spaces/Omnibus/detect-language-ocr")
130
+ model60 = gr.Interface.load("spaces/Omnibus/detect-language-ocr")
131
+ model61 = gr.Interface.load("spaces/Omnibus/detect-language-ocr")
132
+ model62 = gr.Interface.load("spaces/Omnibus/detect-language-ocr")
133
+ model63 = gr.Interface.load("spaces/Omnibus/detect-language-ocr")
134
+ model64 = gr.Interface.load("spaces/Omnibus/detect-language-ocr")
135
+ model65 = gr.Interface.load("spaces/Omnibus/detect-language-ocr")
136
+ model66 = gr.Interface.load("spaces/Omnibus/detect-language-ocr")
137
+ model67 = gr.Interface.load("spaces/Omnibus/detect-language-ocr")
138
+ model68 = gr.Interface.load("spaces/Omnibus/detect-language-ocr")
139
+ model69 = gr.Interface.load("spaces/Omnibus/detect-language-ocr")
140
+ model70 = gr.Interface.load("spaces/Omnibus/detect-language-ocr")
141
+ model71 = gr.Interface.load("spaces/Omnibus/detect-language-ocr")
142
+ model72 = gr.Interface.load("spaces/Omnibus/detect-language-ocr")
143
+ model73 = gr.Interface.load("spaces/Omnibus/detect-language-ocr")
144
+ model74 = gr.Interface.load("spaces/Omnibus/detect-language-ocr")
145
+ model75 = gr.Interface.load("spaces/Omnibus/detect-language-ocr")
146
+ model76 = gr.Interface.load("spaces/Omnibus/detect-language-ocr")
147
+ model77 = gr.Interface.load("spaces/Omnibus/detect-language-ocr")
148
+ model78 = gr.Interface.load("spaces/Omnibus/detect-language-ocr")
149
+ model79 = gr.Interface.load("spaces/Omnibus/detect-language-ocr")
150
+ model80 = gr.Interface.load("spaces/Omnibus/detect-language-ocr")
151
+ model81 = gr.Interface.load("spaces/Omnibus/detect-language-ocr")
152
+ model82 = gr.Interface.load("spaces/Omnibus/detect-language-ocr")
153
+ model83 = gr.Interface.load("spaces/Omnibus/detect-language-ocr")
154
+ model84 = gr.Interface.load("spaces/Omnibus/detect-language-ocr")
155
+ model85 = gr.Interface.load("spaces/Omnibus/detect-language-ocr")
156
+ model86 = gr.Interface.load("spaces/Omnibus/detect-language-ocr")
157
+ model87 = gr.Interface.load("spaces/Omnibus/detect-language-ocr")
158
+ model88 = gr.Interface.load("spaces/Omnibus/detect-language-ocr")
159
+ model89 = gr.Interface.load("spaces/Omnibus/detect-language-ocr")
160
+ model90 = gr.Interface.load("spaces/Omnibus/detect-language-ocr")
161
+ model91 = gr.Interface.load("spaces/Omnibus/detect-language-ocr")
162
+ model92 = gr.Interface.load("spaces/Omnibus/detect-language-ocr")
163
+ model93 = gr.Interface.load("spaces/Omnibus/detect-language-ocr")
164
+ model94 = gr.Interface.load("spaces/Omnibus/detect-language-ocr")
165
+ model95 = gr.Interface.load("spaces/Omnibus/detect-language-ocr")
166
+ model96 = gr.Interface.load("spaces/Omnibus/detect-language-ocr")
167
+ model97 = gr.Interface.load("spaces/Omnibus/detect-language-ocr")
168
+ model98 = gr.Interface.load("spaces/Omnibus/detect-language-ocr")
169
+ model99 = gr.Interface.load("spaces/Omnibus/detect-language-ocr")
170
+ model100 = gr.Interface.load("spaces/Omnibus/detect-language-ocr")
171
+
172
  mylist = []
173
  myval = []
174
  for key in ocr_id.keys():
 
176
  ser_len=len(ocr_id)
177
 
178
 
179
+ def set_targ():
180
+ targ = 0
181
+ return targ
182
+
183
+ num1 = []
184
+ targ = []
185
+ targ_lang=[]
186
+
187
+ def proc0(img):
188
+ num1.clear()
189
+ num1.append(0)
190
+ targ.clear()
191
+ targ.append(0)
192
+ targ_lang.clear()
193
+ targ_lang.append(mylist[0])
194
+ print ("LISTS CLEARED")
195
+ #def main_proc()
196
+
197
+
198
+ def proc1(img):
199
+ rand = random.randint(1,3000)
200
+ time.sleep(rand/1000)
201
+ new_num=len(num1)-1
202
+ num = new_num
203
+ print (f"new_num: {new_num}")
204
+ if int(num) <= (ser_len - 1):
205
+ num1.append(1)
206
+ lang = f"{ocr_id[mylist[int(num)]]}"
207
+ print(f"lang: {lang}")
208
+ out = model1(img,lang)
209
+ print (f'bounds: {out}')
210
+ try:
211
+ if float(out) > float(targ[0]):
212
+ targ[0]=out
213
+ targ_lang[0]=mylist[int(num)]
214
+ else:
215
+ pass
216
+ out_a = f'{mylist[int(num)]}: {out}'
217
+
218
+ except Exception as e:
219
+ out_a = f"Error:: {e} :: {num}"
220
+ else:
221
+ out_a = 'Done'
222
+ pass
223
+ out_p = f'{targ_lang[0]}: {targ[0]}'
224
+ return (out_a, out_p)
225
+
226
+ def proc2(img):
227
+ rand = random.randint(1,3000)
228
+ time.sleep(rand/1000)
229
+ new_num=len(num1)-1
230
+ num = new_num
231
+ print (f"new_num: {new_num}")
232
+ if int(num) <= (ser_len - 1):
233
+ num1.append(1)
234
+ lang = f"{ocr_id[mylist[int(num)]]}"
235
+ print(f"lang: {lang}")
236
+ out = model2(img,lang)
237
+ print (f'bounds: {out}')
238
+ try:
239
+ if float(out) > float(targ[0]):
240
+ targ[0] = out
241
+ targ_lang[0]=mylist[int(num)]
242
+ else:
243
+ pass
244
+ out_a = f'{mylist[int(num)]}: {out}'
245
+ except Exception as e:
246
+ out_a = f"Error:: {e} :: {num}"
247
+ else:
248
+ out_a = 'Done'
249
+ pass
250
+ out_p = f'{targ_lang[0]}: {targ[0]}'
251
+ return (out_a, out_p)
252
+
253
+ def proc3(img):
254
+ rand = random.randint(1,3000)
255
+ time.sleep(rand/1000)
256
+ new_num=len(num1)-1
257
+ num = new_num
258
+ print (f"new_num: {new_num}")
259
+ if int(num) <= (ser_len - 1):
260
+ num1.append(1)
261
+ lang = f"{ocr_id[mylist[int(num)]]}"
262
+ print(f"lang: {lang}")
263
+ out = model3(img,lang)
264
+ print (f'bounds: {out}')
265
+ try:
266
+ if float(out) > float(targ[0]):
267
+ targ[0] = out
268
+ targ_lang[0]=mylist[int(num)]
269
+ else:
270
+ pass
271
+ out_a = f'{mylist[int(num)]}: {out}'
272
+
273
+ except Exception as e:
274
+ out_a = f"Error:: {e} :: {num}"
275
+ else:
276
+ out_a = 'Done'
277
+ pass
278
+ out_p = f'{targ_lang[0]}: {targ[0]}'
279
+ return (out_a, out_p)
280
+
281
+ def proc4(img):
282
+ rand = random.randint(1,3000)
283
+ time.sleep(rand/1000)
284
+ new_num=len(num1)-1
285
+ num = new_num
286
+ print (f"new_num: {new_num}")
287
+ if int(num) <= (ser_len - 1):
288
+ num1.append(1)
289
+ lang = f"{ocr_id[mylist[int(num)]]}"
290
+ print(f"lang: {lang}")
291
+ out = model4(img,lang)
292
+ print (f'bounds: {out}')
293
+ try:
294
+ if float(out) > float(targ[0]):
295
+ targ[0] = out
296
+ targ_lang[0]=mylist[int(num)]
297
+ else:
298
+ pass
299
+ out_a = f'{mylist[int(num)]}: {out}'
300
+
301
+ except Exception as e:
302
+ out_a = f"Error:: {e} :: {num}"
303
+ else:
304
+ out_a = 'Done'
305
+ pass
306
+ out_p = f'{targ_lang[0]}: {targ[0]}'
307
+ return (out_a, out_p)
308
+
309
+ def proc5(img):
310
+ rand = random.randint(1,3000)
311
+ time.sleep(rand/1000)
312
+ new_num=len(num1)-1
313
+ num = new_num
314
+ print (f"new_num: {new_num}")
315
+ if int(num) <= (ser_len - 1):
316
+ num1.append(1)
317
+ lang = f"{ocr_id[mylist[int(num)]]}"
318
+ print(f"lang: {lang}")
319
+ out = model5(img,lang)
320
+ print (f'bounds: {out}')
321
+ try:
322
+ if float(out) > float(targ[0]):
323
+ targ[0] = out
324
+ targ_lang[0]=mylist[int(num)]
325
+ else:
326
+ pass
327
+ except Exception as e:
328
+ return f"Error:: {e}"
329
+ out_a = f'{mylist[int(num)]}: {out}'
330
+ else:
331
+ out_a = 'Done'
332
+ pass
333
+ out_p = f'{targ_lang[0]}: {targ[0]}'
334
+ return (out_a, out_p)
335
+
336
+ def proc6(img):
337
+ rand = random.randint(1,3000)
338
+ time.sleep(rand/1000)
339
+ new_num=len(num1)-1
340
+ num = new_num
341
+ print (f"new_num: {new_num}")
342
+ if int(num) <= (ser_len - 1):
343
+ num1.append(1)
344
+ lang = f"{ocr_id[mylist[int(num)]]}"
345
+ print(f"lang: {lang}")
346
+ out = model6(img,lang)
347
+ print (f'bounds: {out}')
348
+ try:
349
+ if float(out) > float(targ[0]):
350
+ targ[0] = out
351
+ targ_lang[0]=mylist[int(num)]
352
+ else:
353
+ pass
354
+ except Exception as e:
355
+ return f"Error:: {e}"
356
+ out_a = f'{mylist[int(num)]}: {out}'
357
+ else:
358
+ out_a = 'Done'
359
+ pass
360
+ out_p = f'{targ_lang[0]}: {targ[0]}'
361
+ return (out_a, out_p)
362
+
363
+ def proc7(img):
364
+ rand = random.randint(1,3000)
365
+ time.sleep(rand/1000)
366
+ new_num=len(num1)-1
367
+ num = new_num
368
+ print (f"new_num: {new_num}")
369
+ if int(num) <= (ser_len - 1):
370
+ num1.append(1)
371
+ lang = f"{ocr_id[mylist[int(num)]]}"
372
+ print(f"lang: {lang}")
373
+ out = model7(img,lang)
374
+ print (f'bounds: {out}')
375
+ try:
376
+ if float(out) > float(targ[0]):
377
+ targ[0] = out
378
+ targ_lang[0]=mylist[int(num)]
379
+ else:
380
+ pass
381
+ except Exception as e:
382
+ return f"Error:: {e}"
383
+ out_a = f'{mylist[int(num)]}: {out}'
384
+ else:
385
+ out_a = 'Done'
386
+ pass
387
+ out_p = f'{targ_lang[0]}: {targ[0]}'
388
+ return (out_a, out_p)
389
+
390
+ def proc8(img):
391
+ rand = random.randint(1,3000)
392
+ time.sleep(rand/1000)
393
+ new_num=len(num1)-1
394
+ num = new_num
395
+ print (f"new_num: {new_num}")
396
+ if int(num) <= (ser_len - 1):
397
+ num1.append(1)
398
+ lang = f"{ocr_id[mylist[int(num)]]}"
399
+ print(f"lang: {lang}")
400
+ out = model8(img,lang)
401
+ print (f'bounds: {out}')
402
+ try:
403
+ if float(out) > float(targ[0]):
404
+ targ[0] = out
405
+ targ_lang[0]=mylist[int(num)]
406
+ else:
407
+ pass
408
+ except Exception as e:
409
+ return f"Error:: {e}"
410
+ out_a = f'{mylist[int(num)]}: {out}'
411
+ else:
412
+ out_a = 'Done'
413
+ pass
414
+ out_p = f'{targ_lang[0]}: {targ[0]}'
415
+ return (out_a, out_p)
416
+
417
+ def proc9(img):
418
+ rand = random.randint(1,3000)
419
+ time.sleep(rand/1000)
420
+ new_num=len(num1)-1
421
+ num = new_num
422
+ print (f"new_num: {new_num}")
423
+ if int(num) <= (ser_len - 1):
424
+ num1.append(1)
425
+ lang = f"{ocr_id[mylist[int(num)]]}"
426
+ print(f"lang: {lang}")
427
+ out = model9(img,lang)
428
+ print (f'bounds: {out}')
429
+ try:
430
+ if float(out) > float(targ[0]):
431
+ targ[0] = out
432
+ targ_lang[0]=mylist[int(num)]
433
+ else:
434
+ pass
435
+ except Exception as e:
436
+ return f"Error:: {e}"
437
+ out_a = f'{mylist[int(num)]}: {out}'
438
+ else:
439
+ out_a = 'Done'
440
+ pass
441
+ out_p = f'{targ_lang[0]}: {targ[0]}'
442
+ return (out_a, out_p)
443
+
444
+ def proc10(img):
445
+ rand = random.randint(1,3000)
446
+ time.sleep(rand/1000)
447
+ new_num=len(num1)-1
448
+ num = new_num
449
+ print (f"new_num: {new_num}")
450
+ if int(num) <= (ser_len - 1):
451
+ num1.append(1)
452
+ lang = f"{ocr_id[mylist[int(num)]]}"
453
+ print(f"lang: {lang}")
454
+ out = model10(img,lang)
455
+ print (f'bounds: {out}')
456
+ try:
457
+ if float(out) > float(targ[0]):
458
+ targ[0] = out
459
+ targ_lang[0]=mylist[int(num)]
460
+ else:
461
+ pass
462
+ except Exception as e:
463
+ return f"Error:: {e}"
464
+ out_a = f'{mylist[int(num)]}: {out}'
465
+ else:
466
+ out_a = 'Done'
467
+ pass
468
+ out_p = f'{targ_lang[0]}: {targ[0]}'
469
+ return (out_a, out_p)
470
+ ##################
471
+ def proc11(img):
472
+ rand = random.randint(1,3000)
473
+ time.sleep(rand/1000)
474
+ new_num=len(num1)-1
475
+ num = new_num
476
+ print (f"new_num: {new_num}")
477
+ if int(num) <= (ser_len - 1):
478
+ num1.append(1)
479
+ lang = f"{ocr_id[mylist[int(num)]]}"
480
+ print(f"lang: {lang}")
481
+ out = model11(img,lang)
482
+ print (f'bounds: {out}')
483
+ try:
484
+ if float(out) > float(targ[0]):
485
+ targ[0]=out
486
+ targ_lang[0]=mylist[int(num)]
487
+ else:
488
+ pass
489
+ out_a = f'{mylist[int(num)]}: {out}'
490
+
491
+ except Exception as e:
492
+ out_a = f"Error:: {e} :: {num}"
493
+ else:
494
+ out_a = 'Done'
495
+ pass
496
+ out_p = f'{targ_lang[0]}: {targ[0]}'
497
+ return (out_a, out_p)
498
+
499
+ def proc12(img):
500
+ rand = random.randint(1,3000)
501
+ time.sleep(rand/1000)
502
+ new_num=len(num1)-1
503
+ num = new_num
504
+ print (f"new_num: {new_num}")
505
+ if int(num) <= (ser_len - 1):
506
+ num1.append(1)
507
+ lang = f"{ocr_id[mylist[int(num)]]}"
508
+ print(f"lang: {lang}")
509
+ out = model12(img,lang)
510
+ print (f'bounds: {out}')
511
+ try:
512
+ if float(out) > float(targ[0]):
513
+ targ[0] = out
514
+ targ_lang[0]=mylist[int(num)]
515
+ else:
516
+ pass
517
+ out_a = f'{mylist[int(num)]}: {out}'
518
+ except Exception as e:
519
+ out_a = f"Error:: {e} :: {num}"
520
+ else:
521
+ out_a = 'Done'
522
+ pass
523
+ out_p = f'{targ_lang[0]}: {targ[0]}'
524
+ return (out_a, out_p)
525
+
526
+ def proc13(img):
527
+ rand = random.randint(1,3000)
528
+ time.sleep(rand/1000)
529
+ new_num=len(num1)-1
530
+ num = new_num
531
+ print (f"new_num: {new_num}")
532
+ if int(num) <= (ser_len - 1):
533
+ num1.append(1)
534
+ lang = f"{ocr_id[mylist[int(num)]]}"
535
+ print(f"lang: {lang}")
536
+ out = model13(img,lang)
537
+ print (f'bounds: {out}')
538
+ try:
539
+ if float(out) > float(targ[0]):
540
+ targ[0] = out
541
+ targ_lang[0]=mylist[int(num)]
542
+ else:
543
+ pass
544
+ out_a = f'{mylist[int(num)]}: {out}'
545
+
546
+ except Exception as e:
547
+ out_a = f"Error:: {e} :: {num}"
548
+ else:
549
+ out_a = 'Done'
550
+ pass
551
+ out_p = f'{targ_lang[0]}: {targ[0]}'
552
+ return (out_a, out_p)
553
+
554
+ def proc14(img):
555
+ rand = random.randint(1,3000)
556
+ time.sleep(rand/1000)
557
+ new_num=len(num1)-1
558
+ num = new_num
559
+ print (f"new_num: {new_num}")
560
+ if int(num) <= (ser_len - 1):
561
+ num1.append(1)
562
+ lang = f"{ocr_id[mylist[int(num)]]}"
563
+ print(f"lang: {lang}")
564
+ out = model14(img,lang)
565
+ print (f'bounds: {out}')
566
+ try:
567
+ if float(out) > float(targ[0]):
568
+ targ[0] = out
569
+ targ_lang[0]=mylist[int(num)]
570
+ else:
571
+ pass
572
+ out_a = f'{mylist[int(num)]}: {out}'
573
+
574
+ except Exception as e:
575
+ out_a = f"Error:: {e} :: {num}"
576
+ else:
577
+ out_a = 'Done'
578
+ pass
579
+ out_p = f'{targ_lang[0]}: {targ[0]}'
580
+ return (out_a, out_p)
581
+
582
+ def proc15(img):
583
+ rand = random.randint(1,3000)
584
+ time.sleep(rand/1000)
585
+ new_num=len(num1)-1
586
+ num = new_num
587
+ print (f"new_num: {new_num}")
588
+ if int(num) <= (ser_len - 1):
589
+ num1.append(1)
590
+ lang = f"{ocr_id[mylist[int(num)]]}"
591
+ print(f"lang: {lang}")
592
+ out = model15(img,lang)
593
+ print (f'bounds: {out}')
594
+ try:
595
+ if float(out) > float(targ[0]):
596
+ targ[0] = out
597
+ targ_lang[0]=mylist[int(num)]
598
+ else:
599
+ pass
600
+ except Exception as e:
601
+ return f"Error:: {e}"
602
+ out_a = f'{mylist[int(num)]}: {out}'
603
+ else:
604
+ out_a = 'Done'
605
+ pass
606
+ out_p = f'{targ_lang[0]}: {targ[0]}'
607
+ return (out_a, out_p)
608
+
609
+ def proc16(img):
610
+ rand = random.randint(1,3000)
611
+ time.sleep(rand/1000)
612
+ new_num=len(num1)-1
613
+ num = new_num
614
+ print (f"new_num: {new_num}")
615
+ if int(num) <= (ser_len - 1):
616
+ num1.append(1)
617
+ lang = f"{ocr_id[mylist[int(num)]]}"
618
+ print(f"lang: {lang}")
619
+ out = model16(img,lang)
620
+ print (f'bounds: {out}')
621
+ try:
622
+ if float(out) > float(targ[0]):
623
+ targ[0] = out
624
+ targ_lang[0]=mylist[int(num)]
625
+ else:
626
+ pass
627
+ except Exception as e:
628
+ return f"Error:: {e}"
629
+ out_a = f'{mylist[int(num)]}: {out}'
630
+ else:
631
+ out_a = 'Done'
632
+ pass
633
+ out_p = f'{targ_lang[0]}: {targ[0]}'
634
+ return (out_a, out_p)
635
+
636
+ def proc17(img):
637
+ rand = random.randint(1,3000)
638
+ time.sleep(rand/1000)
639
+ new_num=len(num1)-1
640
+ num = new_num
641
+ print (f"new_num: {new_num}")
642
+ if int(num) <= (ser_len - 1):
643
+ num1.append(1)
644
+ lang = f"{ocr_id[mylist[int(num)]]}"
645
+ print(f"lang: {lang}")
646
+ out = model17(img,lang)
647
+ print (f'bounds: {out}')
648
+ try:
649
+ if float(out) > float(targ[0]):
650
+ targ[0] = out
651
+ targ_lang[0]=mylist[int(num)]
652
+ else:
653
+ pass
654
+ except Exception as e:
655
+ return f"Error:: {e}"
656
+ out_a = f'{mylist[int(num)]}: {out}'
657
+ else:
658
+ out_a = 'Done'
659
+ pass
660
+ out_p = f'{targ_lang[0]}: {targ[0]}'
661
+ return (out_a, out_p)
662
+
663
+ def proc18(img):
664
+ rand = random.randint(1,3000)
665
+ time.sleep(rand/1000)
666
+ new_num=len(num1)-1
667
+ num = new_num
668
+ print (f"new_num: {new_num}")
669
+ if int(num) <= (ser_len - 1):
670
+ num1.append(1)
671
+ lang = f"{ocr_id[mylist[int(num)]]}"
672
+ print(f"lang: {lang}")
673
+ out = model18(img,lang)
674
+ print (f'bounds: {out}')
675
+ try:
676
+ if float(out) > float(targ[0]):
677
+ targ[0] = out
678
+ targ_lang[0]=mylist[int(num)]
679
+ else:
680
+ pass
681
+ except Exception as e:
682
+ return f"Error:: {e}"
683
+ out_a = f'{mylist[int(num)]}: {out}'
684
+ else:
685
+ out_a = 'Done'
686
+ pass
687
+ out_p = f'{targ_lang[0]}: {targ[0]}'
688
+ return (out_a, out_p)
689
+
690
+ def proc19(img):
691
+ rand = random.randint(1,3000)
692
+ time.sleep(rand/1000)
693
+ new_num=len(num1)-1
694
+ num = new_num
695
+ print (f"new_num: {new_num}")
696
+ if int(num) <= (ser_len - 1):
697
+ num1.append(1)
698
+ lang = f"{ocr_id[mylist[int(num)]]}"
699
+ print(f"lang: {lang}")
700
+ out = model19(img,lang)
701
+ print (f'bounds: {out}')
702
+ try:
703
+ if float(out) > float(targ[0]):
704
+ targ[0] = out
705
+ targ_lang[0]=mylist[int(num)]
706
+ else:
707
+ pass
708
+ except Exception as e:
709
+ return f"Error:: {e}"
710
+ out_a = f'{mylist[int(num)]}: {out}'
711
+ else:
712
+ out_a = 'Done'
713
+ pass
714
+ out_p = f'{targ_lang[0]}: {targ[0]}'
715
+ return (out_a, out_p)
716
+
717
+ def proc20(img):
718
+ rand = random.randint(1,3000)
719
+ time.sleep(rand/1000)
720
+ new_num=len(num1)-1
721
+ num = new_num
722
+ print (f"new_num: {new_num}")
723
+ if int(num) <= (ser_len - 1):
724
+ num1.append(1)
725
+ lang = f"{ocr_id[mylist[int(num)]]}"
726
+ print(f"lang: {lang}")
727
+ out = model20(img,lang)
728
+ print (f'bounds: {out}')
729
+ try:
730
+ if float(out) > float(targ[0]):
731
+ targ[0] = out
732
+ targ_lang[0]=mylist[int(num)]
733
+ else:
734
+ pass
735
+ except Exception as e:
736
+ return f"Error:: {e}"
737
+ out_a = f'{mylist[int(num)]}: {out}'
738
+ else:
739
+ out_a = 'Done'
740
+ pass
741
+ out_p = f'{targ_lang[0]}: {targ[0]}'
742
+ return (out_a, out_p)
743
+ ###################################
744
+
745
+ def proc21(img):
746
+ rand = random.randint(1,3000)
747
+ time.sleep(rand/1000)
748
+ new_num=len(num1)-1
749
+ num = new_num
750
+ print (f"new_num: {new_num}")
751
+ if int(num) <= (ser_len - 1):
752
+ num1.append(1)
753
+ lang = f"{ocr_id[mylist[int(num)]]}"
754
+ print(f"lang: {lang}")
755
+ out = model21(img,lang)
756
+ print (f'bounds: {out}')
757
+ try:
758
+ if float(out) > float(targ[0]):
759
+ targ[0]=out
760
+ targ_lang[0]=mylist[int(num)]
761
+ else:
762
+ pass
763
+ out_a = f'{mylist[int(num)]}: {out}'
764
+
765
+ except Exception as e:
766
+ out_a = f"Error:: {e} :: {num}"
767
+ else:
768
+ out_a = 'Done'
769
+ pass
770
+ out_p = f'{targ_lang[0]}: {targ[0]}'
771
+ return (out_a, out_p)
772
+
773
+ def proc22(img):
774
+ rand = random.randint(1,3000)
775
+ time.sleep(rand/1000)
776
+ new_num=len(num1)-1
777
+ num = new_num
778
+ print (f"new_num: {new_num}")
779
+ if int(num) <= (ser_len - 1):
780
+ num1.append(1)
781
+ lang = f"{ocr_id[mylist[int(num)]]}"
782
+ print(f"lang: {lang}")
783
+ out = model22(img,lang)
784
+ print (f'bounds: {out}')
785
+ try:
786
+ if float(out) > float(targ[0]):
787
+ targ[0] = out
788
+ targ_lang[0]=mylist[int(num)]
789
+ else:
790
+ pass
791
+ out_a = f'{mylist[int(num)]}: {out}'
792
+ except Exception as e:
793
+ out_a = f"Error:: {e} :: {num}"
794
+ else:
795
+ out_a = 'Done'
796
+ pass
797
+ out_p = f'{targ_lang[0]}: {targ[0]}'
798
+ return (out_a, out_p)
799
+
800
+ def proc23(img):
801
+ rand = random.randint(1,3000)
802
+ time.sleep(rand/1000)
803
+ new_num=len(num1)-1
804
+ num = new_num
805
+ print (f"new_num: {new_num}")
806
+ if int(num) <= (ser_len - 1):
807
+ num1.append(1)
808
+ lang = f"{ocr_id[mylist[int(num)]]}"
809
+ print(f"lang: {lang}")
810
+ out = model23(img,lang)
811
+ print (f'bounds: {out}')
812
+ try:
813
+ if float(out) > float(targ[0]):
814
+ targ[0] = out
815
+ targ_lang[0]=mylist[int(num)]
816
+ else:
817
+ pass
818
+ out_a = f'{mylist[int(num)]}: {out}'
819
+
820
+ except Exception as e:
821
+ out_a = f"Error:: {e} :: {num}"
822
+ else:
823
+ out_a = 'Done'
824
+ pass
825
+ out_p = f'{targ_lang[0]}: {targ[0]}'
826
+ return (out_a, out_p)
827
+
828
+ def proc24(img):
829
+ rand = random.randint(1,3000)
830
+ time.sleep(rand/1000)
831
+ new_num=len(num1)-1
832
+ num = new_num
833
+ print (f"new_num: {new_num}")
834
+ if int(num) <= (ser_len - 1):
835
+ num1.append(1)
836
+ lang = f"{ocr_id[mylist[int(num)]]}"
837
+ print(f"lang: {lang}")
838
+ out = model24(img,lang)
839
+ print (f'bounds: {out}')
840
+ try:
841
+ if float(out) > float(targ[0]):
842
+ targ[0] = out
843
+ targ_lang[0]=mylist[int(num)]
844
+ else:
845
+ pass
846
+ out_a = f'{mylist[int(num)]}: {out}'
847
+
848
+ except Exception as e:
849
+ out_a = f"Error:: {e} :: {num}"
850
+ else:
851
+ out_a = 'Done'
852
+ pass
853
+ out_p = f'{targ_lang[0]}: {targ[0]}'
854
+ return (out_a, out_p)
855
+
856
+ def proc25(img):
857
+ rand = random.randint(1,3000)
858
+ time.sleep(rand/1000)
859
+ new_num=len(num1)-1
860
+ num = new_num
861
+ print (f"new_num: {new_num}")
862
+ if int(num) <= (ser_len - 1):
863
+ num1.append(1)
864
+ lang = f"{ocr_id[mylist[int(num)]]}"
865
+ print(f"lang: {lang}")
866
+ out = model25(img,lang)
867
+ print (f'bounds: {out}')
868
+ try:
869
+ if float(out) > float(targ[0]):
870
+ targ[0] = out
871
+ targ_lang[0]=mylist[int(num)]
872
+ else:
873
+ pass
874
+ except Exception as e:
875
+ return f"Error:: {e}"
876
+ out_a = f'{mylist[int(num)]}: {out}'
877
+ else:
878
+ out_a = 'Done'
879
+ pass
880
+ out_p = f'{targ_lang[0]}: {targ[0]}'
881
+ return (out_a, out_p)
882
+
883
+ def proc26(img):
884
+ rand = random.randint(1,3000)
885
+ time.sleep(rand/1000)
886
+ new_num=len(num1)-1
887
+ num = new_num
888
+ print (f"new_num: {new_num}")
889
+ if int(num) <= (ser_len - 1):
890
+ num1.append(1)
891
+ lang = f"{ocr_id[mylist[int(num)]]}"
892
+ print(f"lang: {lang}")
893
+ out = model26(img,lang)
894
+ print (f'bounds: {out}')
895
+ try:
896
+ if float(out) > float(targ[0]):
897
+ targ[0] = out
898
+ targ_lang[0]=mylist[int(num)]
899
+ else:
900
+ pass
901
+ except Exception as e:
902
+ return f"Error:: {e}"
903
+ out_a = f'{mylist[int(num)]}: {out}'
904
+ else:
905
+ out_a = 'Done'
906
+ pass
907
+ out_p = f'{targ_lang[0]}: {targ[0]}'
908
+ return (out_a, out_p)
909
+
910
+ def proc27(img):
911
+ rand = random.randint(1,3000)
912
+ time.sleep(rand/1000)
913
+ new_num=len(num1)-1
914
+ num = new_num
915
+ print (f"new_num: {new_num}")
916
+ if int(num) <= (ser_len - 1):
917
+ num1.append(1)
918
+ lang = f"{ocr_id[mylist[int(num)]]}"
919
+ print(f"lang: {lang}")
920
+ out = model27(img,lang)
921
+ print (f'bounds: {out}')
922
+ try:
923
+ if float(out) > float(targ[0]):
924
+ targ[0] = out
925
+ targ_lang[0]=mylist[int(num)]
926
+ else:
927
+ pass
928
+ except Exception as e:
929
+ return f"Error:: {e}"
930
+ out_a = f'{mylist[int(num)]}: {out}'
931
+ else:
932
+ out_a = 'Done'
933
+ pass
934
+ out_p = f'{targ_lang[0]}: {targ[0]}'
935
+ return (out_a, out_p)
936
+
937
+ def proc28(img):
938
+ rand = random.randint(1,3000)
939
+ time.sleep(rand/1000)
940
+ new_num=len(num1)-1
941
+ num = new_num
942
+ print (f"new_num: {new_num}")
943
+ if int(num) <= (ser_len - 1):
944
+ num1.append(1)
945
+ lang = f"{ocr_id[mylist[int(num)]]}"
946
+ print(f"lang: {lang}")
947
+ out = model28(img,lang)
948
+ print (f'bounds: {out}')
949
+ try:
950
+ if float(out) > float(targ[0]):
951
+ targ[0] = out
952
+ targ_lang[0]=mylist[int(num)]
953
+ else:
954
+ pass
955
+ except Exception as e:
956
+ return f"Error:: {e}"
957
+ out_a = f'{mylist[int(num)]}: {out}'
958
+ else:
959
+ out_a = 'Done'
960
+ pass
961
+ out_p = f'{targ_lang[0]}: {targ[0]}'
962
+ return (out_a, out_p)
963
+
964
+ def proc29(img):
965
+ rand = random.randint(1,3000)
966
+ time.sleep(rand/1000)
967
+ new_num=len(num1)-1
968
+ num = new_num
969
+ print (f"new_num: {new_num}")
970
+ if int(num) <= (ser_len - 1):
971
+ num1.append(1)
972
+ lang = f"{ocr_id[mylist[int(num)]]}"
973
+ print(f"lang: {lang}")
974
+ out = model29(img,lang)
975
+ print (f'bounds: {out}')
976
+ try:
977
+ if float(out) > float(targ[0]):
978
+ targ[0] = out
979
+ targ_lang[0]=mylist[int(num)]
980
+ else:
981
+ pass
982
+ except Exception as e:
983
+ return f"Error:: {e}"
984
+ out_a = f'{mylist[int(num)]}: {out}'
985
+ else:
986
+ out_a = 'Done'
987
+ pass
988
+ out_p = f'{targ_lang[0]}: {targ[0]}'
989
+ return (out_a, out_p)
990
+
991
+ def proc30(img):
992
+ rand = random.randint(1,3000)
993
+ time.sleep(rand/1000)
994
+ new_num=len(num1)-1
995
+ num = new_num
996
+ print (f"new_num: {new_num}")
997
+ if int(num) <= (ser_len - 1):
998
+ num1.append(1)
999
+ lang = f"{ocr_id[mylist[int(num)]]}"
1000
+ print(f"lang: {lang}")
1001
+ out = model10(img,lang)
1002
+ print (f'bounds: {out}')
1003
+ try:
1004
+ if float(out) > float(targ[0]):
1005
+ targ[0] = out
1006
+ targ_lang[0]=mylist[int(num)]
1007
+ else:
1008
+ pass
1009
+ except Exception as e:
1010
+ return f"Error:: {e}"
1011
+ out_a = f'{mylist[int(num)]}: {out}'
1012
+ else:
1013
+ out_a = 'Done'
1014
+ pass
1015
+ out_p = f'{targ_lang[0]}: {targ[0]}'
1016
+ return (out_a, out_p)
1017
+ ##################
1018
+
1019
+ def proc31(img):
1020
+ rand = random.randint(1,3000)
1021
+ time.sleep(rand/1000)
1022
+ new_num=len(num1)-1
1023
+ num = new_num
1024
+ print (f"new_num: {new_num}")
1025
+ if int(num) <= (ser_len - 1):
1026
+ num1.append(1)
1027
+ lang = f"{ocr_id[mylist[int(num)]]}"
1028
+ print(f"lang: {lang}")
1029
+ out = model31(img,lang)
1030
+ print (f'bounds: {out}')
1031
+ try:
1032
+ if float(out) > float(targ[0]):
1033
+ targ[0]=out
1034
+ targ_lang[0]=mylist[int(num)]
1035
+ else:
1036
+ pass
1037
+ out_a = f'{mylist[int(num)]}: {out}'
1038
+
1039
+ except Exception as e:
1040
+ out_a = f"Error:: {e} :: {num}"
1041
+ else:
1042
+ out_a = 'Done'
1043
+ pass
1044
+ out_p = f'{targ_lang[0]}: {targ[0]}'
1045
+ return (out_a, out_p)
1046
+
1047
+ def proc32(img):
1048
+ rand = random.randint(1,3000)
1049
+ time.sleep(rand/1000)
1050
+ new_num=len(num1)-1
1051
+ num = new_num
1052
+ print (f"new_num: {new_num}")
1053
+ if int(num) <= (ser_len - 1):
1054
+ num1.append(1)
1055
+ lang = f"{ocr_id[mylist[int(num)]]}"
1056
+ print(f"lang: {lang}")
1057
+ out = model32(img,lang)
1058
+ print (f'bounds: {out}')
1059
+ try:
1060
+ if float(out) > float(targ[0]):
1061
+ targ[0] = out
1062
+ targ_lang[0]=mylist[int(num)]
1063
+ else:
1064
+ pass
1065
+ out_a = f'{mylist[int(num)]}: {out}'
1066
+ except Exception as e:
1067
+ out_a = f"Error:: {e} :: {num}"
1068
+ else:
1069
+ out_a = 'Done'
1070
+ pass
1071
+ out_p = f'{targ_lang[0]}: {targ[0]}'
1072
+ return (out_a, out_p)
1073
+
1074
+ def proc33(img):
1075
+ rand = random.randint(1,3000)
1076
+ time.sleep(rand/1000)
1077
+ new_num=len(num1)-1
1078
+ num = new_num
1079
+ print (f"new_num: {new_num}")
1080
+ if int(num) <= (ser_len - 1):
1081
+ num1.append(1)
1082
+ lang = f"{ocr_id[mylist[int(num)]]}"
1083
+ print(f"lang: {lang}")
1084
+ out = model33(img,lang)
1085
+ print (f'bounds: {out}')
1086
+ try:
1087
+ if float(out) > float(targ[0]):
1088
+ targ[0] = out
1089
+ targ_lang[0]=mylist[int(num)]
1090
+ else:
1091
+ pass
1092
+ out_a = f'{mylist[int(num)]}: {out}'
1093
+
1094
+ except Exception as e:
1095
+ out_a = f"Error:: {e} :: {num}"
1096
+ else:
1097
+ out_a = 'Done'
1098
+ pass
1099
+ out_p = f'{targ_lang[0]}: {targ[0]}'
1100
+ return (out_a, out_p)
1101
+
1102
+ def proc34(img):
1103
+ rand = random.randint(1,3000)
1104
+ time.sleep(rand/1000)
1105
+ new_num=len(num1)-1
1106
+ num = new_num
1107
+ print (f"new_num: {new_num}")
1108
+ if int(num) <= (ser_len - 1):
1109
+ num1.append(1)
1110
+ lang = f"{ocr_id[mylist[int(num)]]}"
1111
+ print(f"lang: {lang}")
1112
+ out = model34(img,lang)
1113
+ print (f'bounds: {out}')
1114
+ try:
1115
+ if float(out) > float(targ[0]):
1116
+ targ[0] = out
1117
+ targ_lang[0]=mylist[int(num)]
1118
+ else:
1119
+ pass
1120
+ out_a = f'{mylist[int(num)]}: {out}'
1121
+
1122
+ except Exception as e:
1123
+ out_a = f"Error:: {e} :: {num}"
1124
+ else:
1125
+ out_a = 'Done'
1126
+ pass
1127
+ out_p = f'{targ_lang[0]}: {targ[0]}'
1128
+ return (out_a, out_p)
1129
+
1130
+ def proc35(img):
1131
+ rand = random.randint(1,3000)
1132
+ time.sleep(rand/1000)
1133
+ new_num=len(num1)-1
1134
+ num = new_num
1135
+ print (f"new_num: {new_num}")
1136
+ if int(num) <= (ser_len - 1):
1137
+ num1.append(1)
1138
+ lang = f"{ocr_id[mylist[int(num)]]}"
1139
+ print(f"lang: {lang}")
1140
+ out = model35(img,lang)
1141
+ print (f'bounds: {out}')
1142
+ try:
1143
+ if float(out) > float(targ[0]):
1144
+ targ[0] = out
1145
+ targ_lang[0]=mylist[int(num)]
1146
+ else:
1147
+ pass
1148
+ except Exception as e:
1149
+ return f"Error:: {e}"
1150
+ out_a = f'{mylist[int(num)]}: {out}'
1151
+ else:
1152
+ out_a = 'Done'
1153
+ pass
1154
+ out_p = f'{targ_lang[0]}: {targ[0]}'
1155
+ return (out_a, out_p)
1156
+
1157
+ def proc36(img):
1158
+ rand = random.randint(1,3000)
1159
+ time.sleep(rand/1000)
1160
+ new_num=len(num1)-1
1161
+ num = new_num
1162
+ print (f"new_num: {new_num}")
1163
+ if int(num) <= (ser_len - 1):
1164
+ num1.append(1)
1165
+ lang = f"{ocr_id[mylist[int(num)]]}"
1166
+ print(f"lang: {lang}")
1167
+ out = model36(img,lang)
1168
+ print (f'bounds: {out}')
1169
+ try:
1170
+ if float(out) > float(targ[0]):
1171
+ targ[0] = out
1172
+ targ_lang[0]=mylist[int(num)]
1173
+ else:
1174
+ pass
1175
+ except Exception as e:
1176
+ return f"Error:: {e}"
1177
+ out_a = f'{mylist[int(num)]}: {out}'
1178
+ else:
1179
+ out_a = 'Done'
1180
+ pass
1181
+ out_p = f'{targ_lang[0]}: {targ[0]}'
1182
+ return (out_a, out_p)
1183
+
1184
+ def proc37(img):
1185
+ rand = random.randint(1,3000)
1186
+ time.sleep(rand/1000)
1187
+ new_num=len(num1)-1
1188
+ num = new_num
1189
+ print (f"new_num: {new_num}")
1190
+ if int(num) <= (ser_len - 1):
1191
+ num1.append(1)
1192
+ lang = f"{ocr_id[mylist[int(num)]]}"
1193
+ print(f"lang: {lang}")
1194
+ out = model37(img,lang)
1195
+ print (f'bounds: {out}')
1196
+ try:
1197
+ if float(out) > float(targ[0]):
1198
+ targ[0] = out
1199
+ targ_lang[0]=mylist[int(num)]
1200
+ else:
1201
+ pass
1202
+ except Exception as e:
1203
+ return f"Error:: {e}"
1204
+ out_a = f'{mylist[int(num)]}: {out}'
1205
+ else:
1206
+ out_a = 'Done'
1207
+ pass
1208
+ out_p = f'{targ_lang[0]}: {targ[0]}'
1209
+ return (out_a, out_p)
1210
+
1211
+ def proc38(img):
1212
+ rand = random.randint(1,3000)
1213
+ time.sleep(rand/1000)
1214
+ new_num=len(num1)-1
1215
+ num = new_num
1216
+ print (f"new_num: {new_num}")
1217
+ if int(num) <= (ser_len - 1):
1218
+ num1.append(1)
1219
+ lang = f"{ocr_id[mylist[int(num)]]}"
1220
+ print(f"lang: {lang}")
1221
+ out = model38(img,lang)
1222
+ print (f'bounds: {out}')
1223
+ try:
1224
+ if float(out) > float(targ[0]):
1225
+ targ[0] = out
1226
+ targ_lang[0]=mylist[int(num)]
1227
+ else:
1228
+ pass
1229
+ except Exception as e:
1230
+ return f"Error:: {e}"
1231
+ out_a = f'{mylist[int(num)]}: {out}'
1232
+ else:
1233
+ out_a = 'Done'
1234
+ pass
1235
+ out_p = f'{targ_lang[0]}: {targ[0]}'
1236
+ return (out_a, out_p)
1237
+
1238
+ def proc39(img):
1239
+ rand = random.randint(1,3000)
1240
+ time.sleep(rand/1000)
1241
+ new_num=len(num1)-1
1242
+ num = new_num
1243
+ print (f"new_num: {new_num}")
1244
+ if int(num) <= (ser_len - 1):
1245
+ num1.append(1)
1246
+ lang = f"{ocr_id[mylist[int(num)]]}"
1247
+ print(f"lang: {lang}")
1248
+ out = model39(img,lang)
1249
+ print (f'bounds: {out}')
1250
+ try:
1251
+ if float(out) > float(targ[0]):
1252
+ targ[0] = out
1253
+ targ_lang[0]=mylist[int(num)]
1254
+ else:
1255
+ pass
1256
+ except Exception as e:
1257
+ return f"Error:: {e}"
1258
+ out_a = f'{mylist[int(num)]}: {out}'
1259
+ else:
1260
+ out_a = 'Done'
1261
+ pass
1262
+ out_p = f'{targ_lang[0]}: {targ[0]}'
1263
+ return (out_a, out_p)
1264
+
1265
+ def proc40(img):
1266
+ rand = random.randint(1,3000)
1267
+ time.sleep(rand/1000)
1268
+ new_num=len(num1)-1
1269
+ num = new_num
1270
+ print (f"new_num: {new_num}")
1271
+ if int(num) <= (ser_len - 1):
1272
+ num1.append(1)
1273
+ lang = f"{ocr_id[mylist[int(num)]]}"
1274
+ print(f"lang: {lang}")
1275
+ out = model40(img,lang)
1276
+ print (f'bounds: {out}')
1277
+ try:
1278
+ if float(out) > float(targ[0]):
1279
+ targ[0] = out
1280
+ targ_lang[0]=mylist[int(num)]
1281
+ else:
1282
+ pass
1283
+ except Exception as e:
1284
+ return f"Error:: {e}"
1285
+ out_a = f'{mylist[int(num)]}: {out}'
1286
+ else:
1287
+ out_a = 'Done'
1288
+ pass
1289
+ out_p = f'{targ_lang[0]}: {targ[0]}'
1290
+ return (out_a, out_p)
1291
+ ##################
1292
+
1293
+ def proc41(img):
1294
+ rand = random.randint(1,3000)
1295
+ time.sleep(rand/1000)
1296
+ new_num=len(num1)-1
1297
+ num = new_num
1298
+ print (f"new_num: {new_num}")
1299
+ if int(num) <= (ser_len - 1):
1300
+ num1.append(1)
1301
+ lang = f"{ocr_id[mylist[int(num)]]}"
1302
+ print(f"lang: {lang}")
1303
+ out = model41(img,lang)
1304
+ print (f'bounds: {out}')
1305
+ try:
1306
+ if float(out) > float(targ[0]):
1307
+ targ[0]=out
1308
+ targ_lang[0]=mylist[int(num)]
1309
+ else:
1310
+ pass
1311
+ out_a = f'{mylist[int(num)]}: {out}'
1312
+
1313
+ except Exception as e:
1314
+ out_a = f"Error:: {e} :: {num}"
1315
+ else:
1316
+ out_a = 'Done'
1317
+ pass
1318
+ out_p = f'{targ_lang[0]}: {targ[0]}'
1319
+ return (out_a, out_p)
1320
+
1321
+ def proc42(img):
1322
+ rand = random.randint(1,3000)
1323
+ time.sleep(rand/1000)
1324
+ new_num=len(num1)-1
1325
+ num = new_num
1326
+ print (f"new_num: {new_num}")
1327
+ if int(num) <= (ser_len - 1):
1328
+ num1.append(1)
1329
+ lang = f"{ocr_id[mylist[int(num)]]}"
1330
+ print(f"lang: {lang}")
1331
+ out = model42(img,lang)
1332
+ print (f'bounds: {out}')
1333
+ try:
1334
+ if float(out) > float(targ[0]):
1335
+ targ[0] = out
1336
+ targ_lang[0]=mylist[int(num)]
1337
+ else:
1338
+ pass
1339
+ out_a = f'{mylist[int(num)]}: {out}'
1340
+ except Exception as e:
1341
+ out_a = f"Error:: {e} :: {num}"
1342
+ else:
1343
+ out_a = 'Done'
1344
+ pass
1345
+ out_p = f'{targ_lang[0]}: {targ[0]}'
1346
+ return (out_a, out_p)
1347
+
1348
+ def proc43(img):
1349
+ rand = random.randint(1,3000)
1350
+ time.sleep(rand/1000)
1351
+ new_num=len(num1)-1
1352
+ num = new_num
1353
+ print (f"new_num: {new_num}")
1354
+ if int(num) <= (ser_len - 1):
1355
+ num1.append(1)
1356
+ lang = f"{ocr_id[mylist[int(num)]]}"
1357
+ print(f"lang: {lang}")
1358
+ out = model43(img,lang)
1359
+ print (f'bounds: {out}')
1360
+ try:
1361
+ if float(out) > float(targ[0]):
1362
+ targ[0] = out
1363
+ targ_lang[0]=mylist[int(num)]
1364
+ else:
1365
+ pass
1366
+ out_a = f'{mylist[int(num)]}: {out}'
1367
+
1368
+ except Exception as e:
1369
+ out_a = f"Error:: {e} :: {num}"
1370
+ else:
1371
+ out_a = 'Done'
1372
+ pass
1373
+ out_p = f'{targ_lang[0]}: {targ[0]}'
1374
+ return (out_a, out_p)
1375
+
1376
+ def proc44(img):
1377
+ rand = random.randint(1,3000)
1378
+ time.sleep(rand/1000)
1379
+ new_num=len(num1)-1
1380
+ num = new_num
1381
+ print (f"new_num: {new_num}")
1382
+ if int(num) <= (ser_len - 1):
1383
+ num1.append(1)
1384
+ lang = f"{ocr_id[mylist[int(num)]]}"
1385
+ print(f"lang: {lang}")
1386
+ out = model44(img,lang)
1387
+ print (f'bounds: {out}')
1388
+ try:
1389
+ if float(out) > float(targ[0]):
1390
+ targ[0] = out
1391
+ targ_lang[0]=mylist[int(num)]
1392
+ else:
1393
+ pass
1394
+ out_a = f'{mylist[int(num)]}: {out}'
1395
+
1396
+ except Exception as e:
1397
+ out_a = f"Error:: {e} :: {num}"
1398
+ else:
1399
+ out_a = 'Done'
1400
+ pass
1401
+ out_p = f'{targ_lang[0]}: {targ[0]}'
1402
+ return (out_a, out_p)
1403
+
1404
+ def proc45(img):
1405
+ rand = random.randint(1,3000)
1406
+ time.sleep(rand/1000)
1407
+ new_num=len(num1)-1
1408
+ num = new_num
1409
+ print (f"new_num: {new_num}")
1410
+ if int(num) <= (ser_len - 1):
1411
+ num1.append(1)
1412
+ lang = f"{ocr_id[mylist[int(num)]]}"
1413
+ print(f"lang: {lang}")
1414
+ out = model45(img,lang)
1415
+ print (f'bounds: {out}')
1416
+ try:
1417
+ if float(out) > float(targ[0]):
1418
+ targ[0] = out
1419
+ targ_lang[0]=mylist[int(num)]
1420
+ else:
1421
+ pass
1422
+ except Exception as e:
1423
+ return f"Error:: {e}"
1424
+ out_a = f'{mylist[int(num)]}: {out}'
1425
+ else:
1426
+ out_a = 'Done'
1427
+ pass
1428
+ out_p = f'{targ_lang[0]}: {targ[0]}'
1429
+ return (out_a, out_p)
1430
 
1431
+ def proc46(img):
1432
+ rand = random.randint(1,3000)
1433
+ time.sleep(rand/1000)
1434
+ new_num=len(num1)-1
1435
+ num = new_num
1436
+ print (f"new_num: {new_num}")
1437
+ if int(num) <= (ser_len - 1):
1438
+ num1.append(1)
1439
+ lang = f"{ocr_id[mylist[int(num)]]}"
1440
+ print(f"lang: {lang}")
1441
+ out = model46(img,lang)
1442
+ print (f'bounds: {out}')
1443
+ try:
1444
+ if float(out) > float(targ[0]):
1445
+ targ[0] = out
1446
+ targ_lang[0]=mylist[int(num)]
1447
+ else:
1448
+ pass
1449
+ except Exception as e:
1450
+ return f"Error:: {e}"
1451
+ out_a = f'{mylist[int(num)]}: {out}'
1452
+ else:
1453
+ out_a = 'Done'
1454
+ pass
1455
+ out_p = f'{targ_lang[0]}: {targ[0]}'
1456
+ return (out_a, out_p)
1457
+
1458
+ def proc47(img):
1459
+ rand = random.randint(1,3000)
1460
+ time.sleep(rand/1000)
1461
+ new_num=len(num1)-1
1462
+ num = new_num
1463
+ print (f"new_num: {new_num}")
1464
+ if int(num) <= (ser_len - 1):
1465
+ num1.append(1)
1466
+ lang = f"{ocr_id[mylist[int(num)]]}"
1467
+ print(f"lang: {lang}")
1468
+ out = model47(img,lang)
1469
+ print (f'bounds: {out}')
1470
+ try:
1471
+ if float(out) > float(targ[0]):
1472
+ targ[0] = out
1473
+ targ_lang[0]=mylist[int(num)]
1474
+ else:
1475
+ pass
1476
+ except Exception as e:
1477
+ return f"Error:: {e}"
1478
+ out_a = f'{mylist[int(num)]}: {out}'
1479
+ else:
1480
+ out_a = 'Done'
1481
+ pass
1482
+ out_p = f'{targ_lang[0]}: {targ[0]}'
1483
+ return (out_a, out_p)
1484
+
1485
+ def proc48(img):
1486
+ rand = random.randint(1,3000)
1487
+ time.sleep(rand/1000)
1488
+ new_num=len(num1)-1
1489
+ num = new_num
1490
+ print (f"new_num: {new_num}")
1491
+ if int(num) <= (ser_len - 1):
1492
+ num1.append(1)
1493
+ lang = f"{ocr_id[mylist[int(num)]]}"
1494
+ print(f"lang: {lang}")
1495
+ out = model48(img,lang)
1496
+ print (f'bounds: {out}')
1497
+ try:
1498
+ if float(out) > float(targ[0]):
1499
+ targ[0] = out
1500
+ targ_lang[0]=mylist[int(num)]
1501
+ else:
1502
+ pass
1503
+ except Exception as e:
1504
+ return f"Error:: {e}"
1505
+ out_a = f'{mylist[int(num)]}: {out}'
1506
+ else:
1507
+ out_a = 'Done'
1508
+ pass
1509
+ out_p = f'{targ_lang[0]}: {targ[0]}'
1510
+ return (out_a, out_p)
1511
+
1512
+ def proc49(img):
1513
+ rand = random.randint(1,3000)
1514
+ time.sleep(rand/1000)
1515
+ new_num=len(num1)-1
1516
+ num = new_num
1517
+ print (f"new_num: {new_num}")
1518
+ if int(num) <= (ser_len - 1):
1519
+ num1.append(1)
1520
+ lang = f"{ocr_id[mylist[int(num)]]}"
1521
+ print(f"lang: {lang}")
1522
+ out = model9(img,lang)
1523
+ print (f'bounds: {out}')
1524
+ try:
1525
+ if float(out) > float(targ[0]):
1526
+ targ[0] = out
1527
+ targ_lang[0]=mylist[int(num)]
1528
+ else:
1529
+ pass
1530
+ except Exception as e:
1531
+ return f"Error:: {e}"
1532
+ out_a = f'{mylist[int(num)]}: {out}'
1533
+ else:
1534
+ out_a = 'Done'
1535
+ pass
1536
+ out_p = f'{targ_lang[0]}: {targ[0]}'
1537
+ return (out_a, out_p)
1538
+
1539
+ def proc50(img):
1540
+ rand = random.randint(1,3000)
1541
+ time.sleep(rand/1000)
1542
+ new_num=len(num1)-1
1543
+ num = new_num
1544
+ print (f"new_num: {new_num}")
1545
+ if int(num) <= (ser_len - 1):
1546
+ num1.append(1)
1547
+ lang = f"{ocr_id[mylist[int(num)]]}"
1548
+ print(f"lang: {lang}")
1549
+ out = model10(img,lang)
1550
+ print (f'bounds: {out}')
1551
+ try:
1552
+ if float(out) > float(targ[0]):
1553
+ targ[0] = out
1554
+ targ_lang[0]=mylist[int(num)]
1555
+ else:
1556
+ pass
1557
+ except Exception as e:
1558
+ return f"Error:: {e}"
1559
+ out_a = f'{mylist[int(num)]}: {out}'
1560
+ else:
1561
+ out_a = 'Done'
1562
+ pass
1563
+ out_p = f'{targ_lang[0]}: {targ[0]}'
1564
+ return (out_a, out_p)
1565
+ ##################
1566
 
 
1567
  def proc1(img):
1568
  rand = random.randint(1,3000)
1569
  time.sleep(rand/1000)
 
1837
  out_p = f'{targ_lang[0]}: {targ[0]}'
1838
  return (out_a, out_p)
1839
  ##################
1840
+
1841
+ def proc1(img):
1842
  rand = random.randint(1,3000)
1843
+ time.sleep(rand/1000)
1844
  new_num=len(num1)-1
1845
  num = new_num
1846
  print (f"new_num: {new_num}")
 
1848
  num1.append(1)
1849
  lang = f"{ocr_id[mylist[int(num)]]}"
1850
  print(f"lang: {lang}")
1851
+ out = model1(img,lang)
1852
  print (f'bounds: {out}')
1853
  try:
1854
  if float(out) > float(targ[0]):
 
1866
  out_p = f'{targ_lang[0]}: {targ[0]}'
1867
  return (out_a, out_p)
1868
 
1869
+ def proc2(img):
1870
  rand = random.randint(1,3000)
1871
+ time.sleep(rand/1000)
1872
  new_num=len(num1)-1
1873
  num = new_num
1874
  print (f"new_num: {new_num}")
 
1876
  num1.append(1)
1877
  lang = f"{ocr_id[mylist[int(num)]]}"
1878
  print(f"lang: {lang}")
1879
+ out = model2(img,lang)
1880
  print (f'bounds: {out}')
1881
  try:
1882
  if float(out) > float(targ[0]):
 
1893
  out_p = f'{targ_lang[0]}: {targ[0]}'
1894
  return (out_a, out_p)
1895
 
1896
+ def proc3(img):
1897
  rand = random.randint(1,3000)
1898
+ time.sleep(rand/1000)
1899
  new_num=len(num1)-1
1900
  num = new_num
1901
  print (f"new_num: {new_num}")
 
1903
  num1.append(1)
1904
  lang = f"{ocr_id[mylist[int(num)]]}"
1905
  print(f"lang: {lang}")
1906
+ out = model3(img,lang)
1907
  print (f'bounds: {out}')
1908
  try:
1909
  if float(out) > float(targ[0]):
 
1921
  out_p = f'{targ_lang[0]}: {targ[0]}'
1922
  return (out_a, out_p)
1923
 
1924
+ def proc4(img):
1925
  rand = random.randint(1,3000)
1926
+ time.sleep(rand/1000)
1927
  new_num=len(num1)-1
1928
  num = new_num
1929
  print (f"new_num: {new_num}")
 
1931
  num1.append(1)
1932
  lang = f"{ocr_id[mylist[int(num)]]}"
1933
  print(f"lang: {lang}")
1934
+ out = model4(img,lang)
1935
  print (f'bounds: {out}')
1936
  try:
1937
  if float(out) > float(targ[0]):
 
1949
  out_p = f'{targ_lang[0]}: {targ[0]}'
1950
  return (out_a, out_p)
1951
 
1952
+ def proc5(img):
1953
  rand = random.randint(1,3000)
1954
+ time.sleep(rand/1000)
1955
  new_num=len(num1)-1
1956
  num = new_num
1957
  print (f"new_num: {new_num}")
 
1959
  num1.append(1)
1960
  lang = f"{ocr_id[mylist[int(num)]]}"
1961
  print(f"lang: {lang}")
1962
+ out = model5(img,lang)
1963
  print (f'bounds: {out}')
1964
  try:
1965
  if float(out) > float(targ[0]):
 
1976
  out_p = f'{targ_lang[0]}: {targ[0]}'
1977
  return (out_a, out_p)
1978
 
1979
+ def proc6(img):
1980
  rand = random.randint(1,3000)
1981
  time.sleep(rand/1000)
1982
  new_num=len(num1)-1
 
1986
  num1.append(1)
1987
  lang = f"{ocr_id[mylist[int(num)]]}"
1988
  print(f"lang: {lang}")
1989
+ out = model6(img,lang)
1990
  print (f'bounds: {out}')
1991
  try:
1992
  if float(out) > float(targ[0]):
 
2003
  out_p = f'{targ_lang[0]}: {targ[0]}'
2004
  return (out_a, out_p)
2005
 
2006
+ def proc7(img):
2007
  rand = random.randint(1,3000)
2008
  time.sleep(rand/1000)
2009
  new_num=len(num1)-1
 
2013
  num1.append(1)
2014
  lang = f"{ocr_id[mylist[int(num)]]}"
2015
  print(f"lang: {lang}")
2016
+ out = model7(img,lang)
2017
  print (f'bounds: {out}')
2018
  try:
2019
  if float(out) > float(targ[0]):
 
2030
  out_p = f'{targ_lang[0]}: {targ[0]}'
2031
  return (out_a, out_p)
2032
 
2033
+ def proc8(img):
2034
  rand = random.randint(1,3000)
2035
  time.sleep(rand/1000)
2036
  new_num=len(num1)-1
 
2040
  num1.append(1)
2041
  lang = f"{ocr_id[mylist[int(num)]]}"
2042
  print(f"lang: {lang}")
2043
+ out = model8(img,lang)
2044
  print (f'bounds: {out}')
2045
  try:
2046
  if float(out) > float(targ[0]):
 
2057
  out_p = f'{targ_lang[0]}: {targ[0]}'
2058
  return (out_a, out_p)
2059
 
2060
+ def proc9(img):
2061
  rand = random.randint(1,3000)
2062
  time.sleep(rand/1000)
2063
  new_num=len(num1)-1
 
2067
  num1.append(1)
2068
  lang = f"{ocr_id[mylist[int(num)]]}"
2069
  print(f"lang: {lang}")
2070
+ out = model9(img,lang)
2071
  print (f'bounds: {out}')
2072
  try:
2073
  if float(out) > float(targ[0]):
 
2084
  out_p = f'{targ_lang[0]}: {targ[0]}'
2085
  return (out_a, out_p)
2086
 
2087
+ def proc10(img):
2088
  rand = random.randint(1,3000)
2089
  time.sleep(rand/1000)
2090
  new_num=len(num1)-1
 
2094
  num1.append(1)
2095
  lang = f"{ocr_id[mylist[int(num)]]}"
2096
  print(f"lang: {lang}")
2097
+ out = model10(img,lang)
2098
  print (f'bounds: {out}')
2099
  try:
2100
  if float(out) > float(targ[0]):
 
2110
  pass
2111
  out_p = f'{targ_lang[0]}: {targ[0]}'
2112
  return (out_a, out_p)
2113
+ ##################
2114
 
2115
 
2116
  with gr.Blocks() as app:
 
2166
  det_btn.click(proc19,[im],[out19,prob_lang], show_progress=False)
2167
  det_btn.click(proc20,[im],[out20,prob_lang], show_progress=False)
2168
 
2169
+ det_btn.click(proc21,[im],[out21,prob_lang], show_progress=False)
2170
+ det_btn.click(proc22,[im],[out22,prob_lang], show_progress=False)
2171
+ det_btn.click(proc23,[im],[out23,prob_lang], show_progress=False)
2172
+ det_btn.click(proc24,[im],[out24,prob_lang], show_progress=False)
2173
+ det_btn.click(proc25,[im],[out25,prob_lang], show_progress=False)
2174
+ det_btn.click(proc26,[im],[out26,prob_lang], show_progress=False)
2175
+ det_btn.click(proc27,[im],[out27,prob_lang], show_progress=False)
2176
+ det_btn.click(proc28,[im],[out28,prob_lang], show_progress=False)
2177
+ det_btn.click(proc29,[im],[out29,prob_lang], show_progress=False)
2178
+ det_btn.click(proc30,[im],[out30,prob_lang], show_progress=False)
2179
+
2180
+ det_btn.click(proc31,[im],[out31,prob_lang], show_progress=False)
2181
+ det_btn.click(proc32,[im],[out32,prob_lang], show_progress=False)
2182
+ det_btn.click(proc33,[im],[out33,prob_lang], show_progress=False)
2183
+ det_btn.click(proc34,[im],[out34,prob_lang], show_progress=False)
2184
+ det_btn.click(proc35,[im],[out35,prob_lang], show_progress=False)
2185
+ det_btn.click(proc36,[im],[out36,prob_lang], show_progress=False)
2186
+ det_btn.click(proc37,[im],[out37,prob_lang], show_progress=False)
2187
+ det_btn.click(proc38,[im],[out38,prob_lang], show_progress=False)
2188
+ det_btn.click(proc39,[im],[out39,prob_lang], show_progress=False)
2189
+ det_btn.click(proc40,[im],[out40,prob_lang], show_progress=False)
2190
+
2191
+ det_btn.click(proc41,[im],[out41,prob_lang], show_progress=False)
2192
+ det_btn.click(proc42,[im],[out42,prob_lang], show_progress=False)
2193
+ det_btn.click(proc43,[im],[out43,prob_lang], show_progress=False)
2194
+ det_btn.click(proc44,[im],[out44,prob_lang], show_progress=False)
2195
+ det_btn.click(proc45,[im],[out45,prob_lang], show_progress=False)
2196
+ det_btn.click(proc46,[im],[out46,prob_lang], show_progress=False)
2197
+ det_btn.click(proc47,[im],[out47,prob_lang], show_progress=False)
2198
+ det_btn.click(proc48,[im],[out48,prob_lang], show_progress=False)
2199
+ det_btn.click(proc49,[im],[out49,prob_lang], show_progress=False)
2200
+ det_btn.click(proc50,[im],[out50,prob_lang], show_progress=False)
2201
 
2202
  out1.change(proc1,[im],[out1,prob_lang], show_progress=False)
2203
  out2.change(proc2,[im],[out2,prob_lang], show_progress=False)