AxelBell/EasyOCR_text_recognition
5
1 2examples = [3 [4 [5 "English [en]",6 ],7 "./assets/english.png",8 ],9 [10 [11 "French [fr]",12 "English [en]",13 ],14 "./assets/french.jpg",15 ],16 [17 [18 "Simplified Chinese [ch_sim]",19 "English [en]",20 ],21 "./assets/chinese.jpg",22 ],23 [24 [25 "Japanese [ja]",26 "English [en]",27 ],28 "./assets/japanese.jpg",29 ],30 [31 [32 "Korean [ko]",33 "English [en]",34 ],35 "./assets/korean.png",36 ],37 [38 [39 "Hindi [hi]",40 "English [en]",41 ],42 "./assets/hindi.jpeg",43 ],44]45 46assets = [47 [48 "header",49 "./assets/header.html",50 ],51 [52 "footer",53 "./assets/footer.html",54 ],55 [56 "css",57 "./assets/style.css",58 ],59]60################## inputs ######################61[[blocklist.inputs]]62name = "lang"63type = "Dropdown"64param = { value = ["English [en]"], max_choices = 3, multiselect = true, label = "Lang", info = "list of language code you want to recognize", elem_id = "lang", choices = [65 "Abaza [abq]","Adyghe [ady]","Afrikaans [af]","Angika [ang]","Arabic [ar]","Assamese [as]","Avar [ava]","Azerbaijani [az]","Belarusian [be]","Bulgarian [bg]","Bihari [bh]","Bhojpuri [bho]","Bengali [bn]","Bosnian [bs]","Simplified Chinese [ch_sim]","Traditional Chinese [ch_tra]","Chechen [che]","Czech [cs]","Welsh [cy]","Danish [da]","Dargwa [dar]","German [de]","English [en]","Spanish [es]","Estonian [et]","Persian (Farsi) [fa]","French [fr]","Irish [ga]","Goan Konkani [gom]","Hindi [hi]","Croatian [hr]","Hungarian [hu]","Indonesian [id]","Ingush [inh]","Icelandic [is]","Italian [it]","Japanese [ja]","Kabardian [kbd]","Kannada [kn]","Korean [ko]","Kurdish [ku]","Latin [la]","Lak [lbe]","Lezghian [lez]","Lithuanian [lt]","Latvian [lv]","Magahi [mah]","Maithili [mai]","Maori [mi]","Mongolian [mn]","Marathi [mr]","Malay [ms]","Maltese [mt]","Nepali [ne]","Newari [new]","Dutch [nl]","Norwegian [no]","Occitan [oc]","Pali [pi]","Polish [pl]","Portuguese [pt]","Romanian [ro]","Russian [ru]","Serbian (cyrillic) [rs_cyrillic]","Serbian (latin) [rs_latin]","Nagpuri [sck]","Slovak [sk]","Slovenian [sl]","Albanian [sq]","Swedish [sv]","Swahili [sw]","Tamil [ta]","Tabassaran [tab]","Telugu [te]","Thai [th]","Tajik [tjk]","Tagalog [tl]","Turkish [tr]","Uyghur [ug]","Ukranian [uk]","Urdu [ur]","Uzbek [uz]","Vietnamese [vi]"66] }67[[blocklist.inputs]]68name = "image"69type = "Image"70param = { type = "numpy", label = "Upload", tool = "editor" }71[[blocklist.inputs]]72name = "decoder"73type = "Dropdown"74param = { choices = ["greedy","beamsearch","wordbeamsearch"], value = "greedy", type = "value", label = "Decoder" }75[[blocklist.inputs]]76name = "beamWidth"77type = "Slider"78param = { minimum = 0, maximum = 10, value = 5, step = 1, interactive = false, label = "Beam width" }79[[blocklist.inputs]]80name = "allowlist"81type = "Textbox"82param = { value = "", label = "Allowlist", placeholder = "recognize only subset of characters" }83[[blocklist.inputs]]84name = "blocklist"85type = "Textbox"86param = { value = "", label = "Blocklist", placeholder = "block subset of character" }87[[blocklist.inputs]]88name = "detail"89type = "Checkbox"90param = { value = true, label = "Detail", info = "Set this to 0 for simple output" }91[[blocklist.inputs]]92name = "rotation_info"93type = "CheckboxGroup"94param = { choices = [90,180,270], value = [], label = "Rotation info", info = "Allow EasyOCR to rotate each text box and return the one with the best confident score" }95[[blocklist.inputs]]96name = "paragraph"97type = "Checkbox"98param = { value = false, label = "Paragraph", info = "Combine result into paragraph" }99[[blocklist.inputs]]100name = "min_size"101type = "Slider"102param = { minimum = 1, maximum = 100, value = 20, step = 1, label = "Min Size", info = "Filter text box smaller than minimum value in pixel" }103[[blocklist.inputs]]104name = "contrast_ths"105type = "Slider"106param = { minimum = 0, maximum = 1, value = 0.1, step = 0.05, label = "Contrast threshold", info = "Text box with contrast lower than this value will be passed into model 2 times. First is with original image and second with contrast adjusted to 'adjust_contrast' value. The one with more confident level will be returned as a result" }107[[blocklist.inputs]]108name = "adjust_contrast"109type = "Slider"110param = { minimum = 0, maximum = 1, value = 0.5, step = 0.05, label = "Adjust Contrast", info = "Ttarget contrast level for low contrast text box" }111[[blocklist.inputs]]112name = "text_threshold"113type = "Slider"114param = { minimum = 0, maximum = 1, value = 0.7, step = 0.05, label = "Text threshold", info = "Text confidence threshold" }115[[blocklist.inputs]]116name = "low_text"117type = "Slider"118param = { minimum = 0, maximum = 1, value = 0.4, step = 0.05, label = "Low text", info = "Text low-bound score" }119[[blocklist.inputs]]120name = "link_threshold"121type = "Slider"122param = { minimum = 0, maximum = 1, value = 0.4, step = 0.05, label = "Link threshold", info = "Link confidence threshold" }123[[blocklist.inputs]]124name = "mag_ratio"125type = "Slider"126param = { minimum = 0, maximum = 1.5, value = 1, step = 0.1, label = "Mag ratio", info = "Image magnification ratio" }127[[blocklist.inputs]]128name = "slope_ths"129type = "Slider"130param = { minimum = 0.05, maximum = 1.0, value = 0.1, step = 0.05, label = "Slope threshold", info = "Maximum slope (delta y/delta x) to considered merging. Low value means tiled boxes will not be merged" }131[[blocklist.inputs]]132name = "ycenter_ths"133type = "Slider"134param = { minimum = 0, maximum = 1, value = 0.5, step = 0.05, label = "Y center threshold", info = "Maximum shift in y direction. Boxes with different level should not be merged" }135[[blocklist.inputs]]136name = "height_ths"137type = "Slider"138param = { minimum = 0, maximum = 1, value = 0.5, step = 0.05, label = "Height threshold", info = "Maximum different in box height. Boxes with very different text size should not be merged" }139[[blocklist.inputs]]140name = "width_ths"141type = "Slider"142param = { minimum = 0, maximum = 1, value = 0.5, step = 0.05, label = "Width threshold", info = "Maximum horizontal distance to merge boxes" }143[[blocklist.inputs]]144name = "y_ths"145type = "Slider"146param = { minimum = 0, maximum = 2, value = 0.5, step = 0.05, interactive = false, label = "Y threshold", info = "Maximum verticall distance to merge text boxes when paragraph=True" }147[[blocklist.inputs]]148name = "x_ths"149type = "Slider"150param = { minimum = 0, maximum = 2, value = 1, step = 0.05, interactive = false, label = "X threshold", info = "Maximum horizontal distance to merge text boxes when paragraph=True" }151[[blocklist.inputs]]152name = "add_margin"153type = "Slider"154param = { minimum = 0, maximum = 1, value = 0.1, step = 0.05, label = "Add margin", info = "Extend bounding boxes in all direction by certain value. This is important for language with complex script (E.g. Thai)" }155[[blocklist.inputs]]156name = "threshold"157type = "Slider"158param = { minimum = 0.1, maximum = 1, value = 0.2, step = 0.05, label = "Threshold", info = "Minimum probability for each pixel of heatmap tensor to be considered as a valid text pixel" }159[[blocklist.inputs]]160name = "bbox_min_score"161type = "Slider"162param = { minimum = 0.1, maximum = 1, value = 0.2, step = 0.05, label = "Bounding box min score", info = "Minimum score for each detected bounding box to be considered as a valid text bounding box" }163[[blocklist.inputs]]164name = "bbox_min_size"165type = "Slider"166param = { minimum = 1, maximum = 10, value = 3, step = 1, label = "Bounding box min size", info = "Minimum score for each detected bounding box to be considered as a valid text bounding box" }167[[blocklist.inputs]]168name = "max_candidates"169type = "Number"170param = { minimum = 0, value = 0, precision = 0, step = 1, label = "Max candidates", info = "Maximum number of detected bounding boxes to be considered as candidates for valid text bounding box. Setting it to 0 implies no maximum. The default is 0" }171[[blocklist.inputs]]172name = "output_format"173type = "Dropdown"174param = { choices = ["standard","dict","json","free_merge"], value = "standard", type = "value", label = "Output format" }175################## outputs #####################176[[blocklist.outputs]]177name = "image_out"178type = "Image"179param = { label = "Output" }180[[blocklist.outputs]]181name = "data_out"182type = "Dataframe"183param = { headers = ["#","text","confident"], datatype = ["number","str","str"], type = "array", label = "Result" }184[[blocklist.outputs]]185name = "raw_out"186type = "Code"187param = { language = "python", label = "Result" }188 