Spaces:
Sleeping
Sleeping
Dharini Baskaran
commited on
Commit
·
5ab334a
1
Parent(s):
8923735
updating docker
Browse files- Dockerfile +8 -9
Dockerfile
CHANGED
|
@@ -1,4 +1,3 @@
|
|
| 1 |
-
# Use Python 3.9 image
|
| 2 |
FROM python:3.9-slim
|
| 3 |
|
| 4 |
# Install system dependencies
|
|
@@ -12,21 +11,21 @@ RUN apt-get update && apt-get install -y \
|
|
| 12 |
ffmpeg \
|
| 13 |
&& rm -rf /var/lib/apt/lists/*
|
| 14 |
|
| 15 |
-
# Install PyTorch
|
| 16 |
-
RUN pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cpu
|
| 17 |
|
| 18 |
-
# Install
|
| 19 |
RUN pip install opencv-python Pillow gdown gradio pycocotools scikit-image shapely
|
| 20 |
|
| 21 |
-
# Install detectron2
|
| 22 |
RUN pip install 'git+https://github.com/facebookresearch/detectron2.git'
|
| 23 |
|
| 24 |
-
#
|
|
|
|
|
|
|
|
|
|
| 25 |
COPY . /app
|
| 26 |
WORKDIR /app
|
| 27 |
|
| 28 |
-
# Set environment variable to avoid matplotlib error
|
| 29 |
-
ENV MPLCONFIGDIR=/tmp/matplotlib
|
| 30 |
-
|
| 31 |
# Run Gradio app
|
| 32 |
CMD ["python3", "app.py"]
|
|
|
|
|
|
|
| 1 |
FROM python:3.9-slim
|
| 2 |
|
| 3 |
# Install system dependencies
|
|
|
|
| 11 |
ffmpeg \
|
| 12 |
&& rm -rf /var/lib/apt/lists/*
|
| 13 |
|
| 14 |
+
# Install PyTorch CPU version
|
| 15 |
+
RUN pip install torch==2.0.1+cpu torchvision==0.15.2+cpu torchaudio==2.0.2+cpu --index-url https://download.pytorch.org/whl/cpu
|
| 16 |
|
| 17 |
+
# Install required Python packages
|
| 18 |
RUN pip install opencv-python Pillow gdown gradio pycocotools scikit-image shapely
|
| 19 |
|
| 20 |
+
# Install detectron2 manually
|
| 21 |
RUN pip install 'git+https://github.com/facebookresearch/detectron2.git'
|
| 22 |
|
| 23 |
+
# Set Matplotlib temp folder
|
| 24 |
+
ENV MPLCONFIGDIR=/tmp/matplotlib
|
| 25 |
+
|
| 26 |
+
# Copy code
|
| 27 |
COPY . /app
|
| 28 |
WORKDIR /app
|
| 29 |
|
|
|
|
|
|
|
|
|
|
| 30 |
# Run Gradio app
|
| 31 |
CMD ["python3", "app.py"]
|