{"id":24098443,"url":"https://github.com/matlab-deep-learning/text-detection-using-deep-learning","last_synced_at":"2025-05-07T19:24:35.712Z","repository":{"id":118345608,"uuid":"378038300","full_name":"matlab-deep-learning/Text-Detection-using-Deep-Learning","owner":"matlab-deep-learning","description":"Text Detection using Pretrained CRAFT model in MATLAB","archived":false,"fork":false,"pushed_at":"2024-01-24T10:32:59.000Z","size":912,"stargazers_count":13,"open_issues_count":0,"forks_count":0,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-03-14T21:51:23.062Z","etag":null,"topics":["computer-vision","deep-learning","matlab","ocr","pretrained-models","scene-text-detection","text-detection","text-detection-recognition","text-localization","text-recognition"],"latest_commit_sha":null,"homepage":"https://www.mathworks.com/products/deep-learning.html","language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/matlab-deep-learning.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2021-06-18T04:57:58.000Z","updated_at":"2025-01-08T05:43:39.000Z","dependencies_parsed_at":"2023-10-03T20:06:44.089Z","dependency_job_id":null,"html_url":"https://github.com/matlab-deep-learning/Text-Detection-using-Deep-Learning","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/matlab-deep-learning%2FText-Detection-using-Deep-Learning","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/matlab-deep-learning%2FText-Detection-using-Deep-Learning/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/matlab-deep-learning%2FText-Detection-using-Deep-Learning/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/matlab-deep-learning%2FText-Detection-using-Deep-Learning/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/matlab-deep-learning","download_url":"https://codeload.github.com/matlab-deep-learning/Text-Detection-using-Deep-Learning/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252942234,"owners_count":21829031,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["computer-vision","deep-learning","matlab","ocr","pretrained-models","scene-text-detection","text-detection","text-detection-recognition","text-localization","text-recognition"],"created_at":"2025-01-10T14:45:54.106Z","updated_at":"2025-05-07T19:24:35.692Z","avatar_url":"https://github.com/matlab-deep-learning.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# Text Detection using Deep Learning\n\nThis repository implements a pretrained Character Region Awareness For Text detection (CRAFT) [1] model in MATLAB\u0026reg;.\n\n[![Open in MATLAB Online](https://www.mathworks.com/images/responsive/global/open-in-matlab-online.svg)](https://matlab.mathworks.com/open/github/v1?repo=matlab-deep-learning/Text-Detection-using-Deep-Learning)\n\n**Creator**: MathWorks Development\n\nRequirements\n------------  \n\n- MATLAB R2022a or later\n- Deep Learning Toolbox\u0026trade;\n- Computer Vision Toolbox\u0026trade;\n- Computer Vision Toolbox\u0026trade; Model for Text Detection\n  \nNote: Previous MATLAB release users can use [this](https://github.com/matlab-deep-learning/Text-Detection-using-Deep-Learning/tree/previous) branch to download the pretrained models.\n\nOverview\n--------\n\nThis repository implements text detection in images using CRAFT deep learning model with VGG-16 as backbone. The network is trained on various scene text detection datasets with text in English, Korean, Italian, French, Arabic, German and Bangla (Indian). \n\nCRAFT uses a convolutional neural network to produce two outputs, region score, and affinity score. The region score localizes individual characters in the image, and the affinity score groups each character into a single instance. The character-level region awareness mechanism helps in detecting texts of various shapes such as long, curved, and arbitrarily shaped texts.\n\nGetting Started\n---------------\n[detectTextCRAFT](https://in.mathworks.com/help/vision/ref/detecttextcraft.html) - Detect texts in images by using CRAFT deep learning model\n\nDetect Text Using Pretrained CRAFT\n---------------------------------------\nNote: This functionality requires Deep Learning Toolbox\u0026trade; and the Computer Vision Toolbox\u0026trade; Model for Text Detection. You can install the Computer Vision Toolbox Model for Text Detection from Add-On Explorer. For more information about installing add-ons, see [Get and Manage Add-Ons](https://in.mathworks.com/help/matlab/matlab_env/get-add-ons.html).\n```\n% Read test image.\n  orgImg = imread('businessCard.png');\n\n% Perform text detection\n  bboxes = detectTextCRAFT(orgImg);\n    \n% Visualize results\n  outImg = insertShape(orgImg,\"rectangle\",bboxes,LineWidth=3);\n  figure; imshow(outImg);\n```\n\n\u003cimg src=\"images/business_card.png\" alt =\"image\" width=\"550\" height=\"350\"/\u003e\n\nText Recognition using OCR + CRAFT\n----------------------------------\n\nOutput of `detectTextCRAFT` return the bounding boxes that can be passed to `ocr` function as region of interest (roi) for text recognition applications.\n\n```\n% Binarizing the image before using OCR for better results.\n  I = rgb2gray(orgImg);\n  BW = imbinarize(I, 'adaptive','ForegroundPolarity','dark','Sensitivity',0.5);\n  figure; imshow(BW);\n\n% OCR this image using region-of-interest for OCR to avoid processing non-text background.\n  txt = ocr(BW,bboxes,'LayoutAnalysis','word');\n\n% Display the recognized words.\n  recognizedWords = cat(1,txt(:).Words);\n  Iocr = insertObjectAnnotation(orgImg, 'rectangle',bboxes,recognizedWords);\n  figure; imshow(Iocr);\n```\n\n\u003cimg src=\"images/ocr_result.jpg\" alt =\"image\" width=\"550\" height=\"350\"/\u003e\n\nAccuracy\n---------\n\n| Dataset | Recall | Precision  | Hmean |\n| ------ | ------ | ------ | ------ |\n| ICDAR2013[2] | 92.60 | 91.84 | 91.81 |\n| ICDAR2017[3] | 62.29 | 78.68 | 69.53 |\n\nCRAFT Network Architecture\n--------------------------\n\n![alt text](images/craft_architecture.PNG?raw=true)\n\nThe architecture of CRAFT is composed of VGG-16 as backbone and skip connections in the decoding part, similar to U-net to aggregate low-level features. The UpConv blocks are made of convolutional and batch normalization layers. These blocks are used to perform upsampling.\n\nThe pretrained CRAFT network takes the image as input and generates the output feature map with two channels that correspond to region score and affinity score. The region score represents the probability that the given pixel is the center of the character, and the affinity score represents the center probability of the space between adjacent characters. \n\n\n\nPublication\n-----------\n\n[1] Baek, Y., Lee, B., Han, D., Yun, S. and Lee, H., 2019. Character region awareness for text detection. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (pp. 9365-9374).\n\n[2] https://rrc.cvc.uab.es/?ch=2\u0026com=downloads\n\n[3] https://rrc.cvc.uab.es/?ch=8\u0026com=downloads\n\nCopyright 2021-2024 The MathWorks, Inc.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmatlab-deep-learning%2Ftext-detection-using-deep-learning","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmatlab-deep-learning%2Ftext-detection-using-deep-learning","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmatlab-deep-learning%2Ftext-detection-using-deep-learning/lists"}