49 lines
1.0 KiB
Batchfile
49 lines
1.0 KiB
Batchfile
@echo off
|
|
chcp 65001 > nul
|
|
title Tesseract Web GUI
|
|
|
|
:: Path to project folder
|
|
set "APP_DIR=%~dp0"
|
|
cd /d "%APP_DIR%" || exit /b 1
|
|
|
|
:: Find Python
|
|
for %%P in (python python3 py) do (
|
|
%%P --version >nul 2>nul
|
|
if not errorlevel 1 (
|
|
set "PYTHON=%%P"
|
|
goto :found_python
|
|
)
|
|
)
|
|
echo [ERROR] Python not found. Install Python 3.10+ and add it to PATH.
|
|
pause
|
|
exit /b 1
|
|
|
|
:found_python
|
|
echo [OK] Python: %PYTHON%
|
|
|
|
:: Install deps
|
|
echo [1/3] Installing dependencies...
|
|
%PYTHON% -m pip install -q flask pillow pytesseract
|
|
if errorlevel 1 (
|
|
echo [ERROR] Failed to install dependencies.
|
|
pause
|
|
exit /b 1
|
|
)
|
|
|
|
:: Check Tesseract
|
|
if not exist "C:\Program Files\Tesseract-OCR\tesseract.exe" (
|
|
echo [WARNING] Tesseract not found at C:\Program Files\Tesseract-OCR\tesseract.exe
|
|
echo Install: winget install UB-Mannheim.TesseractOCR
|
|
pause
|
|
exit /b 1
|
|
)
|
|
echo [OK] Tesseract found
|
|
|
|
:: Start
|
|
echo [2/3] Starting web service...
|
|
echo [3/3] Open browser: http://127.0.0.1:5000/
|
|
echo.
|
|
%PYTHON% app.py
|
|
|
|
pause
|