Spaces:
Sleeping
Sleeping
Update Dockerfile
Browse files- Dockerfile +22 -0
Dockerfile
CHANGED
@@ -108,6 +108,28 @@ RUN git clone https://github.com/IDEA-Research/GroundingDINO.git && \
|
|
108 |
pip install -e . && \
|
109 |
cd ..
|
110 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
111 |
# Upgrade pip and install Gradio
|
112 |
RUN python3 -m pip install --no-cache-dir gradio
|
113 |
|
|
|
108 |
pip install -e . && \
|
109 |
cd ..
|
110 |
|
111 |
+
# Create a custom setup.py for GroundingDINO extension
|
112 |
+
RUN echo "from setuptools import setup\n\
|
113 |
+
from torch.utils.cpp_extension import BuildExtension, CUDAExtension\n\
|
114 |
+
\n\
|
115 |
+
setup(\n\
|
116 |
+
name='groundingdino',\n\
|
117 |
+
ext_modules=[\n\
|
118 |
+
CUDAExtension(\n\
|
119 |
+
name='_C',\n\
|
120 |
+
sources=['/home/user/GroundingDINO/groundingdino/models/GroundingDINO/csrc/ms_deform_attn.cpp', '/home/user/GroundingDINO/groundingdino/models/GroundingDINO/csrc/ms_deform_attn_cuda.cu'],\n\
|
121 |
+
),\n\
|
122 |
+
],\n\
|
123 |
+
cmdclass={\n\
|
124 |
+
'build_ext': BuildExtension\n\
|
125 |
+
}\n\
|
126 |
+
)" > /home/user/GroundingDINO/groundingdino/models/GroundingDINO/csrc/setup.py
|
127 |
+
|
128 |
+
# Compile the GroundingDINO custom C++ operations
|
129 |
+
RUN cd /home/user/GroundingDINO/groundingdino/models/GroundingDINO/csrc && \
|
130 |
+
python setup.py build_ext --inplace && \
|
131 |
+
cd /home/user/app
|
132 |
+
|
133 |
# Upgrade pip and install Gradio
|
134 |
RUN python3 -m pip install --no-cache-dir gradio
|
135 |
|