Giter VIP home page Giter VIP logo

craft_hw_ocr's Introduction

craft_hw_ocr

Recognition of handwritten text using CRAFT text detection and TrOCR

CRAFT

CRAFT(Character Region Awareness for Text Detection) is a way of doing OCR on images by exploring the region around the text. On high level the algorithm generates heatmap of the image and convolute upon them rather than on the image directly. Also for generating bounding boxes it will model respective thresholds with anchor points between individual character and individual words

TrOCR

TrOCR is essentially an encoder-decoder model, where encoder network creates an representation of the image using image encoding transformers models(ViT, DEiT) and the decoder network (language models) converts the processed repsentation into target strings.

Implementation

from craft_hw_ocr import OCR
import cv2
import numpy as np

img = OCR.load_image('/content/example_1.png')

# do the below step if your image is tilted by some angle else ignore
# img = OCR.process_image(img)

ocr_models = OCR.load_models()

img, results = OCR.detection(img, ocr_models[2])

bboxes, text = OCR.recoginition(img, results, ocr_models[0], ocr_models[1])

pilImage = OCR.visualize(img, results)

Online Demo

Huggingface Space

Credits

craft-text-detector

craft_hw_ocr's People

Contributors

vishnunkumar avatar hms97 avatar

Stargazers

Jeff Carpenter avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.