Spaces:
Build error
Build error
Update Dockerfile
Browse files- Dockerfile +8 -10
Dockerfile
CHANGED
|
@@ -102,11 +102,8 @@ RUN pip install --no-cache-dir segment-anything==1.0 && \
|
|
| 102 |
pip install -e . && \
|
| 103 |
cd ..
|
| 104 |
|
| 105 |
-
#
|
| 106 |
-
RUN
|
| 107 |
-
cd GroundingDINO && \
|
| 108 |
-
pip install -e . && \
|
| 109 |
-
cd ..
|
| 110 |
|
| 111 |
# Create a custom setup.py for GroundingDINO extension
|
| 112 |
RUN echo "from setuptools import setup\n\
|
|
@@ -117,18 +114,19 @@ setup(\n\
|
|
| 117 |
ext_modules=[\n\
|
| 118 |
CUDAExtension(\n\
|
| 119 |
name='_C',\n\
|
| 120 |
-
sources=['/home/user/
|
| 121 |
),\n\
|
| 122 |
],\n\
|
| 123 |
cmdclass={\n\
|
| 124 |
'build_ext': BuildExtension\n\
|
| 125 |
}\n\
|
| 126 |
-
)" > /home/user/
|
| 127 |
|
| 128 |
# Compile the GroundingDINO custom C++ operations
|
| 129 |
-
RUN cd /home/user
|
| 130 |
-
python
|
| 131 |
-
|
|
|
|
| 132 |
|
| 133 |
# Upgrade pip and install Gradio
|
| 134 |
RUN python3 -m pip install --no-cache-dir gradio
|
|
|
|
| 102 |
pip install -e . && \
|
| 103 |
cd ..
|
| 104 |
|
| 105 |
+
# Install GroundingDINO via pip
|
| 106 |
+
RUN pip install --no-cache-dir git+https://github.com/IDEA-Research/GroundingDINO.git
|
|
|
|
|
|
|
|
|
|
| 107 |
|
| 108 |
# Create a custom setup.py for GroundingDINO extension
|
| 109 |
RUN echo "from setuptools import setup\n\
|
|
|
|
| 114 |
ext_modules=[\n\
|
| 115 |
CUDAExtension(\n\
|
| 116 |
name='_C',\n\
|
| 117 |
+
sources=['/home/user/.local/lib/python3.10/site-packages/groundingdino/models/GroundingDINO/csrc/ms_deform_attn.cpp', '/home/user/.local/lib/python3.10/site-packages/groundingdino/models/GroundingDINO/csrc/ms_deform_attn_cuda.cu'],\n\
|
| 118 |
),\n\
|
| 119 |
],\n\
|
| 120 |
cmdclass={\n\
|
| 121 |
'build_ext': BuildExtension\n\
|
| 122 |
}\n\
|
| 123 |
+
)" > /home/user/setup_groundingdino.py
|
| 124 |
|
| 125 |
# Compile the GroundingDINO custom C++ operations
|
| 126 |
+
RUN cd /home/user && \
|
| 127 |
+
python setup_groundingdino.py build_ext --inplace && \
|
| 128 |
+
rm setup_groundingdino.py
|
| 129 |
+
|
| 130 |
|
| 131 |
# Upgrade pip and install Gradio
|
| 132 |
RUN python3 -m pip install --no-cache-dir gradio
|