Spaces:
Sleeping
Sleeping
Dharini Baskaran
commited on
Commit
·
a47b24f
1
Parent(s):
6896129
updating reqs and docker
Browse files- Dockerfile +14 -2
- requirements.txt +0 -4
Dockerfile
CHANGED
|
@@ -1,5 +1,6 @@
|
|
| 1 |
FROM python:3.9-slim
|
| 2 |
|
|
|
|
| 3 |
RUN apt-get update && apt-get install -y \
|
| 4 |
git \
|
| 5 |
gcc \
|
|
@@ -10,14 +11,25 @@ RUN apt-get update && apt-get install -y \
|
|
| 10 |
ffmpeg \
|
| 11 |
&& rm -rf /var/lib/apt/lists/*
|
| 12 |
|
|
|
|
| 13 |
ENV MPLCONFIGDIR=/tmp/matplotlib
|
| 14 |
|
| 15 |
-
|
| 16 |
WORKDIR /app
|
| 17 |
|
|
|
|
|
|
|
| 18 |
RUN pip install --upgrade pip
|
| 19 |
RUN pip install -r requirements.txt
|
| 20 |
|
| 21 |
-
|
|
|
|
| 22 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 23 |
CMD ["python3", "app.py"]
|
|
|
|
| 1 |
FROM python:3.9-slim
|
| 2 |
|
| 3 |
+
# Install system dependencies
|
| 4 |
RUN apt-get update && apt-get install -y \
|
| 5 |
git \
|
| 6 |
gcc \
|
|
|
|
| 11 |
ffmpeg \
|
| 12 |
&& rm -rf /var/lib/apt/lists/*
|
| 13 |
|
| 14 |
+
# Set Matplotlib temp folder
|
| 15 |
ENV MPLCONFIGDIR=/tmp/matplotlib
|
| 16 |
|
| 17 |
+
# Set working directory
|
| 18 |
WORKDIR /app
|
| 19 |
|
| 20 |
+
# Copy requirements first and install them
|
| 21 |
+
COPY requirements.txt .
|
| 22 |
RUN pip install --upgrade pip
|
| 23 |
RUN pip install -r requirements.txt
|
| 24 |
|
| 25 |
+
# Install torch separately (before detectron2)
|
| 26 |
+
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
|
| 27 |
|
| 28 |
+
# Install detectron2 separately
|
| 29 |
+
RUN pip install 'git+https://github.com/facebookresearch/detectron2.git'
|
| 30 |
+
|
| 31 |
+
# Copy full app code
|
| 32 |
+
COPY . .
|
| 33 |
+
|
| 34 |
+
# Run
|
| 35 |
CMD ["python3", "app.py"]
|
requirements.txt
CHANGED
|
@@ -9,7 +9,3 @@ labelme2coco
|
|
| 9 |
numpy
|
| 10 |
from_root
|
| 11 |
gradio==3.50.2
|
| 12 |
-
torch==2.0.1+cpu
|
| 13 |
-
torchvision==0.15.2+cpu
|
| 14 |
-
torchaudio==2.0.2+cpu
|
| 15 |
-
git+https://github.com/facebookresearch/detectron2.git
|
|
|
|
| 9 |
numpy
|
| 10 |
from_root
|
| 11 |
gradio==3.50.2
|
|
|
|
|
|
|
|
|
|
|
|