Added NLog-based logging and diagnostics to Console and WPF apps, with programmatic configuration and support for debugger output. Refactored apps to use dependency injection and Microsoft.Extensions.Hosting. Improved output layer extraction and fallback logic in detection/recognition, including objectness-class probability multiplication. Added crop saving for diagnostics. Introduced new CLI options for diagnostics. MainViewModel and MainWindow now use DI and log errors. NumberRecognitionEngine supports logging, crop saving, and robust fallback. Added Python diagnostic script. Improved error handling and argument parsing.
39 lines
No EOL
877 B
Batchfile
39 lines
No EOL
877 B
Batchfile
@echo off
|
|
SET "SCRIPT_PATH=%~f1"
|
|
SET "VENV_DIR=.\venv"
|
|
IF "%SCRIPT_PATH%"=="" (
|
|
echo Usage: %~n0 script.py [args...]
|
|
exit /b 1
|
|
)
|
|
shift
|
|
SET "PARAMS=%*"
|
|
|
|
for %%F in ("%SCRIPT_PATH%") do set "SCRIPT_BASENAME=%%~nxF"
|
|
|
|
setlocal enabledelayedexpansion
|
|
set "NEWPARAMS="
|
|
for %%A in (%PARAMS%) do (
|
|
if /I not "%%~A"=="%SCRIPT_BASENAME%" (
|
|
set "NEWPARAMS=!NEWPARAMS! %%~A"
|
|
)
|
|
)
|
|
endlocal & set "PARAMS=%NEWPARAMS%"
|
|
for /f "tokens=*" %%A in ("%PARAMS%") do set "PARAMS=%%A"
|
|
|
|
|
|
IF NOT EXIST "%VENV_DIR%" (
|
|
py -3.14 -m venv "%VENV_DIR%"
|
|
)
|
|
|
|
call "%VENV_DIR%\Scripts\activate.bat"
|
|
|
|
python -m pip install --upgrade pip setuptools wheel
|
|
pip install --upgrade imutils numpy opencv-python Pillow pytesseract
|
|
|
|
echo Running: python "%SCRIPT_PATH%" %PARAMS%
|
|
echo SCRIPT_PATH=[%SCRIPT_PATH%]
|
|
echo PARAMS=[%PARAMS%]
|
|
|
|
python "%SCRIPT_PATH%" %PARAMS%
|
|
|
|
call "%VENV_DIR%\Scripts\deactivate.bat" |