From 697818845db3c3cd004248a371dcec03e101d892 Mon Sep 17 00:00:00 2001 From: poprhythm Date: Sat, 21 Feb 2026 19:51:49 +0000 Subject: [PATCH] Fix leafweb-vision: patch cv2.destroyAllWindows via sed at startup opencv-python-headless swap doesn't override conda's cv2. Instead, sed-patch the one offending line in streamlit_inference.py directly. --- leafweb-vision/docker-compose.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/leafweb-vision/docker-compose.yml b/leafweb-vision/docker-compose.yml index b717e0a..de204fc 100644 --- a/leafweb-vision/docker-compose.yml +++ b/leafweb-vision/docker-compose.yml @@ -3,7 +3,7 @@ services: image: ultralytics/ultralytics:latest container_name: leafweb-vision restart: unless-stopped - command: bash -c "pip install 'streamlit>=1.29.0' opencv-python-headless -q --root-user-action=ignore && pip uninstall opencv-python -y -q 2>/dev/null; yolo solutions inference" + command: bash -c "pip install 'streamlit>=1.29.0' -q --root-user-action=ignore && sed -i 's/cv2.destroyAllWindows().*$/pass # cv2.destroyAllWindows() disabled in headless/' /ultralytics/ultralytics/solutions/streamlit_inference.py && yolo solutions inference" ports: - "8501:8501" volumes: