@echo off setlocal EnableExtensions EnableDelayedExpansion cd /d "%~dp0" echo === Vitrine installer (Mode B) === echo Staged install so paddleocr (Pillow^>=10) and iopaint can coexist. echo. REM --- 1. Create venv --- where py >nul 2>&1 && ( py -3.11 -m venv .venv 2>nul || py -3 -m venv .venv ) || python -m venv .venv if not exist ".venv\Scripts\python.exe" ( echo ERROR: Failed to create .venv exit /b 1 ) call .venv\Scripts\activate.bat REM --- 2. Upgrade pip / setuptools / wheel --- echo [1/6] Upgrading pip, setuptools, wheel ... python -m pip install --upgrade pip setuptools wheel if errorlevel 1 ( echo ERROR: pip/setuptools/wheel upgrade failed. exit /b 1 ) REM --- 3. Root editable install (desktop + pipeline + api) --- REM `run_vitrine.bat` runs `python -m vitrine_desktop`. That module lives under REM desktop\ and is only importable after `pip install -e .` at the repo root REM (pyproject finds packages under packages\pipeline, desktop, and api). REM Installing only packages\pipeline leaves "No module named vitrine_desktop". echo [2/6] Installing repo root editable package (desktop + pipeline + api) ... pip install -e . if errorlevel 1 ( echo ERROR: root editable install failed. exit /b 1 ) pip install -r requirements.txt if errorlevel 1 ( echo ERROR: requirements.txt install failed. exit /b 1 ) REM --- 4. OCR stack (needs Pillow^>=10 and numpy^<2) --- echo [3/6] Installing paddlepaddle / paddleocr ... pip install paddlepaddle==2.6.2 paddleocr==2.7.3 "numpy<2" if errorlevel 1 ( echo ERROR: paddlepaddle/paddleocr install failed. exit /b 1 ) REM --- 5. Offline translation --- echo [4/6] Installing argostranslate ... pip install argostranslate if errorlevel 1 ( echo ERROR: argostranslate install failed. exit /b 1 ) REM --- 6. IOPaint without Pillow==9.5.0 pin (conflicts with paddleocr) --- echo [5/6] Installing iopaint --no-deps (keeps Pillow^>=10 for paddleocr) ... pip install iopaint --no-deps if errorlevel 1 ( echo ERROR: iopaint --no-deps install failed. exit /b 1 ) echo [6/6] Installing iopaint runtime deps EXCEPT Pillow pin ... REM Skip Pillow==9.5.0 (iopaint pin) and skip fastapi/uvicorn pins that would REM downgrade the control-plane stack. Gradio is web-UI only; not needed for REM `python -m iopaint run --model=lama`. opencv-python-headless already in REM requirements.txt — do not install opencv-python alongside it. pip install "torch>=2.0.0" "diffusers==0.27.2" "huggingface-hub==0.25.2" accelerate "peft==0.7.1" "transformers>=4.39.1" safetensors "controlnet-aux==0.0.3" python-multipart "python-socketio==5.7.2" typer rich loguru yacs "piexif==1.1.3" omegaconf easydict "typer-config==1.4.0" packaging if errorlevel 1 ( echo ERROR: iopaint runtime dependency install failed. exit /b 1 ) REM Re-assert paddle-compatible Pillow / numpy / protobuf after any transitive pulls. REM iopaint/transformers can pull protobuf 7.x; paddlepaddle==2.6.2 needs <=3.20.2. pip install "Pillow>=10" "numpy<2" "protobuf<=3.20.2,>=3.1.0" if errorlevel 1 ( echo ERROR: Pillow/numpy/protobuf re-pin failed. exit /b 1 ) echo. echo Done. Use run_vitrine.bat echo Owner email: pejman_parsa47@yahoo.com exit /b 0