finished easyocr and pipeline

This commit is contained in:
Boki 2026-02-12 11:24:31 -05:00
parent 735b6f7157
commit cf5d944fd1
8 changed files with 252 additions and 51 deletions

View file

@ -455,6 +455,12 @@
<select id="ocrEngineSelect" onchange="setOcrEngine(this.value)" style="padding:6px 10px;background:#0d1117;border:1px solid #30363d;border-radius:6px;color:#e6edf3;font-size:13px">
<option value="tesseract">Tesseract</option>
<option value="easyocr">EasyOCR</option>
<option value="paddleocr">PaddleOCR</option>
</select>
<select id="ocrPreprocessSelect" onchange="setOcrPreprocess(this.value)" style="padding:6px 10px;background:#0d1117;border:1px solid #30363d;border-radius:6px;color:#e6edf3;font-size:13px">
<option value="none">No Preprocess</option>
<option value="bgsub" selected>BgSub</option>
<option value="tophat">TopHat</option>
</select>
<button onclick="debugScreenshot()">Screenshot</button>
<button onclick="debugOcr()">OCR Screen</button>
@ -1004,8 +1010,27 @@
} catch {}
}
async function setOcrPreprocess(preprocess) {
await fetch('/api/debug/ocr-preprocess', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ preprocess }),
});
}
async function loadOcrPreprocess() {
try {
const res = await fetch('/api/debug/ocr-preprocess');
const data = await res.json();
if (data.ok && data.preprocess) {
document.getElementById('ocrPreprocessSelect').value = data.preprocess;
}
} catch {}
}
connect();
loadOcrEngine();
loadOcrPreprocess();
</script>
</body>
</html>