Spaces:
Build error
Build error
Commit ·
331439c
1
Parent(s): 9d427ff
added dockerfile
Browse files- Dockerfile +45 -0
Dockerfile
ADDED
|
@@ -0,0 +1,45 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Use an official Python runtime as a parent image
|
| 2 |
+
FROM python:3.8-slim-buster
|
| 3 |
+
|
| 4 |
+
# Set the working directory in the container
|
| 5 |
+
WORKDIR /app
|
| 6 |
+
|
| 7 |
+
# Install system dependencies
|
| 8 |
+
RUN apt-get update && apt-get install -y \
|
| 9 |
+
git \
|
| 10 |
+
build-essential \
|
| 11 |
+
libglib2.0-0 \
|
| 12 |
+
libsm6 \
|
| 13 |
+
libxext6 \
|
| 14 |
+
libxrender-dev \
|
| 15 |
+
libgl1-mesa-glx \
|
| 16 |
+
&& rm -rf /var/lib/apt/lists/*
|
| 17 |
+
|
| 18 |
+
# Install PyTorch, torchvision, and cudatoolkit
|
| 19 |
+
RUN pip install torch==1.9.0 torchvision==0.10.0
|
| 20 |
+
|
| 21 |
+
# Install OpenCV
|
| 22 |
+
RUN pip install opencv-python
|
| 23 |
+
|
| 24 |
+
# Clone and install Detectron2
|
| 25 |
+
RUN git clone https://github.com/facebookresearch/detectron2.git \
|
| 26 |
+
&& cd detectron2 \
|
| 27 |
+
&& pip install -e . \
|
| 28 |
+
&& pip install git+https://github.com/cocodataset/panopticapi.git \
|
| 29 |
+
&& pip install git+https://github.com/mcordts/cityscapesScripts.git
|
| 30 |
+
|
| 31 |
+
# Clone and setup MaskDINO
|
| 32 |
+
RUN git clone https://github.com/facebookresearch/MaskDINO.git \
|
| 33 |
+
&& cd MaskDINO \
|
| 34 |
+
&& pip install -r requirements.txt
|
| 35 |
+
|
| 36 |
+
# Set CUDA_HOME environment variable
|
| 37 |
+
ENV CUDA_HOME /usr/local/cuda
|
| 38 |
+
|
| 39 |
+
# Compile CUDA kernel for MSDeformAttn
|
| 40 |
+
RUN cd /app/MaskDINO/maskdino/modeling/pixel_decoder/ops \
|
| 41 |
+
&& sh make.sh
|
| 42 |
+
|
| 43 |
+
# Set the default command to execute
|
| 44 |
+
# when creating a new container
|
| 45 |
+
CMD ["bash"]
|