File size: 695 Bytes
3f4a2a2
 
 
 
 
 
 
 
 
 
 
 
 
d68e573
 
 
 
 
 
 
 
3f4a2a2
 
d68e573
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# Install dependencies
RUN apt-get update && apt-get install -y \
    python3-dev \
    build-essential \
    libjpeg-dev \
    zlib1g-dev \
    libpng-dev \
    libglib2.0-0 \
    libsm6 \
    libxrender1 \
    libxext6 \
    && rm -rf /var/lib/apt/lists/*


# Install dependencies including torch first
RUN pip install --no-cache-dir torch torchvision --extra-index-url https://download.pytorch.org/whl/cpu

# Then, install other requirements
COPY --mount=target=/tmp/requirements.txt,source=requirements.txt /tmp/requirements.txt
RUN pip install --no-cache-dir -r /tmp/requirements.txt


# Install Detectron2 from source
RUN pip install 'git+https://github.com/facebookresearch/detectron2.git