# Install romatch in editable mode and ensure OpenCV has GUI (cv2.imshow) on Windows.
# albumentations may pull opencv-python-headless; we remove it and keep opencv-python.

$ErrorActionPreference = "Stop"
Set-Location $PSScriptRoot\..

Write-Host "==> pip install -e ."
python -m pip install -e .

Write-Host "==> Remove opencv-python-headless (if present)"
python -m pip uninstall -y opencv-python-headless 2>$null

Write-Host "==> Ensure opencv-python (GUI)"
python -m pip install --upgrade opencv-python

Write-Host "==> Quick check"
python -c "import cv2; cv2.namedWindow('_t'); cv2.destroyAllWindows(); print('OpenCV GUI OK:', cv2.__version__)"
