Spaces:
Runtime error
Runtime error
Update Dockerfile
Browse files- Dockerfile +5 -27
Dockerfile
CHANGED
|
@@ -1,27 +1,8 @@
|
|
| 1 |
-
# Use a
|
| 2 |
-
FROM
|
| 3 |
|
| 4 |
-
# Install
|
| 5 |
-
RUN
|
| 6 |
-
git \
|
| 7 |
-
ffmpeg \
|
| 8 |
-
libsm6 \
|
| 9 |
-
libxext6 \
|
| 10 |
-
cmake \
|
| 11 |
-
gcc \
|
| 12 |
-
g++ \
|
| 13 |
-
ninja-build \
|
| 14 |
-
libgl1-mesa-glx \
|
| 15 |
-
&& rm -rf /var/lib/apt/lists/*
|
| 16 |
-
|
| 17 |
-
# Upgrade pip
|
| 18 |
-
RUN pip install --no-cache-dir --upgrade pip
|
| 19 |
-
|
| 20 |
-
# Install PyTorch and torchvision explicitly before Detectron2
|
| 21 |
-
RUN pip install --no-cache-dir torch==1.13.1+cpu torchvision==0.14.1+cpu -f https://download.pytorch.org/whl/torch_stable.html
|
| 22 |
-
|
| 23 |
-
# Install Detectron2
|
| 24 |
-
RUN python -m pip install git+https://github.com/facebookresearch/detectron2.git
|
| 25 |
|
| 26 |
# Set the working directory
|
| 27 |
WORKDIR /app
|
|
@@ -29,10 +10,7 @@ WORKDIR /app
|
|
| 29 |
# Copy application files
|
| 30 |
COPY . .
|
| 31 |
|
| 32 |
-
#
|
| 33 |
-
RUN pip install --no-cache-dir -r requirements.txt
|
| 34 |
-
|
| 35 |
-
# Expose the port for Gradio
|
| 36 |
EXPOSE 7860
|
| 37 |
|
| 38 |
# Run the application
|
|
|
|
| 1 |
+
# Use a pre-built Detectron2 image
|
| 2 |
+
FROM detectron2/detectron2:v0.6-cpu
|
| 3 |
|
| 4 |
+
# Install additional dependencies
|
| 5 |
+
RUN pip install --no-cache-dir gradio opencv-python Pillow numpy requests
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 6 |
|
| 7 |
# Set the working directory
|
| 8 |
WORKDIR /app
|
|
|
|
| 10 |
# Copy application files
|
| 11 |
COPY . .
|
| 12 |
|
| 13 |
+
# Expose port for Gradio
|
|
|
|
|
|
|
|
|
|
| 14 |
EXPOSE 7860
|
| 15 |
|
| 16 |
# Run the application
|