Spaces:
Sleeping
Sleeping
Dharini Baskaran
commited on
Commit
·
10bbab5
1
Parent(s):
f48e15f
updating docker
Browse files- Dockerfile +14 -10
- requirements.txt +2 -0
Dockerfile
CHANGED
|
@@ -1,9 +1,11 @@
|
|
| 1 |
FROM python:3.9-slim
|
| 2 |
|
| 3 |
-
# Install system dependencies
|
| 4 |
RUN apt-get update && apt-get install -y \
|
| 5 |
git \
|
| 6 |
gcc \
|
|
|
|
|
|
|
| 7 |
libglib2.0-0 \
|
| 8 |
libsm6 \
|
| 9 |
libxext6 \
|
|
@@ -11,21 +13,23 @@ RUN apt-get update && apt-get install -y \
|
|
| 11 |
ffmpeg \
|
| 12 |
&& rm -rf /var/lib/apt/lists/*
|
| 13 |
|
| 14 |
-
#
|
|
|
|
|
|
|
|
|
|
| 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
|
| 18 |
-
|
|
|
|
|
|
|
| 19 |
|
| 20 |
-
# Install
|
| 21 |
RUN pip install 'git+https://github.com/facebookresearch/detectron2.git'
|
| 22 |
|
| 23 |
-
#
|
| 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"]
|
|
|
|
| 1 |
FROM python:3.9-slim
|
| 2 |
|
| 3 |
+
# --- Install system dependencies ---
|
| 4 |
RUN apt-get update && apt-get install -y \
|
| 5 |
git \
|
| 6 |
gcc \
|
| 7 |
+
g++ \
|
| 8 |
+
build-essential \
|
| 9 |
libglib2.0-0 \
|
| 10 |
libsm6 \
|
| 11 |
libxext6 \
|
|
|
|
| 13 |
ffmpeg \
|
| 14 |
&& rm -rf /var/lib/apt/lists/*
|
| 15 |
|
| 16 |
+
# --- Set environment variables ---
|
| 17 |
+
ENV MPLCONFIGDIR=/tmp/matplotlib
|
| 18 |
+
|
| 19 |
+
# --- Install PyTorch (CPU version) ---
|
| 20 |
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
|
| 21 |
|
| 22 |
+
# --- Install basic Python dependencies ---
|
| 23 |
+
COPY requirements.txt .
|
| 24 |
+
RUN pip install --upgrade pip
|
| 25 |
+
RUN pip install -r requirements.txt
|
| 26 |
|
| 27 |
+
# --- Install Detectron2 ---
|
| 28 |
RUN pip install 'git+https://github.com/facebookresearch/detectron2.git'
|
| 29 |
|
| 30 |
+
# --- Copy app code ---
|
|
|
|
|
|
|
|
|
|
| 31 |
COPY . /app
|
| 32 |
WORKDIR /app
|
| 33 |
|
| 34 |
+
# --- Run the Gradio app ---
|
| 35 |
CMD ["python3", "app.py"]
|
requirements.txt
CHANGED
|
@@ -10,3 +10,5 @@ labelme2coco
|
|
| 10 |
numpy
|
| 11 |
from_root
|
| 12 |
gradio
|
|
|
|
|
|
|
|
|
| 10 |
numpy
|
| 11 |
from_root
|
| 12 |
gradio
|
| 13 |
+
# torch==2.0.1
|
| 14 |
+
# torchvision==0.15.2
|