kyleleey commited on
Commit
e858b25
β€’
1 Parent(s): 73cfc34

set up docker sdk

Browse files
Files changed (5) hide show
  1. Dockerfile +66 -0
  2. README.md +1 -3
  3. app.py +3 -3
  4. requirements-old.txt +30 -0
  5. requirements.txt +0 -3
Dockerfile ADDED
@@ -0,0 +1,66 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ FROM nvidia/cuda:11.3.1-devel-ubuntu20.04
2
+
3
+ ARG DEBIAN_FRONTEND=noninteractive
4
+
5
+ ENV PYTHONUNBUFFERED=1
6
+
7
+ ENV TORCH_CUDA_ARCH_LIST="6.0 6.1 7.0 7.5 8.0 8.6"
8
+ ENV TCNN_CUDA_ARCHITECTURES=86;80;75;70;61;60
9
+ ENV FORCE_CUDA=1
10
+
11
+ ENV CUDA_HOME=/usr/local/cuda
12
+ ENV PATH=${CUDA_HOME}/bin:/home/${USER_NAME}/.local/bin:${PATH}
13
+ ENV LD_LIBRARY_PATH=${CUDA_HOME}/lib64:${LD_LIBRARY_PATH}
14
+ ENV LIBRARY_PATH=${CUDA_HOME}/lib64/stubs:${LIBRARY_PATH}
15
+
16
+ RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
17
+ build-essential \
18
+ curl \
19
+ git \
20
+ libegl1-mesa-dev \
21
+ libgl1-mesa-dev \
22
+ libgles2-mesa-dev \
23
+ libglib2.0-0 \
24
+ libsm6 \
25
+ libxext6 \
26
+ libxrender1 \
27
+ python-is-python3 \
28
+ python3-dev \
29
+ python3-pip \
30
+ wget \
31
+ && rm -rf /var/lib/apt/lists/*
32
+
33
+ # Set up a new user named "user" with user ID 1000
34
+ RUN useradd -m -u 1000 user
35
+ # Switch to the "user" user
36
+ USER user
37
+ # Set home to the user's home directory
38
+ ENV HOME=/home/user \
39
+ PATH=/home/user/.local/bin:$PATH \
40
+ PYTHONPATH=$HOME/app \
41
+ PYTHONUNBUFFERED=1 \
42
+ GRADIO_ALLOW_FLAGGING=never \
43
+ GRADIO_NUM_PORTS=1 \
44
+ GRADIO_SERVER_NAME=0.0.0.0 \
45
+ GRADIO_THEME=huggingface \
46
+ SYSTEM=spaces
47
+
48
+ RUN pip install --upgrade pip ninja
49
+ RUN pip install setuptools==69.5.1
50
+ RUN pip install torch==1.10+cu113 torchvision==0.11.0+cu113 --extra-index-url https://download.pytorch.org/whl/cu113
51
+
52
+ RUN python -c "import torch; print(torch.version.cuda)"
53
+ COPY requirements.txt /tmp
54
+ RUN cd /tmp && pip install -r requirements.txt
55
+
56
+ RUN git clone -b v0.7.4 https://github.com/facebookresearch/pytorch3d.git /home/user/pytorch3d-0.7.4
57
+ WORKDIR /home/user/pytorch3d-0.7.4
58
+ RUN python setup.py install --user
59
+
60
+ # Set the working directory to the user's home directory
61
+ WORKDIR $HOME/app
62
+
63
+ # Copy the current directory contents into the container at $HOME/app setting the owner to the user
64
+ COPY --chown=user . $HOME/app
65
+
66
+ CMD ["python", "app.py"]
README.md CHANGED
@@ -3,9 +3,7 @@ title: 3DFauna Demo
3
  emoji: πŸ‘€
4
  colorFrom: blue
5
  colorTo: green
6
- sdk: gradio
7
- python_version: 3.9.13
8
- sdk_version: 3.50.2
9
  app_file: app.py
10
  pinned: false
11
  license: cc-by-nc-sa-4.0
 
3
  emoji: πŸ‘€
4
  colorFrom: blue
5
  colorTo: green
6
+ sdk: docker
 
 
7
  app_file: app.py
8
  pinned: false
9
  license: cc-by-nc-sa-4.0
app.py CHANGED
@@ -8,9 +8,9 @@ import sys
8
  import torch
9
 
10
  if os.getenv('SYSTEM') == 'spaces':
11
- os.system('pip install git+https://github.com/NVlabs/tiny-cuda-nn/#subdirectory=bindings/torch')
12
- os.system('pip install fvcore iopath')
13
- os.system('pip install git+https://github.com/facebookresearch/pytorch3d.git')
14
 
15
  import cv2
16
  import time
 
8
  import torch
9
 
10
  if os.getenv('SYSTEM') == 'spaces':
11
+ os.system('pip install --global-option="--no-networks" git+https://github.com/NVlabs/tiny-cuda-nn/#subdirectory=bindings/torch')
12
+ # os.system('pip install fvcore iopath')
13
+ # os.system('pip install "git+https://github.com/facebookresearch/pytorch3d.git"')
14
 
15
  import cv2
16
  import time
requirements-old.txt ADDED
@@ -0,0 +1,30 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ --extra-index-url https://download.pytorch.org/whl/cu113
2
+ torch==1.10+cu113
3
+ torchvision==0.11.0+cu113
4
+ fvcore
5
+ iopath
6
+ ninja
7
+ ConfigArgParse==1.5.3
8
+ einops==0.4.1
9
+ fire==0.5.0
10
+ glfw==2.5.7
11
+ gradio==4.12.0
12
+ imageio==2.27.0
13
+ ipdb==0.13.9
14
+ lpips==0.1.4
15
+ matplotlib==3.8.1
16
+ numpy==1.23.1
17
+ Pillow==9.2.0
18
+ PyOpenGL==3.1.6
19
+ PyYAML==6.0
20
+ scipy==1.9.1
21
+ segment_anything==1.0
22
+ siren_pytorch==0.1.7
23
+ transformers==4.28.1
24
+ trimesh==4.0.0
25
+ wandb==0.14.2
26
+ xatlas==0.0.7
27
+ tensorboard==2.10.0
28
+ git+https://github.com/NVlabs/nvdiffrast/
29
+ opencv-python
30
+ opencv_contrib_python
requirements.txt CHANGED
@@ -1,6 +1,3 @@
1
- --extra-index-url https://download.pytorch.org/whl/cu113
2
- torch==1.10+cu113
3
- torchvision==0.11.0+cu113
4
  fvcore
5
  iopath
6
  ninja
 
 
 
 
1
  fvcore
2
  iopath
3
  ninja