Yuliang commited on
Commit
d04931b
1 Parent(s): 2b7e480

use docker for cuda-11.3

Browse files
Files changed (5) hide show
  1. Dockerfile +78 -0
  2. README.md +1 -3
  3. app.py +0 -14
  4. packages.txt +0 -11
  5. requirements.txt +1 -1
Dockerfile ADDED
@@ -0,0 +1,78 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ FROM nvidia/cuda:11.3.1-devel-ubuntu20.04
2
+
3
+ ARG DEBIAN_FRONTEND=noninteractive
4
+
5
+ # Set up a new user named "user" with user ID 1000
6
+ RUN useradd -m -u 1000 user
7
+ # Switch to the "user" user
8
+ USER user
9
+
10
+ ENV TORCH_CUDA_ARCH_LIST="6.0 6.1 7.0 7.5 8.0 8.6"
11
+ ENV TCNN_CUDA_ARCHITECTURES=86;80;75;70;61;60
12
+ ENV FORCE_CUDA=1
13
+
14
+ RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
15
+ build-essential \
16
+ curl \
17
+ git \
18
+ libegl1-mesa-dev \
19
+ libgl1-mesa-dev \
20
+ libgles2-mesa-dev \
21
+ libglib2.0-0 \
22
+ libsm6 \
23
+ libxext6 \
24
+ libxrender1 \
25
+ python-is-python3 \
26
+ python3.8 \
27
+ python3-pip \
28
+ wget \
29
+ libgl1 \
30
+ freeglut3-dev \
31
+ unzip \
32
+ ffmpeg \
33
+ libgl1-mesa-dri \
34
+ libegl1-mesa \
35
+ libgbm1 \
36
+ libturbojpeg \
37
+ && rm -rf /var/lib/apt/lists/*
38
+
39
+
40
+ ENV CUDA_HOME=/usr/local/cuda
41
+ ENV PATH=${CUDA_HOME}/bin:/home/user/.local/bin:/usr/bin:${PATH}
42
+ ENV LD_LIBRARY_PATH=${CUDA_HOME}/lib64:${LD_LIBRARY_PATH}
43
+ ENV LIBRARY_PATH=${CUDA_HOME}/lib64/stubs:${LIBRARY_PATH}
44
+
45
+ # Set home to the user's home directory
46
+ ENV HOME=/home/user \
47
+ PYTHONPATH=$HOME/app \
48
+ PYTHONUNBUFFERED=1 \
49
+ GRADIO_ALLOW_FLAGGING=never \
50
+ GRADIO_NUM_PORTS=1 \
51
+ GRADIO_SERVER_NAME=0.0.0.0 \
52
+ GRADIO_THEME=huggingface \
53
+ SYSTEM=spaces
54
+
55
+ FROM python:3.8
56
+
57
+ RUN pip install --upgrade pip ninja
58
+ RUN pip install setuptools==69.5.1
59
+ RUN pip install torch==1.11.0+cu113 torchvision==0.12.0+cu113 -f https://download.pytorch.org/whl/cu113/torch_stable.html
60
+
61
+ RUN python -c "import torch; print(torch.version.cuda)"
62
+ COPY requirements.txt /tmp
63
+ RUN cd /tmp && pip install -r requirements.txt --user
64
+
65
+ RUN git clone git+https://github.com/YuliangXiu/neural_voxelization_layer.git /home/user/neural_voxelization_layer
66
+ WORKDIR /home/user/neural_voxelization_layer
67
+ RUN python setup.py install --user
68
+
69
+ RUN pip install https://download.is.tue.mpg.de/icon/HF/kaolin-0.11.0-cp38-cp38-linux_x86_64.whl
70
+ RUN pip install https://download.is.tue.mpg.de/icon/HF/pytorch3d-0.7.0-cp38-cp38-linux_x86_64.whl
71
+
72
+ # Set the working directory to the user's home directory
73
+ WORKDIR $HOME/app
74
+
75
+ # Copy the current directory contents into the container at $HOME/app setting the owner to the user
76
+ COPY --chown=user . $HOME/app
77
+
78
+ CMD ["python", "app.py"]
README.md CHANGED
@@ -4,11 +4,9 @@ metaTitle: Making yourself an ICON, by Yuliang Xiu
4
  emoji: 🤼
5
  colorFrom: indigo
6
  colorTo: yellow
7
- sdk: gradio
8
- sdk_version: 4.36.1
9
  app_file: app.py
10
  pinned: true
11
- python_version: 3.8.13
12
  ---
13
 
14
  # ICON Clothed Human Digitization
 
4
  emoji: 🤼
5
  colorFrom: indigo
6
  colorTo: yellow
7
+ sdk: docker
 
8
  app_file: app.py
9
  pinned: true
 
10
  ---
11
 
12
  # ICON Clothed Human Digitization
app.py CHANGED
@@ -3,22 +3,8 @@
3
 
4
  import glob
5
  import gradio as gr
6
- import os
7
  import numpy as np
8
 
9
- import subprocess
10
-
11
- if os.getenv('SYSTEM') == 'spaces':
12
- subprocess.run('pip install pyembree'.split())
13
- subprocess.run(
14
- 'pip install torch==1.11.0+cu113 torchvision==0.12.0+cu113 -f https://download.pytorch.org/whl/cu113/torch_stable.html'.split())
15
- subprocess.run(
16
- 'pip install https://download.is.tue.mpg.de/icon/HF/kaolin-0.11.0-cp38-cp38-linux_x86_64.whl'.split())
17
- subprocess.run(
18
- 'pip install https://download.is.tue.mpg.de/icon/HF/pytorch3d-0.7.0-cp38-cp38-linux_x86_64.whl'.split())
19
- subprocess.run(
20
- 'pip install git+https://github.com/YuliangXiu/neural_voxelization_layer.git'.split())
21
-
22
  from apps.infer import generate_model
23
 
24
  # running
 
3
 
4
  import glob
5
  import gradio as gr
 
6
  import numpy as np
7
 
 
 
 
 
 
 
 
 
 
 
 
 
 
8
  from apps.infer import generate_model
9
 
10
  # running
packages.txt DELETED
@@ -1,11 +0,0 @@
1
- libgl1
2
- freeglut3-dev
3
- unzip
4
- ffmpeg
5
- libsm6
6
- libxext6
7
- libgl1-mesa-dri
8
- libegl1-mesa
9
- libgbm1
10
- build-essential
11
- libturbojpeg
 
 
 
 
 
 
 
 
 
 
 
 
requirements.txt CHANGED
@@ -25,4 +25,4 @@ iopath
25
  fvcore
26
  chumpy
27
  open3d
28
- git+https://github.com/YuliangXiu/rembg.git
 
25
  fvcore
26
  chumpy
27
  open3d
28
+ git+https://github.com/YuliangXiu/rembg.git