added training

This commit is contained in:
Boki 2026-02-10 22:56:51 -05:00
parent 528453a321
commit cc50368d3b
7 changed files with 901 additions and 1 deletions

View file

@ -12,11 +12,13 @@ SetProcessDPIAware();
// Pre-create the Tesseract OCR engine (reused across all requests)
var tessdataPath = Path.Combine(AppContext.BaseDirectory, "tessdata");
var tessLang = File.Exists(Path.Combine(tessdataPath, "poe2.traineddata")) ? "poe2" : "eng";
TesseractEngine tessEngine;
try
{
tessEngine = new TesseractEngine(tessdataPath, "eng", EngineMode.LstmOnly);
tessEngine = new TesseractEngine(tessdataPath, tessLang, EngineMode.LstmOnly);
tessEngine.DefaultPageSegMode = PageSegMode.Auto;
Console.Error.WriteLine($"Tesseract engine loaded with language: {tessLang}");
}
catch (Exception ex)
{