requirements.txt changes
Browse files- Dockerfile +19 -53
- requirements.txt +0 -5
Dockerfile
CHANGED
@@ -1,61 +1,27 @@
|
|
1 |
-
FROM
|
2 |
-
CMD nvidia-smi
|
3 |
|
4 |
-
|
5 |
-
RUN apt-get update && apt-get install -y \
|
6 |
-
git \
|
7 |
-
make build-essential libssl-dev zlib1g-dev \
|
8 |
-
libbz2-dev libreadline-dev libsqlite3-dev wget curl llvm \
|
9 |
-
libncursesw5-dev xz-utils tk-dev libxml2-dev libxmlsec1-dev libffi-dev liblzma-dev \
|
10 |
-
ffmpeg libsm6 libxext6 cmake libgl1-mesa-glx \
|
11 |
-
&& rm -rf /var/lib/apt/lists/*
|
12 |
-
|
13 |
-
RUN useradd -ms /bin/bash user
|
14 |
-
USER user
|
15 |
|
16 |
-
|
17 |
-
|
|
|
|
|
|
|
18 |
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
pyenv global 3.8.15 && \
|
23 |
-
pyenv rehash && \
|
24 |
-
pip install --no-cache-dir --upgrade pip setuptools wheel
|
25 |
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
RUN chmod -R 777 $WORKDIR
|
30 |
|
31 |
-
|
32 |
-
|
33 |
-
RUN pip install
|
34 |
|
|
|
35 |
COPY . .
|
36 |
|
37 |
-
|
38 |
-
|
39 |
-
USER root
|
40 |
-
RUN chown -R user:user $HOME
|
41 |
-
RUN chmod -R 777 $HOME
|
42 |
-
RUN chown -R user:user $WORKDIR
|
43 |
-
RUN chmod -R 777 $WORKDIR
|
44 |
-
|
45 |
-
USER user
|
46 |
-
RUN ln -s $WORKDIR/oneformer/modeling/pixel_decoder/ops/ $WORKDIR/ && ls && cd ops/ && FORCE_CUDA=1 python setup.py build --build-base=$WORKDIR/ install --user && cd ..
|
47 |
-
RUN sh deform_setup.sh
|
48 |
-
|
49 |
-
USER user
|
50 |
-
RUN sh deform_setup.sh
|
51 |
-
|
52 |
-
RUN mkdir -p examples
|
53 |
-
RUN wget https://praeclarumjj3.github.io/files/ade20k.jpeg -P $WORKDIR/examples/
|
54 |
-
RUN wget https://praeclarumjj3.github.io/files/cityscapes.png -P $WORKDIR/examples/
|
55 |
-
RUN wget https://praeclarumjj3.github.io/files/coco.jpeg -P $WORKDIR/examples/
|
56 |
-
|
57 |
-
USER user
|
58 |
-
|
59 |
-
EXPOSE 7860
|
60 |
-
|
61 |
-
ENTRYPOINT ["python", "gradio_app.py"]
|
|
|
1 |
+
FROM python:3.10
|
|
|
2 |
|
3 |
+
WORKDIR /app
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4 |
|
5 |
+
# Install system dependencies
|
6 |
+
RUN apt-get update && apt-get install -y \
|
7 |
+
git \
|
8 |
+
build-essential \
|
9 |
+
&& rm -rf /var/lib/apt/lists/*
|
10 |
|
11 |
+
# Install torch CPU version first
|
12 |
+
RUN pip install torch==2.0.1+cpu torchvision==0.15.2+cpu torchaudio==2.0.2+cpu \
|
13 |
+
--extra-index-url https://download.pytorch.org/whl/cpu
|
|
|
|
|
|
|
14 |
|
15 |
+
# Clone and install detectron2
|
16 |
+
RUN git clone https://github.com/facebookresearch/detectron2 && \
|
17 |
+
pip install -e detectron2
|
|
|
18 |
|
19 |
+
# Copy requirements and install
|
20 |
+
COPY requirements.txt .
|
21 |
+
RUN pip install -r requirements.txt
|
22 |
|
23 |
+
# Copy app files
|
24 |
COPY . .
|
25 |
|
26 |
+
# Run the app
|
27 |
+
CMD ["python", "app.py"]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
requirements.txt
CHANGED
@@ -1,12 +1,7 @@
|
|
1 |
-
--extra-index-url https://download.pytorch.org/whl/cpu
|
2 |
|
3 |
# Core dependencies - PyTorch first
|
4 |
-
torch==2.0.1+cpu
|
5 |
-
torchvision==0.15.2+cpu
|
6 |
-
torchaudio==2.0.2+cpu
|
7 |
|
8 |
# CRITICAL: Use pre-built detectron2 wheel for torch 2.0 CPU
|
9 |
-
detectron2 -f https://dl.fbaipublicfiles.com/detectron2/wheels/cpu/torch2.0/index.html
|
10 |
|
11 |
# Rest of your dependencies
|
12 |
numpy>=1.23.0
|
|
|
|
|
1 |
|
2 |
# Core dependencies - PyTorch first
|
|
|
|
|
|
|
3 |
|
4 |
# CRITICAL: Use pre-built detectron2 wheel for torch 2.0 CPU
|
|
|
5 |
|
6 |
# Rest of your dependencies
|
7 |
numpy>=1.23.0
|