697818845d
opencv-python-headless swap doesn't override conda's cv2. Instead, sed-patch the one offending line in streamlit_inference.py directly.
34 lines
980 B
YAML
34 lines
980 B
YAML
services:
|
|
leafweb-vision:
|
|
image: ultralytics/ultralytics:latest
|
|
container_name: leafweb-vision
|
|
restart: unless-stopped
|
|
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:
|
|
- /srv/leafweb-vision/data:/data
|
|
- /srv/leafweb-vision/runs:/root/runs
|
|
- pip_cache:/root/.cache/pip
|
|
deploy:
|
|
resources:
|
|
reservations:
|
|
devices:
|
|
- driver: nvidia
|
|
count: all
|
|
capabilities: [gpu]
|
|
environment:
|
|
- TZ=America/New_York
|
|
- STREAMLIT_SERVER_ADDRESS=0.0.0.0
|
|
- STREAMLIT_SERVER_PORT=8501
|
|
- STREAMLIT_SERVER_HEADLESS=true
|
|
networks:
|
|
- npm-network
|
|
|
|
networks:
|
|
npm-network:
|
|
external: true
|
|
|
|
volumes:
|
|
pip_cache:
|