Spaces:
Runtime error
Runtime error
changed to docker
Browse files- Dockerfile +49 -0
- README.md +2 -3
- app.py +6 -6
- requirements.txt +1 -1
Dockerfile
ADDED
@@ -0,0 +1,49 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
FROM nvidia/cuda:11.8.0-devel-ubuntu22.04
|
2 |
+
|
3 |
+
ENV LANG=C.UTF-8 LC_ALL=C.UTF-8
|
4 |
+
ENV TZ=America/Los_Angeles
|
5 |
+
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
|
6 |
+
RUN apt-get update && apt-get install -y --no-install-recommends \
|
7 |
+
git \
|
8 |
+
git-lfs \
|
9 |
+
python3 \
|
10 |
+
python3-pip \
|
11 |
+
python3-setuptools \
|
12 |
+
python3-wheel \
|
13 |
+
python3-dev \
|
14 |
+
cmake \
|
15 |
+
unzip \
|
16 |
+
vim \
|
17 |
+
ffmpeg \
|
18 |
+
curl \
|
19 |
+
wget \
|
20 |
+
libgl1-mesa-glx \
|
21 |
+
libglib2.0-0 \
|
22 |
+
build-essential \
|
23 |
+
libsparsehash-dev \
|
24 |
+
&& rm -rf /var/lib/apt/lists/*
|
25 |
+
|
26 |
+
# Set Python3 as the default version
|
27 |
+
RUN update-alternatives --install /usr/bin/python python /usr/bin/python3 1
|
28 |
+
|
29 |
+
RUN pip3 install pip=
|
30 |
+
|
31 |
+
# Install PyTorch
|
32 |
+
RUN pip3 install --no-cache-dir \
|
33 |
+
torch \
|
34 |
+
torchvision \
|
35 |
+
torchaudio \
|
36 |
+
--index-url https://download.pytorch.org/whl/cu118
|
37 |
+
|
38 |
+
COPY requirements.txt /opt/app/requirements.txt
|
39 |
+
WORKDIR /opt/app
|
40 |
+
RUN pip install -r requirements.txt
|
41 |
+
# COPY . /opt/app
|
42 |
+
COPY requirements.txt /opt/app
|
43 |
+
|
44 |
+
ARG TORCH_CUDA_ARCH_LIST="5.2;7.0;7.2;8.0;8.6+PTX"
|
45 |
+
ARG IABN_FORCE_CUDA="1"
|
46 |
+
ARG FORCE_CUDA="1"
|
47 |
+
RUN pip3 install --no-cache-dir \
|
48 |
+
inplace_abn \
|
49 |
+
git+https://github.com/mit-han-lab/[email protected]
|
README.md
CHANGED
@@ -3,9 +3,8 @@ title: One-2-3-45
|
|
3 |
emoji: πΈππ
|
4 |
colorFrom: red
|
5 |
colorTo: yellow
|
6 |
-
sdk:
|
7 |
-
|
8 |
-
app_file: app.py
|
9 |
pinned: true
|
10 |
license: mit
|
11 |
---
|
|
|
3 |
emoji: πΈππ
|
4 |
colorFrom: red
|
5 |
colorTo: yellow
|
6 |
+
sdk: docker
|
7 |
+
app_port: 7860
|
|
|
8 |
pinned: true
|
9 |
license: mit
|
10 |
---
|
app.py
CHANGED
@@ -11,15 +11,15 @@ sys.path.append(code_dir)
|
|
11 |
elev_est_dir = os.path.abspath(os.path.join(code_dir, "elevation_estimate"))
|
12 |
sys.path.append(elev_est_dir)
|
13 |
|
14 |
-
if not is_local_run:
|
15 |
# export TORCH_CUDA_ARCH_LIST="7.0;7.2;8.0;8.6"
|
16 |
# export IABN_FORCE_CUDA=1
|
17 |
-
os.environ["TORCH_CUDA_ARCH_LIST"] = "8.0;8.6"
|
18 |
-
os.environ["IABN_FORCE_CUDA"] = "1"
|
19 |
-
os.environ["FORCE_CUDA"] = "1"
|
20 |
-
subprocess.run(['pip', 'install', 'inplace_abn'])
|
21 |
# FORCE_CUDA=1 pip install --no-cache-dir git+https://github.com/mit-han-lab/[email protected]
|
22 |
-
subprocess.run(['pip', 'install', '--no-cache-dir', 'git+https://github.com/mit-han-lab/[email protected]'])
|
23 |
|
24 |
import shutil
|
25 |
import torch
|
|
|
11 |
elev_est_dir = os.path.abspath(os.path.join(code_dir, "elevation_estimate"))
|
12 |
sys.path.append(elev_est_dir)
|
13 |
|
14 |
+
# if not is_local_run:
|
15 |
# export TORCH_CUDA_ARCH_LIST="7.0;7.2;8.0;8.6"
|
16 |
# export IABN_FORCE_CUDA=1
|
17 |
+
# os.environ["TORCH_CUDA_ARCH_LIST"] = "8.0;8.6"
|
18 |
+
# os.environ["IABN_FORCE_CUDA"] = "1"
|
19 |
+
# os.environ["FORCE_CUDA"] = "1"
|
20 |
+
# subprocess.run(['pip', 'install', 'inplace_abn'])
|
21 |
# FORCE_CUDA=1 pip install --no-cache-dir git+https://github.com/mit-han-lab/[email protected]
|
22 |
+
# subprocess.run(['pip', 'install', '--no-cache-dir', 'git+https://github.com/mit-han-lab/[email protected]'])
|
23 |
|
24 |
import shutil
|
25 |
import torch
|
requirements.txt
CHANGED
@@ -1,4 +1,5 @@
|
|
1 |
--extra-index-url https://download.pytorch.org/whl/cu118
|
|
|
2 |
torch==2.0.1
|
3 |
torchvision
|
4 |
albumentations>=0.4.3
|
@@ -17,7 +18,6 @@ kornia>=0.6
|
|
17 |
webdataset>=0.2.5
|
18 |
torchmetrics>=0.6.0
|
19 |
fire>=0.4.0
|
20 |
-
gradio>=3.41.1
|
21 |
diffusers>=0.12.1
|
22 |
datasets[vision]>=2.4.0
|
23 |
rich>=13.3.2
|
|
|
1 |
--extra-index-url https://download.pytorch.org/whl/cu118
|
2 |
+
gradio==4.38.1
|
3 |
torch==2.0.1
|
4 |
torchvision
|
5 |
albumentations>=0.4.3
|
|
|
18 |
webdataset>=0.2.5
|
19 |
torchmetrics>=0.6.0
|
20 |
fire>=0.4.0
|
|
|
21 |
diffusers>=0.12.1
|
22 |
datasets[vision]>=2.4.0
|
23 |
rich>=13.3.2
|