test dockerized version
Browse files- Dockerfile +49 -0
- README.md +1 -3
- requirements.txt +0 -8
Dockerfile
ADDED
@@ -0,0 +1,49 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
FROM pytorch/pytorch:2.0.1-cuda11.7-cudnn8-runtime
|
2 |
+
|
3 |
+
ENV DEBIAN_FRONTEND=noninteractive
|
4 |
+
|
5 |
+
RUN apt-get update && apt-get install -y \
|
6 |
+
git make build-essential libssl-dev zlib1g-dev libbz2-dev libreadline-dev \
|
7 |
+
libsqlite3-dev wget curl llvm libncursesw5-dev xz-utils tk-dev libxml2-dev \
|
8 |
+
libxmlsec1-dev libffi-dev liblzma-dev git-lfs ffmpeg libsm6 libxext6 cmake \
|
9 |
+
libgl1-mesa-glx \
|
10 |
+
&& rm -rf /var/lib/apt/lists/* && git lfs install
|
11 |
+
|
12 |
+
RUN useradd -m -u 1000 user
|
13 |
+
|
14 |
+
USER user
|
15 |
+
|
16 |
+
ENV HOME=/home/user \
|
17 |
+
PATH=/home/user/.local/bin:$PATH \
|
18 |
+
PYTHONPATH=$HOME/app \
|
19 |
+
PYTHONUNBUFFERED=1 \
|
20 |
+
GRADIO_ALLOW_FLAGGING=never \
|
21 |
+
GRADIO_NUM_PORTS=1 \
|
22 |
+
GRADIO_SERVER_NAME=0.0.0.0 \
|
23 |
+
GRADIO_THEME=huggingface \
|
24 |
+
GRADIO_SHARE=False \
|
25 |
+
SYSTEM=spaces
|
26 |
+
|
27 |
+
# Set the working directory to the user's home directory
|
28 |
+
WORKDIR $HOME/app
|
29 |
+
|
30 |
+
# Install specific versions of PyTorch and TorchVision
|
31 |
+
RUN pip install torch==2.0.1+cu117 torchvision==0.15.2+cu117 -f https://download.pytorch.org/whl/torch_stable.html
|
32 |
+
|
33 |
+
# Install dependencies
|
34 |
+
RUN pip install --no-cache-dir gradio==3.50.2 opencv-python supervision
|
35 |
+
|
36 |
+
# Install SAM and Detectron2
|
37 |
+
RUN pip install 'git+https://github.com/facebookresearch/segment-anything.git'
|
38 |
+
RUN pip install 'git+https://github.com/facebookresearch/detectron2.git'
|
39 |
+
|
40 |
+
COPY app.py .
|
41 |
+
|
42 |
+
RUN find $HOME/app
|
43 |
+
|
44 |
+
# Set the environment variable to specify the GPU device
|
45 |
+
ENV CUDA_DEVICE_ORDER=PCI_BUS_ID
|
46 |
+
ENV CUDA_VISIBLE_DEVICES=0
|
47 |
+
|
48 |
+
# Run your app.py script
|
49 |
+
CMD ["python", "app.py"]
|
README.md
CHANGED
@@ -3,9 +3,7 @@ title: SoM
|
|
3 |
emoji: 👁
|
4 |
colorFrom: pink
|
5 |
colorTo: yellow
|
6 |
-
sdk:
|
7 |
-
sdk_version: 3.50.2
|
8 |
-
app_file: app.py
|
9 |
pinned: false
|
10 |
license: mit
|
11 |
---
|
|
|
3 |
emoji: 👁
|
4 |
colorFrom: pink
|
5 |
colorTo: yellow
|
6 |
+
sdk: docker
|
|
|
|
|
7 |
pinned: false
|
8 |
license: mit
|
9 |
---
|
requirements.txt
DELETED
@@ -1,8 +0,0 @@
|
|
1 |
-
--extra-index-url https://download.pytorch.org/whl/cu118
|
2 |
-
torch
|
3 |
-
torchvision
|
4 |
-
|
5 |
-
supervision
|
6 |
-
gradio==3.50.2
|
7 |
-
git+https://github.com/facebookresearch/segment-anything.git
|
8 |
-
git+https://github.com/facebookresearch/detectron2.git
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|