Skip to content

How to use WithCustomImageOcr when working with kernel memory as a service? #738

Answered by dluc
pfigueiredo asked this question in 1. Q&A
Discussion options

You must be logged in to vote

To use Tesseract:

  • create a new class, e.g. TesseractOcrEngine, implementing the IOcrEngine (code) interface
  • customize Service/Program.cs (where we call appBuilder.AddKernelMemory), changing this code:
// ...
appBuilder.AddKernelMemory(memoryBuilder =>
{
    memoryBuilder.FromAppSettings().WithoutDefaultHandlers();
// ...

to

// ...
appBuilder.AddKernelMemory(memoryBuilder =>
{
    memoryBuilder.FromAppSettings().WithoutDefaultHandlers();
    memoryBuilder.WithCustomImageOcr<TesseractOcrEngine>();  // <--- add this line
// ...
  • build and run KM service

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by pfigueiredo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
1. Q&A
Labels
None yet
2 participants