# Base image for debugging Python environment # Build: docker build -f Dockerfile.base -t cvat.pth.mmseg.coralscopsegformer.base:latest . # Debug: docker run -it --gpus all cvat.pth.mmseg.coralscopsegformer.base:latest python -c "from main import handler; print('OK')" FROM pytorch/pytorch:2.7.0-cuda12.8-cudnn9-runtime # Environment Variables ENV NVIDIA_VISIBLE_DEVICES=all \ NVIDIA_DRIVER_CAPABILITIES=compute,utility \ DEBIAN_FRONTEND=noninteractive # System Dependencies RUN apt-get update && apt-get install -y \ git \ libgl1-mesa-glx \ libglib2.0-0 \ --no-install-recommends && \ rm -rf /var/lib/apt/lists/* # Work Directory WORKDIR /opt/nuclio # Python Package Installation # Note: Using custom index for CUDA 12.8 compatible mmcv RUN pip install --extra-index-url https://miropsota.github.io/torch_packages_builder \ mmcv==2.2.0+pt2.7.0cu128 mmengine mmsegmentation>=1.0.0 torch==2.7.0 # Install DINOv2 without dependencies to bypass version conflicts RUN pip install --no-cache-dir git+https://github.com/facebookresearch/dinov2.git --no-deps RUN pip install --no-cache-dir \ fvcore==0.1.5.post20221221 \ iopath==0.1.10 \ omegaconf==2.3.0 \ submitit==1.5.1 \ torchmetrics==1.4.0 \ xformers==0.0.30 ftfy regex scikit-learn matplotlib pycocotools # Workaround for MMCV version compatibility ENV TORCH_FORCE_NO_WEIGHTS_ONLY_LOAD=1 RUN sed -i "s/MMCV_MAX = '2.2.0'/MMCV_MAX = '2.3.0'/" /opt/conda/lib/python3.11/site-packages/mmseg/__init__.py # Copy application code COPY . . # Download pre-trained models ADD https://storage.googleapis.com/public_model_repo/dinov2_vitb14_coralsegv4_ms_config_segformer/dinov2_vitb14_coralsegv4_ms_config_segformer.py ./best_segformer_config.py ADD https://storage.googleapis.com/public_model_repo/dinov2_vitb14_coralsegv4_ms_config_segformer/best_mIoU_epoch_140.pth ./best_segformer.pth ADD https://storage.googleapis.com/public_model_repo/vit_b_coralscop.pth ./