abcprintf / ocr-viewer

Web application for easy and convenient viewing of OCR results.

Home Page:https://whwnsdlr1.github.io/ocr-viewer/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

ocr-viewer

Alt Text
Web application for easy and convenient viewing of OCR results.
You can easily open the image (drag and drop) and draw a text area on the image in real time (in the browser) so you can select and view only the text area you want.

Demo using stub data - https://whwnsdlr1.github.io/ocr-viewer/

install

git clone https://github.com/whwnsdlr1/ocr-viewer
cd ocr-viewer
yarn install
yarn run serve

and access to http://localhost:port

Demo (own OCR)

  1. Implement your own recognizeImpl function in ocr-viewer> src> js> recognize.js. See the comment of the function.
  2. Input the image in the web app(http://localhost:port)

Demo (PaddleOCR)

  1. Install python packages and Run websocket server
cd backend_example
pip install -r requirements_paddle_ocr.txt
python websocket_paddle_ocr.py
  1. Input the image in the web app(http://localhost:port)

you can change language in 'websocket_paddle_ocr.py'. default is English

Demo (EasyOCR)

  1. Install pytorch
  2. Install python packages and Run websocket server
cd backend_example
pip install -r requirements_easy_ocr.txt
python websocket_easy_ocr.py
  1. Input the image in the web app(http://localhost:port)

you can change language in 'websocket_easy_ocr.py'. default is English

Control

  • Image Input
    • Drag and drop
    • Using File dialog (top input element)
  • Image Frame
    • left mouse & touch drag - panning
    • mouse wheel & pinch to zoom - zoom in / out
    • right mouse drag - adjust brightness and contrast
  • Result Frame
    • You can search for the text you want. Only the searched text is displayed above the image.
    • Hover over the text badge to see the probability.
    • When you click a text badge, the clicked text is highlighted and displayed above the image.

options

  • Modify the code below to change the box color.
// ocr-viewer > src > components > Frame.vue
<script>
export default {
    ...
    data: function () {
        return {
            ...
            style: {
                boxColor: '#FFFF00',
                highlightBoxColor: '#FF0000'
            }
            ...
        }
    }
    ...
}
</script>
  • Modify the code below to change the box line width.
// ocr-viewer > src > plugins > cornerstoneToolsPlugin.js
export default {
  install: function (Vue) {
    ...
    cornerstoneTools.toolStyle.setToolWidth(2);
    ...
  }
}

Browser support - (tested)

  • Google Chrome 89+
  • Mozilla FireFox 85+

About

Web application for easy and convenient viewing of OCR results.

https://whwnsdlr1.github.io/ocr-viewer/

License:MIT License


Languages

Language:Vue 62.1%Language:JavaScript 30.8%Language:Python 5.0%Language:HTML 2.1%