Skip to content

boasmeier/ocr-observer-api

Repository files navigation

ocr-observer-rest-api

Run the app:

  1. Create ./config/server.conf file:
[Server]
Host=0.0.0.0
Port=5001

[Database]
User=<user>
Password=<pw>
Host=<dbhost>
Port=<dbport>
Name=<dbname>
  1. Install dependencies: pdm install
  2. Activate pdm environment: pdm --pep582
  3. Restart terminal
  4. Start the app: python ./src/server.py

Enable intellisense for __pypackages__ in vscode

Add following to the workspace settings .vscode/settings.json

{
    "python.autoComplete.extraPaths": [
        "${workspaceFolder}/__pypackages__/3.10/lib"
    ],
    "python.analysis.extraPaths": [
        "${workspaceFolder}/__pypackages__/3.10/lib"
    ]
}

Build and run Docker Image

  1. Build: docker image build -t ocr_observer_api .
  2. Run: docker container run -itd --name ocr-observer-api -p 5001:5001 ocr_observer_api

Design of ocr component

@startuml Interface OcrDataExtractor Interface OcrScanner Interface FieldExtractor Interface FieldDetector Interface ExtractionVisualizer

Class LibraryCardOcrDataExtractor Class PaddleocrOcrScanner Class ComplexRulebasedFieldExtractorOd Class FieldObjectDetector Class ObjectDetectionVisualizer

OcrDataExtractor <|.. LibraryCardOcrDataExtractor LibraryCardOcrDataExtractor *-- OcrScanner LibraryCardOcrDataExtractor *-- FieldExtractor LibraryCardOcrDataExtractor *-- FieldDetector LibraryCardOcrDataExtractor *-- ExtractionVisualizer OcrScanner <|.. PaddleocrOcrScanner FieldExtractor <|.. ComplexRulebasedFieldExtractorOd FieldDetector <|.. FieldObjectDetector ExtractionVisualizer <|.. ObjectDetectionVisualizer @enduml

About

REST Api written in Python for the OCR Observer Web Application.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published