Spaces:
Runtime error
Runtime error
| import gradio as gr | |
| import easyocr | |
| import numpy as np | |
| from PIL import Image | |
| import uuid | |
| import random | |
| import time | |
| uid=uuid.uuid4() | |
| ocr_id = { | |
| "Afrikaans": "af", | |
| "Albanian": "sq", | |
| "Arabic": "ar", | |
| "Azerbaijani": "az", | |
| "Belarusian": "be", | |
| "Bulgarian": "bg", | |
| "Bengali": "bn", | |
| "Bosnian": "bs", | |
| "Chinese (simplified)": "ch_sim", | |
| "Chinese (traditional)": "ch_tra", | |
| "Croatian": "hr", | |
| "Czech": "cs", | |
| "Danish": "da", | |
| "Dutch": "nl", | |
| "English": "en", | |
| "Estonian": "et", | |
| "French": "fr", | |
| "German": "de", | |
| "Irish": "ga", | |
| "Hindi": "hi", | |
| "Hungarian": "hu", | |
| "Indonesian": "id", | |
| "Icelandic": "is", | |
| "Italian": "it", | |
| "Japanese": "ja", | |
| "Kannada": "kn", | |
| "Korean": "ko", | |
| "Lithuanian": "lt", | |
| "Latvian": "lv", | |
| "Mongolian": "mn", | |
| "Marathi": "mr", | |
| "Malay": "ms", | |
| "Nepali": "ne", | |
| "Norwegian": "no", | |
| "Occitan": "oc", | |
| "Polish": "pl", | |
| "Portuguese": "pt", | |
| "Romanian": "ro", | |
| "Russian": "ru", | |
| "Serbian (cyrillic)": "rs_cyrillic", | |
| "Serbian (latin)": "rs_latin", | |
| "Slovak": "sk", | |
| "Slovenian": "sl", | |
| "Spanish": "es", | |
| "Swedish": "sv", | |
| "Swahili": "sw", | |
| "Tamil": "ta", | |
| "Thai": "th", | |
| "Tagalog": "tl", | |
| "Turkish": "tr", | |
| "Ukrainian": "uk", | |
| "Urdu": "ur", | |
| "Uzbek": "uz", | |
| "Vietnamese": "vi", | |
| "Welsh": "cy", | |
| "Zulu": "zu", | |
| } | |
| model1 = gr.Interface.load("spaces/Omnibus/detect-language-ocr") | |
| model2 = gr.Interface.load("spaces/Omnibus/detect-language-ocr") | |
| model3 = gr.Interface.load("spaces/Omnibus/detect-language-ocr") | |
| model4 = gr.Interface.load("spaces/Omnibus/detect-language-ocr") | |
| model5 = gr.Interface.load("spaces/Omnibus/detect-language-ocr") | |
| model6 = gr.Interface.load("spaces/Omnibus/detect-language-ocr") | |
| model7 = gr.Interface.load("spaces/Omnibus/detect-language-ocr") | |
| model8 = gr.Interface.load("spaces/Omnibus/detect-language-ocr") | |
| model9 = gr.Interface.load("spaces/Omnibus/detect-language-ocr") | |
| model10 = gr.Interface.load("spaces/Omnibus/detect-language-ocr") | |
| model11 = gr.Interface.load("spaces/Omnibus/detect-language-ocr") | |
| model12 = gr.Interface.load("spaces/Omnibus/detect-language-ocr") | |
| model13 = gr.Interface.load("spaces/Omnibus/detect-language-ocr") | |
| model14 = gr.Interface.load("spaces/Omnibus/detect-language-ocr") | |
| model15 = gr.Interface.load("spaces/Omnibus/detect-language-ocr") | |
| model16 = gr.Interface.load("spaces/Omnibus/detect-language-ocr") | |
| model17 = gr.Interface.load("spaces/Omnibus/detect-language-ocr") | |
| model18 = gr.Interface.load("spaces/Omnibus/detect-language-ocr") | |
| model19 = gr.Interface.load("spaces/Omnibus/detect-language-ocr") | |
| model20 = gr.Interface.load("spaces/Omnibus/detect-language-ocr") | |
| mylist = [] | |
| myval = [] | |
| for key in ocr_id.keys(): | |
| mylist.append(key) | |
| ser_len=len(ocr_id) | |
| def set_targ(): | |
| targ = 0 | |
| return targ | |
| num1 = [] | |
| targ = [] | |
| targ_lang=[] | |
| def proc0(img): | |
| num1.clear() | |
| num1.append(0) | |
| targ.clear() | |
| targ.append(0) | |
| targ_lang.clear() | |
| targ_lang.append(mylist[0]) | |
| print ("LISTS CLEARED") | |
| #def main_proc() | |
| def proc1(img): | |
| rand = random.randint(1,3000) | |
| time.sleep(rand/1000) | |
| new_num=len(num1)-1 | |
| num = new_num | |
| print (f"new_num: {new_num}") | |
| if int(num) <= (ser_len - 1): | |
| num1.append(1) | |
| lang = f"{ocr_id[mylist[int(num)]]}" | |
| print(f"lang: {lang}") | |
| out = model1(img,lang) | |
| print (f'bounds: {out}') | |
| try: | |
| if float(out) > float(targ[0]): | |
| targ[0]=out | |
| targ_lang[0]=mylist[int(num)] | |
| else: | |
| pass | |
| out_a = f'{mylist[int(num)]}: {out}' | |
| except Exception as e: | |
| out_a = f"Error:: {e} :: {num}" | |
| else: | |
| out_a = 'Done' | |
| pass | |
| out_p = f'{targ_lang[0]}: {targ[0]}' | |
| return (out_a, out_p) | |
| def proc2(img): | |
| rand = random.randint(1,3000) | |
| time.sleep(rand/1000) | |
| new_num=len(num1)-1 | |
| num = new_num | |
| print (f"new_num: {new_num}") | |
| if int(num) <= (ser_len - 1): | |
| num1.append(1) | |
| lang = f"{ocr_id[mylist[int(num)]]}" | |
| print(f"lang: {lang}") | |
| out = model2(img,lang) | |
| print (f'bounds: {out}') | |
| try: | |
| if float(out) > float(targ[0]): | |
| targ[0] = out | |
| targ_lang[0]=mylist[int(num)] | |
| else: | |
| pass | |
| out_a = f'{mylist[int(num)]}: {out}' | |
| except Exception as e: | |
| out_a = f"Error:: {e} :: {num}" | |
| else: | |
| out_a = 'Done' | |
| pass | |
| out_p = f'{targ_lang[0]}: {targ[0]}' | |
| return (out_a, out_p) | |
| def proc3(img): | |
| rand = random.randint(1,3000) | |
| time.sleep(rand/1000) | |
| new_num=len(num1)-1 | |
| num = new_num | |
| print (f"new_num: {new_num}") | |
| if int(num) <= (ser_len - 1): | |
| num1.append(1) | |
| lang = f"{ocr_id[mylist[int(num)]]}" | |
| print(f"lang: {lang}") | |
| out = model3(img,lang) | |
| print (f'bounds: {out}') | |
| try: | |
| if float(out) > float(targ[0]): | |
| targ[0] = out | |
| targ_lang[0]=mylist[int(num)] | |
| else: | |
| pass | |
| out_a = f'{mylist[int(num)]}: {out}' | |
| except Exception as e: | |
| out_a = f"Error:: {e} :: {num}" | |
| else: | |
| out_a = 'Done' | |
| pass | |
| out_p = f'{targ_lang[0]}: {targ[0]}' | |
| return (out_a, out_p) | |
| def proc4(img): | |
| rand = random.randint(1,3000) | |
| time.sleep(rand/1000) | |
| new_num=len(num1)-1 | |
| num = new_num | |
| print (f"new_num: {new_num}") | |
| if int(num) <= (ser_len - 1): | |
| num1.append(1) | |
| lang = f"{ocr_id[mylist[int(num)]]}" | |
| print(f"lang: {lang}") | |
| out = model4(img,lang) | |
| print (f'bounds: {out}') | |
| try: | |
| if float(out) > float(targ[0]): | |
| targ[0] = out | |
| targ_lang[0]=mylist[int(num)] | |
| else: | |
| pass | |
| out_a = f'{mylist[int(num)]}: {out}' | |
| except Exception as e: | |
| out_a = f"Error:: {e} :: {num}" | |
| else: | |
| out_a = 'Done' | |
| pass | |
| out_p = f'{targ_lang[0]}: {targ[0]}' | |
| return (out_a, out_p) | |
| def proc5(img): | |
| rand = random.randint(1,3000) | |
| time.sleep(rand/1000) | |
| new_num=len(num1)-1 | |
| num = new_num | |
| print (f"new_num: {new_num}") | |
| if int(num) <= (ser_len - 1): | |
| num1.append(1) | |
| lang = f"{ocr_id[mylist[int(num)]]}" | |
| print(f"lang: {lang}") | |
| out = model5(img,lang) | |
| print (f'bounds: {out}') | |
| try: | |
| if float(out) > float(targ[0]): | |
| targ[0] = out | |
| targ_lang[0]=mylist[int(num)] | |
| else: | |
| pass | |
| except Exception as e: | |
| return f"Error:: {e}" | |
| out_a = f'{mylist[int(num)]}: {out}' | |
| else: | |
| out_a = 'Done' | |
| pass | |
| out_p = f'{targ_lang[0]}: {targ[0]}' | |
| return (out_a, out_p) | |
| def proc6(img): | |
| rand = random.randint(1,3000) | |
| time.sleep(rand/1000) | |
| new_num=len(num1)-1 | |
| num = new_num | |
| print (f"new_num: {new_num}") | |
| if int(num) <= (ser_len - 1): | |
| num1.append(1) | |
| lang = f"{ocr_id[mylist[int(num)]]}" | |
| print(f"lang: {lang}") | |
| out = model6(img,lang) | |
| print (f'bounds: {out}') | |
| try: | |
| if float(out) > float(targ[0]): | |
| targ[0] = out | |
| targ_lang[0]=mylist[int(num)] | |
| else: | |
| pass | |
| except Exception as e: | |
| return f"Error:: {e}" | |
| out_a = f'{mylist[int(num)]}: {out}' | |
| else: | |
| out_a = 'Done' | |
| pass | |
| out_p = f'{targ_lang[0]}: {targ[0]}' | |
| return (out_a, out_p) | |
| def proc7(img): | |
| rand = random.randint(1,3000) | |
| time.sleep(rand/1000) | |
| new_num=len(num1)-1 | |
| num = new_num | |
| print (f"new_num: {new_num}") | |
| if int(num) <= (ser_len - 1): | |
| num1.append(1) | |
| lang = f"{ocr_id[mylist[int(num)]]}" | |
| print(f"lang: {lang}") | |
| out = model7(img,lang) | |
| print (f'bounds: {out}') | |
| try: | |
| if float(out) > float(targ[0]): | |
| targ[0] = out | |
| targ_lang[0]=mylist[int(num)] | |
| else: | |
| pass | |
| except Exception as e: | |
| return f"Error:: {e}" | |
| out_a = f'{mylist[int(num)]}: {out}' | |
| else: | |
| out_a = 'Done' | |
| pass | |
| out_p = f'{targ_lang[0]}: {targ[0]}' | |
| return (out_a, out_p) | |
| def proc8(img): | |
| rand = random.randint(1,3000) | |
| time.sleep(rand/1000) | |
| new_num=len(num1)-1 | |
| num = new_num | |
| print (f"new_num: {new_num}") | |
| if int(num) <= (ser_len - 1): | |
| num1.append(1) | |
| lang = f"{ocr_id[mylist[int(num)]]}" | |
| print(f"lang: {lang}") | |
| out = model8(img,lang) | |
| print (f'bounds: {out}') | |
| try: | |
| if float(out) > float(targ[0]): | |
| targ[0] = out | |
| targ_lang[0]=mylist[int(num)] | |
| else: | |
| pass | |
| except Exception as e: | |
| return f"Error:: {e}" | |
| out_a = f'{mylist[int(num)]}: {out}' | |
| else: | |
| out_a = 'Done' | |
| pass | |
| out_p = f'{targ_lang[0]}: {targ[0]}' | |
| return (out_a, out_p) | |
| def proc9(img): | |
| rand = random.randint(1,3000) | |
| time.sleep(rand/1000) | |
| new_num=len(num1)-1 | |
| num = new_num | |
| print (f"new_num: {new_num}") | |
| if int(num) <= (ser_len - 1): | |
| num1.append(1) | |
| lang = f"{ocr_id[mylist[int(num)]]}" | |
| print(f"lang: {lang}") | |
| out = model9(img,lang) | |
| print (f'bounds: {out}') | |
| try: | |
| if float(out) > float(targ[0]): | |
| targ[0] = out | |
| targ_lang[0]=mylist[int(num)] | |
| else: | |
| pass | |
| except Exception as e: | |
| return f"Error:: {e}" | |
| out_a = f'{mylist[int(num)]}: {out}' | |
| else: | |
| out_a = 'Done' | |
| pass | |
| out_p = f'{targ_lang[0]}: {targ[0]}' | |
| return (out_a, out_p) | |
| def proc10(img): | |
| rand = random.randint(1,3000) | |
| time.sleep(rand/1000) | |
| new_num=len(num1)-1 | |
| num = new_num | |
| print (f"new_num: {new_num}") | |
| if int(num) <= (ser_len - 1): | |
| num1.append(1) | |
| lang = f"{ocr_id[mylist[int(num)]]}" | |
| print(f"lang: {lang}") | |
| out = model10(img,lang) | |
| print (f'bounds: {out}') | |
| try: | |
| if float(out) > float(targ[0]): | |
| targ[0] = out | |
| targ_lang[0]=mylist[int(num)] | |
| else: | |
| pass | |
| except Exception as e: | |
| return f"Error:: {e}" | |
| out_a = f'{mylist[int(num)]}: {out}' | |
| else: | |
| out_a = 'Done' | |
| pass | |
| out_p = f'{targ_lang[0]}: {targ[0]}' | |
| return (out_a, out_p) | |
| ################## | |
| def proc11(img): | |
| rand = random.randint(1,3000) | |
| time.sleep(rand/1000) | |
| new_num=len(num1)-1 | |
| num = new_num | |
| print (f"new_num: {new_num}") | |
| if int(num) <= (ser_len - 1): | |
| num1.append(1) | |
| lang = f"{ocr_id[mylist[int(num)]]}" | |
| print(f"lang: {lang}") | |
| out = model11(img,lang) | |
| print (f'bounds: {out}') | |
| try: | |
| if float(out) > float(targ[0]): | |
| targ[0]=out | |
| targ_lang[0]=mylist[int(num)] | |
| else: | |
| pass | |
| out_a = f'{mylist[int(num)]}: {out}' | |
| except Exception as e: | |
| out_a = f"Error:: {e} :: {num}" | |
| else: | |
| out_a = 'Done' | |
| pass | |
| out_p = f'{targ_lang[0]}: {targ[0]}' | |
| return (out_a, out_p) | |
| def proc12(img): | |
| rand = random.randint(1,3000) | |
| time.sleep(rand/1000) | |
| new_num=len(num1)-1 | |
| num = new_num | |
| print (f"new_num: {new_num}") | |
| if int(num) <= (ser_len - 1): | |
| num1.append(1) | |
| lang = f"{ocr_id[mylist[int(num)]]}" | |
| print(f"lang: {lang}") | |
| out = model12(img,lang) | |
| print (f'bounds: {out}') | |
| try: | |
| if float(out) > float(targ[0]): | |
| targ[0] = out | |
| targ_lang[0]=mylist[int(num)] | |
| else: | |
| pass | |
| out_a = f'{mylist[int(num)]}: {out}' | |
| except Exception as e: | |
| out_a = f"Error:: {e} :: {num}" | |
| else: | |
| out_a = 'Done' | |
| pass | |
| out_p = f'{targ_lang[0]}: {targ[0]}' | |
| return (out_a, out_p) | |
| def proc13(img): | |
| rand = random.randint(1,3000) | |
| time.sleep(rand/1000) | |
| new_num=len(num1)-1 | |
| num = new_num | |
| print (f"new_num: {new_num}") | |
| if int(num) <= (ser_len - 1): | |
| num1.append(1) | |
| lang = f"{ocr_id[mylist[int(num)]]}" | |
| print(f"lang: {lang}") | |
| out = model13(img,lang) | |
| print (f'bounds: {out}') | |
| try: | |
| if float(out) > float(targ[0]): | |
| targ[0] = out | |
| targ_lang[0]=mylist[int(num)] | |
| else: | |
| pass | |
| out_a = f'{mylist[int(num)]}: {out}' | |
| except Exception as e: | |
| out_a = f"Error:: {e} :: {num}" | |
| else: | |
| out_a = 'Done' | |
| pass | |
| out_p = f'{targ_lang[0]}: {targ[0]}' | |
| return (out_a, out_p) | |
| def proc14(img): | |
| rand = random.randint(1,3000) | |
| time.sleep(rand/1000) | |
| new_num=len(num1)-1 | |
| num = new_num | |
| print (f"new_num: {new_num}") | |
| if int(num) <= (ser_len - 1): | |
| num1.append(1) | |
| lang = f"{ocr_id[mylist[int(num)]]}" | |
| print(f"lang: {lang}") | |
| out = model14(img,lang) | |
| print (f'bounds: {out}') | |
| try: | |
| if float(out) > float(targ[0]): | |
| targ[0] = out | |
| targ_lang[0]=mylist[int(num)] | |
| else: | |
| pass | |
| out_a = f'{mylist[int(num)]}: {out}' | |
| except Exception as e: | |
| out_a = f"Error:: {e} :: {num}" | |
| else: | |
| out_a = 'Done' | |
| pass | |
| out_p = f'{targ_lang[0]}: {targ[0]}' | |
| return (out_a, out_p) | |
| def proc15(img): | |
| rand = random.randint(1,3000) | |
| time.sleep(rand/1000) | |
| new_num=len(num1)-1 | |
| num = new_num | |
| print (f"new_num: {new_num}") | |
| if int(num) <= (ser_len - 1): | |
| num1.append(1) | |
| lang = f"{ocr_id[mylist[int(num)]]}" | |
| print(f"lang: {lang}") | |
| out = model15(img,lang) | |
| print (f'bounds: {out}') | |
| try: | |
| if float(out) > float(targ[0]): | |
| targ[0] = out | |
| targ_lang[0]=mylist[int(num)] | |
| else: | |
| pass | |
| except Exception as e: | |
| return f"Error:: {e}" | |
| out_a = f'{mylist[int(num)]}: {out}' | |
| else: | |
| out_a = 'Done' | |
| pass | |
| out_p = f'{targ_lang[0]}: {targ[0]}' | |
| return (out_a, out_p) | |
| def proc16(img): | |
| rand = random.randint(1,3000) | |
| time.sleep(rand/1000) | |
| new_num=len(num1)-1 | |
| num = new_num | |
| print (f"new_num: {new_num}") | |
| if int(num) <= (ser_len - 1): | |
| num1.append(1) | |
| lang = f"{ocr_id[mylist[int(num)]]}" | |
| print(f"lang: {lang}") | |
| out = model16(img,lang) | |
| print (f'bounds: {out}') | |
| try: | |
| if float(out) > float(targ[0]): | |
| targ[0] = out | |
| targ_lang[0]=mylist[int(num)] | |
| else: | |
| pass | |
| except Exception as e: | |
| return f"Error:: {e}" | |
| out_a = f'{mylist[int(num)]}: {out}' | |
| else: | |
| out_a = 'Done' | |
| pass | |
| out_p = f'{targ_lang[0]}: {targ[0]}' | |
| return (out_a, out_p) | |
| def proc17(img): | |
| rand = random.randint(1,3000) | |
| time.sleep(rand/1000) | |
| new_num=len(num1)-1 | |
| num = new_num | |
| print (f"new_num: {new_num}") | |
| if int(num) <= (ser_len - 1): | |
| num1.append(1) | |
| lang = f"{ocr_id[mylist[int(num)]]}" | |
| print(f"lang: {lang}") | |
| out = model17(img,lang) | |
| print (f'bounds: {out}') | |
| try: | |
| if float(out) > float(targ[0]): | |
| targ[0] = out | |
| targ_lang[0]=mylist[int(num)] | |
| else: | |
| pass | |
| except Exception as e: | |
| return f"Error:: {e}" | |
| out_a = f'{mylist[int(num)]}: {out}' | |
| else: | |
| out_a = 'Done' | |
| pass | |
| out_p = f'{targ_lang[0]}: {targ[0]}' | |
| return (out_a, out_p) | |
| def proc18(img): | |
| rand = random.randint(1,3000) | |
| time.sleep(rand/1000) | |
| new_num=len(num1)-1 | |
| num = new_num | |
| print (f"new_num: {new_num}") | |
| if int(num) <= (ser_len - 1): | |
| num1.append(1) | |
| lang = f"{ocr_id[mylist[int(num)]]}" | |
| print(f"lang: {lang}") | |
| out = model18(img,lang) | |
| print (f'bounds: {out}') | |
| try: | |
| if float(out) > float(targ[0]): | |
| targ[0] = out | |
| targ_lang[0]=mylist[int(num)] | |
| else: | |
| pass | |
| except Exception as e: | |
| return f"Error:: {e}" | |
| out_a = f'{mylist[int(num)]}: {out}' | |
| else: | |
| out_a = 'Done' | |
| pass | |
| out_p = f'{targ_lang[0]}: {targ[0]}' | |
| return (out_a, out_p) | |
| def proc19(img): | |
| rand = random.randint(1,3000) | |
| time.sleep(rand/1000) | |
| new_num=len(num1)-1 | |
| num = new_num | |
| print (f"new_num: {new_num}") | |
| if int(num) <= (ser_len - 1): | |
| num1.append(1) | |
| lang = f"{ocr_id[mylist[int(num)]]}" | |
| print(f"lang: {lang}") | |
| out = model19(img,lang) | |
| print (f'bounds: {out}') | |
| try: | |
| if float(out) > float(targ[0]): | |
| targ[0] = out | |
| targ_lang[0]=mylist[int(num)] | |
| else: | |
| pass | |
| except Exception as e: | |
| return f"Error:: {e}" | |
| out_a = f'{mylist[int(num)]}: {out}' | |
| else: | |
| out_a = 'Done' | |
| pass | |
| out_p = f'{targ_lang[0]}: {targ[0]}' | |
| return (out_a, out_p) | |
| def proc20(img): | |
| rand = random.randint(1,3000) | |
| time.sleep(rand/1000) | |
| new_num=len(num1)-1 | |
| num = new_num | |
| print (f"new_num: {new_num}") | |
| if int(num) <= (ser_len - 1): | |
| num1.append(1) | |
| lang = f"{ocr_id[mylist[int(num)]]}" | |
| print(f"lang: {lang}") | |
| out = model20(img,lang) | |
| print (f'bounds: {out}') | |
| try: | |
| if float(out) > float(targ[0]): | |
| targ[0] = out | |
| targ_lang[0]=mylist[int(num)] | |
| else: | |
| pass | |
| except Exception as e: | |
| return f"Error:: {e}" | |
| out_a = f'{mylist[int(num)]}: {out}' | |
| else: | |
| out_a = 'Done' | |
| pass | |
| out_p = f'{targ_lang[0]}: {targ[0]}' | |
| return (out_a, out_p) | |
| with gr.Blocks() as app: | |
| im = gr.Image(type = "filepath") | |
| ocr_sens=gr.Slider(0.1, 1, step=0.05,value=0.25,label="Detect Min Confidence") | |
| max_tok=gr.Number(label="Max Tokens",step=1, value=200) | |
| prob_lang = gr.Textbox(label="Probable Language:") | |
| det_btn = gr.Button() | |
| with gr.Accordion("process"): | |
| out1=gr.Textbox() | |
| out2=gr.Textbox() | |
| out3=gr.Textbox() | |
| out4=gr.Textbox() | |
| out5=gr.Textbox() | |
| out6=gr.Textbox() | |
| out7=gr.Textbox() | |
| out8=gr.Textbox() | |
| out9=gr.Textbox() | |
| out10=gr.Textbox() | |
| out11=gr.Textbox() | |
| out12=gr.Textbox() | |
| out13=gr.Textbox() | |
| out14=gr.Textbox() | |
| out15=gr.Textbox() | |
| out16=gr.Textbox() | |
| out17=gr.Textbox() | |
| out18=gr.Textbox() | |
| out19=gr.Textbox() | |
| out20=gr.Textbox() | |
| det_btn.click(proc0,None,None, show_progress=False) | |
| det_btn.click(proc1,[im],[out1,prob_lang], show_progress=False) | |
| det_btn.click(proc2,[im],[out2,prob_lang], show_progress=False) | |
| det_btn.click(proc3,[im],[out3,prob_lang], show_progress=False) | |
| det_btn.click(proc4,[im],[out4,prob_lang], show_progress=False) | |
| det_btn.click(proc5,[im],[out5,prob_lang], show_progress=False) | |
| det_btn.click(proc6,[im],[out6,prob_lang], show_progress=False) | |
| det_btn.click(proc7,[im],[out7,prob_lang], show_progress=False) | |
| det_btn.click(proc8,[im],[out8,prob_lang], show_progress=False) | |
| det_btn.click(proc9,[im],[out9,prob_lang], show_progress=False) | |
| det_btn.click(proc10,[im],[out10,prob_lang], show_progress=False) | |
| det_btn.click(proc11,[im],[out11,prob_lang], show_progress=False) | |
| det_btn.click(proc12,[im],[out12,prob_lang], show_progress=False) | |
| det_btn.click(proc13,[im],[out13,prob_lang], show_progress=False) | |
| det_btn.click(proc14,[im],[out14,prob_lang], show_progress=False) | |
| det_btn.click(proc15,[im],[out15,prob_lang], show_progress=False) | |
| det_btn.click(proc16,[im],[out16,prob_lang], show_progress=False) | |
| det_btn.click(proc17,[im],[out17,prob_lang], show_progress=False) | |
| det_btn.click(proc18,[im],[out18,prob_lang], show_progress=False) | |
| det_btn.click(proc19,[im],[out19,prob_lang], show_progress=False) | |
| det_btn.click(proc20,[im],[out20,prob_lang], show_progress=False) | |
| out1.change(proc1,[im],[out1,prob_lang], show_progress=False) | |
| out2.change(proc2,[im],[out2,prob_lang], show_progress=False) | |
| out3.change(proc3,[im],[out3,prob_lang], show_progress=False) | |
| out4.change(proc4,[im],[out4,prob_lang], show_progress=False) | |
| out5.change(proc5,[im],[out5,prob_lang], show_progress=False) | |
| out6.change(proc6,[im],[out6,prob_lang], show_progress=False) | |
| out7.change(proc7,[im],[out7,prob_lang], show_progress=False) | |
| out8.change(proc8,[im],[out8,prob_lang], show_progress=False) | |
| out9.change(proc9,[im],[out9,prob_lang], show_progress=False) | |
| out10.change(proc10,[im],[out10,prob_lang], show_progress=False) | |
| out11.change(proc11,[im],[out11,prob_lang], show_progress=False) | |
| out12.change(proc12,[im],[out12,prob_lang], show_progress=False) | |
| out13.change(proc13,[im],[out13,prob_lang], show_progress=False) | |
| out14.change(proc14,[im],[out14,prob_lang], show_progress=False) | |
| out15.change(proc15,[im],[out15,prob_lang], show_progress=False) | |
| out16.change(proc16,[im],[out16,prob_lang], show_progress=False) | |
| out17.change(proc17,[im],[out17,prob_lang], show_progress=False) | |
| out18.change(proc18,[im],[out18,prob_lang], show_progress=False) | |
| out19.change(proc19,[im],[out19,prob_lang], show_progress=False) | |
| out20.change(proc20,[im],[out20,prob_lang], show_progress=False) | |
| #det_btn.click(detect_lang,[im,ocr_sens,],det_out) | |
| app.queue(concurrency_count=100).launch() |