zqh0253 commited on
Commit
37984db
0 Parent(s):
Files changed (5) hide show
  1. .gitattributes +35 -0
  2. Dockerfile +96 -0
  3. README.md +11 -0
  4. app.py +8 -0
  5. requirements.txt +53 -0
.gitattributes ADDED
@@ -0,0 +1,35 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ *.7z filter=lfs diff=lfs merge=lfs -text
2
+ *.arrow filter=lfs diff=lfs merge=lfs -text
3
+ *.bin filter=lfs diff=lfs merge=lfs -text
4
+ *.bz2 filter=lfs diff=lfs merge=lfs -text
5
+ *.ckpt filter=lfs diff=lfs merge=lfs -text
6
+ *.ftz filter=lfs diff=lfs merge=lfs -text
7
+ *.gz filter=lfs diff=lfs merge=lfs -text
8
+ *.h5 filter=lfs diff=lfs merge=lfs -text
9
+ *.joblib filter=lfs diff=lfs merge=lfs -text
10
+ *.lfs.* filter=lfs diff=lfs merge=lfs -text
11
+ *.mlmodel filter=lfs diff=lfs merge=lfs -text
12
+ *.model filter=lfs diff=lfs merge=lfs -text
13
+ *.msgpack filter=lfs diff=lfs merge=lfs -text
14
+ *.npy filter=lfs diff=lfs merge=lfs -text
15
+ *.npz filter=lfs diff=lfs merge=lfs -text
16
+ *.onnx filter=lfs diff=lfs merge=lfs -text
17
+ *.ot filter=lfs diff=lfs merge=lfs -text
18
+ *.parquet filter=lfs diff=lfs merge=lfs -text
19
+ *.pb filter=lfs diff=lfs merge=lfs -text
20
+ *.pickle filter=lfs diff=lfs merge=lfs -text
21
+ *.pkl filter=lfs diff=lfs merge=lfs -text
22
+ *.pt filter=lfs diff=lfs merge=lfs -text
23
+ *.pth filter=lfs diff=lfs merge=lfs -text
24
+ *.rar filter=lfs diff=lfs merge=lfs -text
25
+ *.safetensors filter=lfs diff=lfs merge=lfs -text
26
+ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
27
+ *.tar.* filter=lfs diff=lfs merge=lfs -text
28
+ *.tar filter=lfs diff=lfs merge=lfs -text
29
+ *.tflite filter=lfs diff=lfs merge=lfs -text
30
+ *.tgz filter=lfs diff=lfs merge=lfs -text
31
+ *.wasm filter=lfs diff=lfs merge=lfs -text
32
+ *.xz filter=lfs diff=lfs merge=lfs -text
33
+ *.zip filter=lfs diff=lfs merge=lfs -text
34
+ *.zst filter=lfs diff=lfs merge=lfs -text
35
+ *tfevents* filter=lfs diff=lfs merge=lfs -text
Dockerfile ADDED
@@ -0,0 +1,96 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Reference:
2
+ # https://github.com/cvpaperchallenge/Ascender
3
+ # https://github.com/nerfstudio-project/nerfstudio
4
+
5
+ FROM nvidia/cuda:11.8.0-devel-ubuntu22.04
6
+
7
+ ARG USER_NAME=dreamer
8
+ ARG GROUP_NAME=dreamers
9
+ ARG UID=1000
10
+ ARG GID=1000
11
+
12
+ # Set compute capability for nerfacc and tiny-cuda-nn
13
+ # See https://developer.nvidia.com/cuda-gpus and limit number to speed-up build
14
+ ENV TORCH_CUDA_ARCH_LIST="6.0 6.1 7.0 7.5 8.0 8.6 8.9 9.0+PTX"
15
+ ENV TCNN_CUDA_ARCHITECTURES=90;89;86;80;75;70;61;60
16
+ # Speed-up build for RTX 30xx
17
+ # ENV TORCH_CUDA_ARCH_LIST="8.6"
18
+ # ENV TCNN_CUDA_ARCHITECTURES=86
19
+ # Speed-up build for RTX 40xx
20
+ # ENV TORCH_CUDA_ARCH_LIST="8.9"
21
+ # ENV TCNN_CUDA_ARCHITECTURES=89
22
+
23
+ ENV CUDA_HOME=/usr/local/cuda
24
+ ENV PATH=${CUDA_HOME}/bin:/home/${USER_NAME}/.local/bin:${PATH}:/home/${USER_NAME}/tinycudann/bin
25
+ ENV LD_LIBRARY_PATH=${CUDA_HOME}/lib64:${LD_LIBRARY_PATH}
26
+ ENV LIBRARY_PATH=${CUDA_HOME}/lib64/stubs:${LIBRARY_PATH}
27
+
28
+ # apt install by root user
29
+ RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
30
+ build-essential \
31
+ curl \
32
+ git \
33
+ libegl1-mesa-dev \
34
+ libgl1-mesa-dev \
35
+ libgles2-mesa-dev \
36
+ libglib2.0-0 \
37
+ libsm6 \
38
+ libxext6 \
39
+ libxrender1 \
40
+ python-is-python3 \
41
+ python3.10-dev \
42
+ python3-pip \
43
+ wget \
44
+ zip \
45
+ unzip \
46
+ && rm -rf /var/lib/apt/lists/*
47
+
48
+ # Change user to non-root user
49
+ RUN groupadd -g ${GID} ${GROUP_NAME} \
50
+ && useradd -ms /bin/sh -u ${UID} -g ${GID} ${USER_NAME}
51
+ USER ${USER_NAME}
52
+
53
+ RUN pip install --upgrade pip setuptools==69.5.1 ninja
54
+ RUN pip install xformers==0.0.22 torch==2.0.1+cu118 torchvision==0.15.2+cu118 -f https://download.pytorch.org/whl/cu118/torch_stable.html
55
+
56
+ RUN pip install nerfacc==0.5.2 -f https://nerfacc-bucket.s3.us-west-2.amazonaws.com/whl/torch-2.0.0_cu118.html
57
+
58
+ COPY requirements.txt /tmp
59
+
60
+ RUN cd /tmp && pip install -r requirements.txt
61
+ RUN pip install -U fastapi pydantic
62
+
63
+ RUN ls .
64
+
65
+
66
+ RUN rm -rf /home/${USER_NAME}/threestudio
67
+ RUN rm -rf /home/${USER_NAME}/.cache
68
+
69
+ RUN ls .
70
+
71
+ ADD "https://api.github.com/repos/zqh0253/3DitScene/commits?per_page=1" latest_commit
72
+ RUN git clone https://github.com/zqh0253/3DitScene.git /home/${USER_NAME}/threestudio --recursive
73
+
74
+ WORKDIR /home/${USER_NAME}/threestudio
75
+
76
+ RUN wget --quiet https://www.dropbox.com/scl/fi/ubyeroi2b85y78mbyy9or/1.zip?rlkey=b1sfgbmlmx3jz4onwk9qjj2rs -O tmp.zip
77
+ RUN wget --quiet https://www.dropbox.com/scl/fi/2s4b848d4qqrz87bbfc2z/cache.zip?rlkey=f7tyf4952ey253xlzvb1lwnmc -O tmp.zip
78
+ RUN unzip tmp.zip
79
+
80
+ RUN pip install ./submodules/segment-anything-langsplat
81
+ RUN pip install ./submodules/MobileSAM-lang
82
+
83
+ RUN wget --quiet https://www.dropbox.com/scl/fi/rhl1r9qww9fq6jtjmh43x/diff_gaussian_rasterization-0.0.0-cp310-cp310-linux_x86_64.whl?rlkey=xp02kfjvyk9urnacybp4ll108 -O diff_gaussian_rasterization-0.0.0-cp310-cp310-linux_x86_64.whl
84
+ RUN pip install diff_gaussian_rasterization-0.0.0-cp310-cp310-linux_x86_64.whl
85
+
86
+ RUN pip install ./submodules/simple-knn
87
+
88
+ # RUN cd diff-gaussian-rasterization && git show-ref --heads
89
+
90
+ RUN mkdir ckpts
91
+ RUN wget --quiet https://dl.fbaipublicfiles.com/segment_anything/sam_vit_h_4b8939.pth -O ./ckpts/sam_vit_h_4b8939.pth
92
+ RUN cp /home/${USER_NAME}/threestudio/submodules/MobileSAM-lang/weights/mobile_sam.pt ./ckpts/
93
+
94
+
95
+ # RUN git checkout 23b2d71
96
+ CMD ["python", "gradio_app_single_process.py", "--listen", "--hf-space"]
README.md ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ title: 3Dit Scene
3
+ emoji: 📉
4
+ colorFrom: indigo
5
+ colorTo: purple
6
+ sdk: docker
7
+ pinned: false
8
+ license: apache-2.0
9
+ ---
10
+
11
+ Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
app.py ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
 
1
+ import gradio as gr
2
+
3
+ def greet(name):
4
+ return "Hello " + name + "!!"
5
+
6
+ demo = gr.Interface(fn=greet, inputs="text", outputs="text")
7
+ demo.launch()
8
+
requirements.txt ADDED
@@ -0,0 +1,53 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # torch==1.12.1
2
+ # torchvision==0.13.1
3
+ lightning==2.0.0
4
+ omegaconf==2.3.0
5
+ jaxtyping
6
+ typeguard
7
+ # git+https://github.com/KAIR-BAIR/nerfacc.git@v0.5.2
8
+ # git+https://github.com/NVlabs/tiny-cuda-nn/#subdirectory=bindings/torch
9
+ diffusers==0.25.0
10
+ # diffusers<0.20
11
+ transformers==4.28.1
12
+ accelerate
13
+ opencv-python
14
+ tensorboard
15
+ matplotlib
16
+ imageio>=2.28.0
17
+ imageio[ffmpeg]
18
+ git+https://github.com/NVlabs/nvdiffrast.git
19
+ libigl
20
+ xatlas
21
+ trimesh[easy]
22
+ networkx
23
+ pysdf
24
+ PyMCubes
25
+ wandb
26
+ # fastapi>=0.80
27
+ # fastapi==0.85
28
+ gradio==4.27.0
29
+ # gradio
30
+ git+https://github.com/ashawkey/envlight.git
31
+ torchmetrics
32
+ mediapipe
33
+ scikit-learn
34
+ open_clip_torch
35
+
36
+ # deepfloyd
37
+ # bitsandbytes==0.38.1
38
+ # sentencepiece
39
+ # safetensors
40
+ # huggingface_hub
41
+
42
+ # for zero123
43
+ # einops
44
+ # kornia
45
+ # taming-transformers-rom1504
46
+ git+https://github.com/openai/CLIP.git
47
+
48
+ # threestudio-3DGS extension
49
+ plyfile
50
+
51
+ #controlnet
52
+ controlnet_aux
53
+