File size: 1,228 Bytes
331439c
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
# Use an official Python runtime as a parent image
FROM python:3.8-slim-buster

# Set the working directory in the container
WORKDIR /app

# Install system dependencies
RUN apt-get update && apt-get install -y \
    git \
    build-essential \
    libglib2.0-0 \
    libsm6 \
    libxext6 \
    libxrender-dev \
    libgl1-mesa-glx \
    && rm -rf /var/lib/apt/lists/*

# Install PyTorch, torchvision, and cudatoolkit
RUN pip install torch==1.9.0 torchvision==0.10.0

# Install OpenCV
RUN pip install opencv-python

# Clone and install Detectron2
RUN git clone https://github.com/facebookresearch/detectron2.git \
    && cd detectron2 \
    && pip install -e . \
    && pip install git+https://github.com/cocodataset/panopticapi.git \
    && pip install git+https://github.com/mcordts/cityscapesScripts.git

# Clone and setup MaskDINO
RUN git clone https://github.com/facebookresearch/MaskDINO.git \
    && cd MaskDINO \
    && pip install -r requirements.txt

# Set CUDA_HOME environment variable
ENV CUDA_HOME /usr/local/cuda

# Compile CUDA kernel for MSDeformAttn
RUN cd /app/MaskDINO/maskdino/modeling/pixel_decoder/ops \
    && sh make.sh

# Set the default command to execute
# when creating a new container
CMD ["bash"]