From 6a6e2ab2bd926c9ac9b53e8bfd18483267c0db55 Mon Sep 17 00:00:00 2001 From: Ammar Qammaz Date: Wed, 25 Oct 2023 16:24:31 +0300 Subject: [PATCH 01/41] add a docker script.. --- docker/Dockerfile | 75 ++++++++++++++++++++++++++++++++++++++ docker/build_and_deploy.sh | 44 ++++++++++++++++++++++ docker/initialize.sh | 34 +++++++++++++++++ 3 files changed, 153 insertions(+) create mode 100644 docker/Dockerfile create mode 100755 docker/build_and_deploy.sh create mode 100755 docker/initialize.sh diff --git a/docker/Dockerfile b/docker/Dockerfile new file mode 100644 index 000000000..0f1237c88 --- /dev/null +++ b/docker/Dockerfile @@ -0,0 +1,75 @@ +FROM tensorflow/tensorflow:latest-gpu + +ARG user_id +ARG root_psw="12345678" +ARG user_psw="ok" +ARG user_name=user + +# Installs the necessary pkgs. +RUN \ + echo "**** packages installation ****" \ + && apt-key adv --fetch-keys http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1604/x86_64/3bf863cc.pub \ + && apt-get update && apt-get install -y \ + vim \ + build-essential \ + cmake \ + libopencv-dev \ + libjpeg-dev \ + libpng-dev \ + libglew-dev \ + libpthread-stubs0-dev \ + git \ + virtualenv \ + time \ + sudo \ + wget \ + nano \ + python3.8-venv \ + libboost-program-options-dev \ + libboost-filesystem-dev \ + libboost-graph-dev \ + libboost-regex-dev \ + libboost-system-dev \ + libboost-test-dev \ + libeigen3-dev \ + libsuitesparse-dev \ + libfreeimage-dev \ + libgoogle-glog-dev \ + libgflags-dev \ + libglew-dev \ + qtbase5-dev \ + libqt5opengl5-dev \ + libcgal-dev \ + libcgal-qt5-dev \ + libmetis-dev \ + libflann-dev \ + libatlas-base-dev \ + libsuitesparse-dev \ + && echo "**** python pip update ****" \ + && /usr/bin/python3 -m pip install --upgrade pip \ + && echo "**** aliases for l and ll commands creation ****" \ + && echo -e 'ls --color=auto "$@"' > /usr/bin/l \ + && echo -e 'ls -lah --color=auto "$@"' > /usr/bin/ll \ + && chmod +x /usr/bin/ll /usr/bin/l \ + && echo "**** history-search-backward by pressing F8 ****" \ + && sed -i 's/# "\\e\[5~": history-search-backward/"\\e\[19~": history-search-backward/' /etc/inputrc \ + && echo "**** root password creation ****" \ + && echo "root:${root_psw}" | chpasswd \ + && echo "**** user creation ****" \ + && useradd -m -s /usr/bin/bash -u ${user_id} -G sudo ${user_name} \ + && echo "${user_name}:${user_psw}" | chpasswd \ + && chown -R ${user_name}:${user_name} /home/${user_name}/ \ + && mkdir /home/${user_name}/workspace/ \ + && chown -R user:user /home/${user_name}/workspace + + +USER ${user_name} +WORKDIR /home/${user_name}/ + + +#Read/Write: git clone ssh://ics\\ammarkov@cvrlcode.ics.forth.gr:29418/users/ammarkov/ammarkov.git +#Read only: git clone https://ics\\ammarkov@cvrlcode.ics.forth.gr:8443/r/users/ammarkov/ammarkov.git + +RUN git config --global http.sslverify false +RUN cd /home/${user_name}/workspace && git clone --recursive https://github.com/graphdeco-inria/gaussian-splatting && cd gaussian-splatting && ./docker/initialize.sh + diff --git a/docker/build_and_deploy.sh b/docker/build_and_deploy.sh new file mode 100755 index 000000000..a8c97b191 --- /dev/null +++ b/docker/build_and_deploy.sh @@ -0,0 +1,44 @@ +#!/usr/bin/env bash +# This script builds and runs a docker image for local use. + +#Although I dislike the use of docker for a myriad of reasons, due needing it to deploy on a particular machine +#I am adding a docker container builder for the repository to automate the process + + +DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" +cd "$DIR" +cd .. +REPOSITORY=`pwd` + +cd "$DIR" + +NAME="mocapnet" +dockerfile_pth="$DIR" +mount_pth="$REPOSITORY" + +# update tensorflow image +docker pull tensorflow/tensorflow:latest-gpu + +# build and run tensorflow +docker build \ + -t $NAME \ + $dockerfile_pth \ + --build-arg user_id=$UID + +docker run -d \ + --gpus all \ + --shm-size 8G \ + -it \ + --name $NAME-container \ + -v $mount_pth:/home/user/workspace \ + $NAME + + +docker ps -a + +OUR_DOCKER_ID=`docker ps -a | grep mocapnet | cut -f1 -d' '` +echo "Our docker ID is : $OUR_DOCKER_ID" +echo "Attaching it using : docker attach $OUD_DOCKER_ID" +docker attach $OUR_DOCKER_ID + +exit 0 diff --git a/docker/initialize.sh b/docker/initialize.sh new file mode 100755 index 000000000..ae6d20700 --- /dev/null +++ b/docker/initialize.sh @@ -0,0 +1,34 @@ +#!/bin/bash + + +git clone https://ceres-solver.googlesource.com/ceres-solver +cd ceres-solver +git checkout $(git describe --tags) # Checkout the latest release +mkdir build +cd build +cmake .. -DBUILD_TESTING=OFF -DBUILD_EXAMPLES=OFF -DCMAKE_CUDA_ARCHITECTURES=native +make +sudo make install +cd .. +cd .. + + +git clone https://github.com/colmap/colmap +cd colmap +git checkout dev +mkdir build +cd build +cmake .. -DCMAKE_CUDA_ARCHITECTURES=native +make +sudo make install +CC=/usr/bin/gcc-6 CXX=/usr/bin/g++-6 cmake .. +cd .. +cd .. + + +pip install -q plyfile + +pip install -q https://huggingface.co/camenduru/gaussian-splatting/resolve/main/diff_gaussian_rasterization-0.0.0-cp310-cp310-linux_x86_64.whl +pip install -q https://huggingface.co/camenduru/gaussian-splatting/resolve/main/simple_knn-0.0.0-cp310-cp310-linux_x86_64.whl + +exit 0 From 5f664812e1a06d3ed7d3d88d89885ca66e9a1bc9 Mon Sep 17 00:00:00 2001 From: Ammar Qammaz Date: Wed, 25 Oct 2023 16:26:45 +0300 Subject: [PATCH 02/41] ... --- docker/Dockerfile | 3 --- docker/build_and_deploy.sh | 4 ++-- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/docker/Dockerfile b/docker/Dockerfile index 0f1237c88..7e1782fcb 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -65,10 +65,7 @@ RUN \ USER ${user_name} WORKDIR /home/${user_name}/ - -#Read/Write: git clone ssh://ics\\ammarkov@cvrlcode.ics.forth.gr:29418/users/ammarkov/ammarkov.git -#Read only: git clone https://ics\\ammarkov@cvrlcode.ics.forth.gr:8443/r/users/ammarkov/ammarkov.git RUN git config --global http.sslverify false RUN cd /home/${user_name}/workspace && git clone --recursive https://github.com/graphdeco-inria/gaussian-splatting && cd gaussian-splatting && ./docker/initialize.sh diff --git a/docker/build_and_deploy.sh b/docker/build_and_deploy.sh index a8c97b191..7d5f1927b 100755 --- a/docker/build_and_deploy.sh +++ b/docker/build_and_deploy.sh @@ -12,7 +12,7 @@ REPOSITORY=`pwd` cd "$DIR" -NAME="mocapnet" +NAME="gaussian-splatting" dockerfile_pth="$DIR" mount_pth="$REPOSITORY" @@ -36,7 +36,7 @@ docker run -d \ docker ps -a -OUR_DOCKER_ID=`docker ps -a | grep mocapnet | cut -f1 -d' '` +OUR_DOCKER_ID=`docker ps -a | grep gaussian-splatting | cut -f1 -d' '` echo "Our docker ID is : $OUR_DOCKER_ID" echo "Attaching it using : docker attach $OUD_DOCKER_ID" docker attach $OUR_DOCKER_ID From 0e71e38377bea300fef6b9ae86606e721ea595db Mon Sep 17 00:00:00 2001 From: Ammar Qammaz Date: Wed, 25 Oct 2023 16:37:27 +0300 Subject: [PATCH 03/41] ... --- docker/Dockerfile | 1 - 1 file changed, 1 deletion(-) diff --git a/docker/Dockerfile b/docker/Dockerfile index 7e1782fcb..5bda55db3 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -24,7 +24,6 @@ RUN \ sudo \ wget \ nano \ - python3.8-venv \ libboost-program-options-dev \ libboost-filesystem-dev \ libboost-graph-dev \ From dba95512e0457c3b5d14bc640fdc5bd4d14487a9 Mon Sep 17 00:00:00 2001 From: Ammar Qammaz Date: Wed, 25 Oct 2023 16:40:51 +0300 Subject: [PATCH 04/41] ... --- docker/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker/Dockerfile b/docker/Dockerfile index 5bda55db3..44ba34060 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -67,5 +67,5 @@ WORKDIR /home/${user_name}/ RUN git config --global http.sslverify false -RUN cd /home/${user_name}/workspace && git clone --recursive https://github.com/graphdeco-inria/gaussian-splatting && cd gaussian-splatting && ./docker/initialize.sh +RUN cd /home/${user_name}/workspace && git clone --recursive https://github.com/graphdeco-inria/gaussian-splatting && cd gaussian-splatting && docker/initialize.sh From 74b996fcc3d8d68b0ebeabd9ded45f95c6450824 Mon Sep 17 00:00:00 2001 From: Ammar Qammaz Date: Wed, 25 Oct 2023 16:42:24 +0300 Subject: [PATCH 05/41] ... --- docker/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker/Dockerfile b/docker/Dockerfile index 44ba34060..233a897d2 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -67,5 +67,5 @@ WORKDIR /home/${user_name}/ RUN git config --global http.sslverify false -RUN cd /home/${user_name}/workspace && git clone --recursive https://github.com/graphdeco-inria/gaussian-splatting && cd gaussian-splatting && docker/initialize.sh +RUN cd /home/${user_name}/workspace && git clone --recursive https://github.com/graphdeco-inria/gaussian-splatting && cd gaussian-splatting # && docker/initialize.sh From e16749ab9b7ae30af40346249bc5f875b630db99 Mon Sep 17 00:00:00 2001 From: Ammar Qammaz Date: Wed, 25 Oct 2023 18:57:21 +0300 Subject: [PATCH 06/41] .... --- docker/Dockerfile | 4 ++++ docker/initialize.sh | 12 ++++++++---- docker/run.sh | 18 ++++++++++++++++++ 3 files changed, 30 insertions(+), 4 deletions(-) create mode 100755 docker/run.sh diff --git a/docker/Dockerfile b/docker/Dockerfile index 233a897d2..456167cc0 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -13,6 +13,8 @@ RUN \ vim \ build-essential \ cmake \ + ffmpeg \ + freeglut3-dev \ libopencv-dev \ libjpeg-dev \ libpng-dev \ @@ -20,6 +22,8 @@ RUN \ libpthread-stubs0-dev \ git \ virtualenv \ + sqlite3 \ + libsqlite3-dev \ time \ sudo \ wget \ diff --git a/docker/initialize.sh b/docker/initialize.sh index ae6d20700..8ea727c31 100755 --- a/docker/initialize.sh +++ b/docker/initialize.sh @@ -1,12 +1,16 @@ #!/bin/bash +#git clone https://github.com/NVIDIA/cuda-samples +#cd cuda-samples + + git clone https://ceres-solver.googlesource.com/ceres-solver cd ceres-solver git checkout $(git describe --tags) # Checkout the latest release mkdir build cd build -cmake .. -DBUILD_TESTING=OFF -DBUILD_EXAMPLES=OFF -DCMAKE_CUDA_ARCHITECTURES=native +cmake .. -DBUILD_TESTING=OFF -DBUILD_EXAMPLES=OFF -DUSE_CUDA=OFF #-DCMAKE_CUDA_ARCHITECTURES=native make sudo make install cd .. @@ -18,7 +22,7 @@ cd colmap git checkout dev mkdir build cd build -cmake .. -DCMAKE_CUDA_ARCHITECTURES=native +cmake .. -DCMAKE_CUDA_ARCHITECTURES=native -DCUDA_ENABLED=OFF make sudo make install CC=/usr/bin/gcc-6 CXX=/usr/bin/g++-6 cmake .. @@ -28,7 +32,7 @@ cd .. pip install -q plyfile -pip install -q https://huggingface.co/camenduru/gaussian-splatting/resolve/main/diff_gaussian_rasterization-0.0.0-cp310-cp310-linux_x86_64.whl -pip install -q https://huggingface.co/camenduru/gaussian-splatting/resolve/main/simple_knn-0.0.0-cp310-cp310-linux_x86_64.whl +python3.10 -m pip install -q https://huggingface.co/camenduru/gaussian-splatting/resolve/main/diff_gaussian_rasterization-0.0.0-cp310-cp310-linux_x86_64.whl +python3.10 -m pip install -q https://huggingface.co/camenduru/gaussian-splatting/resolve/main/simple_knn-0.0.0-cp310-cp310-linux_x86_64.whl exit 0 diff --git a/docker/run.sh b/docker/run.sh new file mode 100755 index 000000000..1971107ca --- /dev/null +++ b/docker/run.sh @@ -0,0 +1,18 @@ +#!/bin/bash + +DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" +cd "$DIR" + + +cd .. + +mkdir -p $1-data/input +mkdir -p $1-data/output + +ffmpeg -i $1 -qscale:v 1 -qmin 1 -vf fps={fps} $1-data/input/%04d.jpg + + +python3.10 convert.py -s $1-data/ --no_gpu +python3.10 train.py -s $1-data/ -r 1 --model_path=$1-data/output/ + +exit 0 From 2a9c84ace34f129e97ac8ba1d86d76ae5313554d Mon Sep 17 00:00:00 2001 From: Ammar Qammaz Date: Wed, 25 Oct 2023 19:16:57 +0300 Subject: [PATCH 07/41] ... --- docker/Dockerfile | 9 +++++++-- docker/initialize.sh | 2 ++ 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/docker/Dockerfile b/docker/Dockerfile index 456167cc0..9cbe351a8 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -1,4 +1,5 @@ -FROM tensorflow/tensorflow:latest-gpu +#FROM tensorflow/tensorflow:latest-gpu +FROM nvidia/cuda:12.2.0-devel-ubuntu22.04 ARG user_id ARG root_psw="12345678" @@ -9,7 +10,7 @@ ARG user_name=user RUN \ echo "**** packages installation ****" \ && apt-key adv --fetch-keys http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1604/x86_64/3bf863cc.pub \ - && apt-get update && apt-get install -y \ + && apt-get update && apt-get dist-upgrade -y && apt-get install -y \ vim \ build-essential \ cmake \ @@ -48,6 +49,10 @@ RUN \ libflann-dev \ libatlas-base-dev \ libsuitesparse-dev \ + libcufft10 \ + libcusparse11 \ + libcublas11 \ + libcublaslt11 \ && echo "**** python pip update ****" \ && /usr/bin/python3 -m pip install --upgrade pip \ && echo "**** aliases for l and ll commands creation ****" \ diff --git a/docker/initialize.sh b/docker/initialize.sh index 8ea727c31..904815faf 100755 --- a/docker/initialize.sh +++ b/docker/initialize.sh @@ -11,6 +11,8 @@ git checkout $(git describe --tags) # Checkout the latest release mkdir build cd build cmake .. -DBUILD_TESTING=OFF -DBUILD_EXAMPLES=OFF -DUSE_CUDA=OFF #-DCMAKE_CUDA_ARCHITECTURES=native + + make sudo make install cd .. From 12eca4c71b8ae73021ffb4e16edbaace1cdb22d9 Mon Sep 17 00:00:00 2001 From: Ammar Qammaz Date: Wed, 25 Oct 2023 19:50:15 +0300 Subject: [PATCH 08/41] ... --- docker/Dockerfile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docker/Dockerfile b/docker/Dockerfile index 9cbe351a8..15a2779ed 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -1,6 +1,8 @@ #FROM tensorflow/tensorflow:latest-gpu FROM nvidia/cuda:12.2.0-devel-ubuntu22.04 +ENV DEBIAN_FRONTEND noninteractive + ARG user_id ARG root_psw="12345678" ARG user_psw="ok" From 1ecf56bd78b02be29e46d4517836f05b353c3a7d Mon Sep 17 00:00:00 2001 From: Ammar Qammaz Date: Wed, 25 Oct 2023 19:50:37 +0300 Subject: [PATCH 09/41] ... --- docker/initialize.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docker/initialize.sh b/docker/initialize.sh index 904815faf..4af0bf127 100755 --- a/docker/initialize.sh +++ b/docker/initialize.sh @@ -10,7 +10,7 @@ cd ceres-solver git checkout $(git describe --tags) # Checkout the latest release mkdir build cd build -cmake .. -DBUILD_TESTING=OFF -DBUILD_EXAMPLES=OFF -DUSE_CUDA=OFF #-DCMAKE_CUDA_ARCHITECTURES=native +cmake .. -DBUILD_TESTING=OFF -DBUILD_EXAMPLES=OFF -DCMAKE_CUDA_ARCHITECTURES=native #-DUSE_CUDA=OFF make @@ -24,7 +24,7 @@ cd colmap git checkout dev mkdir build cd build -cmake .. -DCMAKE_CUDA_ARCHITECTURES=native -DCUDA_ENABLED=OFF +cmake .. -DCMAKE_CUDA_ARCHITECTURES=native #-DCUDA_ENABLED=OFF make sudo make install CC=/usr/bin/gcc-6 CXX=/usr/bin/g++-6 cmake .. From 70211d00cab95b43621fec8b5227f8adc1f89702 Mon Sep 17 00:00:00 2001 From: Ammar Qammaz Date: Wed, 25 Oct 2023 20:00:24 +0300 Subject: [PATCH 10/41] ... --- docker/initialize.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docker/initialize.sh b/docker/initialize.sh index 4af0bf127..04cfa1fe0 100755 --- a/docker/initialize.sh +++ b/docker/initialize.sh @@ -10,7 +10,7 @@ cd ceres-solver git checkout $(git describe --tags) # Checkout the latest release mkdir build cd build -cmake .. -DBUILD_TESTING=OFF -DBUILD_EXAMPLES=OFF -DCMAKE_CUDA_ARCHITECTURES=native #-DUSE_CUDA=OFF +cmake .. -DBUILD_TESTING=OFF -DBUILD_EXAMPLES=OFF -DCMAKE_CUDA_ARCHITECTURES=60;70;80 #-DUSE_CUDA=OFF make @@ -24,7 +24,7 @@ cd colmap git checkout dev mkdir build cd build -cmake .. -DCMAKE_CUDA_ARCHITECTURES=native #-DCUDA_ENABLED=OFF +cmake .. -DCMAKE_CUDA_ARCHITECTURES=60;70;80 #-DCUDA_ENABLED=OFF make sudo make install CC=/usr/bin/gcc-6 CXX=/usr/bin/g++-6 cmake .. From 4c540f3d59ea4aa6dec137a99924d3516693c2e6 Mon Sep 17 00:00:00 2001 From: Ammar Qammaz Date: Wed, 25 Oct 2023 20:15:14 +0300 Subject: [PATCH 11/41] ... --- docker/initialize.sh | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/docker/initialize.sh b/docker/initialize.sh index 04cfa1fe0..03d2f5ce3 100755 --- a/docker/initialize.sh +++ b/docker/initialize.sh @@ -10,7 +10,7 @@ cd ceres-solver git checkout $(git describe --tags) # Checkout the latest release mkdir build cd build -cmake .. -DBUILD_TESTING=OFF -DBUILD_EXAMPLES=OFF -DCMAKE_CUDA_ARCHITECTURES=60;70;80 #-DUSE_CUDA=OFF +cmake .. -DBUILD_TESTING=OFF -DBUILD_EXAMPLES=OFF -DCMAKE_CUDA_ARCHITECTURES="60;70;80" #-DUSE_CUDA=OFF make @@ -24,10 +24,10 @@ cd colmap git checkout dev mkdir build cd build -cmake .. -DCMAKE_CUDA_ARCHITECTURES=60;70;80 #-DCUDA_ENABLED=OFF +cmake .. -DCMAKE_CUDA_ARCHITECTURES="60;70;80" #-DCUDA_ENABLED=OFF make sudo make install -CC=/usr/bin/gcc-6 CXX=/usr/bin/g++-6 cmake .. +#CC=/usr/bin/gcc-6 CXX=/usr/bin/g++-6 cmake .. cd .. cd .. @@ -37,4 +37,7 @@ pip install -q plyfile python3.10 -m pip install -q https://huggingface.co/camenduru/gaussian-splatting/resolve/main/diff_gaussian_rasterization-0.0.0-cp310-cp310-linux_x86_64.whl python3.10 -m pip install -q https://huggingface.co/camenduru/gaussian-splatting/resolve/main/simple_knn-0.0.0-cp310-cp310-linux_x86_64.whl + +ln -s docker/run.sh ./run.sh + exit 0 From ac96e2cc2df27e8fb0bdfd26f64fd843cd154f1e Mon Sep 17 00:00:00 2001 From: Ammar Qammaz Date: Wed, 25 Oct 2023 20:55:49 +0300 Subject: [PATCH 12/41] add a setup script for docker.. --- docker/setup.sh | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100755 docker/setup.sh diff --git a/docker/setup.sh b/docker/setup.sh new file mode 100755 index 000000000..313ba8a8c --- /dev/null +++ b/docker/setup.sh @@ -0,0 +1,40 @@ +#!/usr/bin/env bash +# This script builds and runs a docker image for local use. + +DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" +cd "$DIR" +cd .. +REPOSITORY=`pwd` + +cd "$DIR" + +#https://docs.nvidia.com/ai-enterprise/deployment-guide/dg-docker.html +sudo apt-get update +sudo apt-get install -y \ + apt-transport-https \ + ca-certificates \ + curl \ + gnupg-agent \ + software-properties-common + +curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add - +sudo apt-key fingerprint 0EBFCD88 + +sudo add-apt-repository \ +"deb [arch=amd64] https://download.docker.com/linux/ubuntu \ +$(lsb_release -cs) \ +stable" + + +sudo apt-get update +sudo apt-get install -y docker-ce docker-ce-cli containerd.io + +sudo docker run hello-world + + +#Make sure docker group is ok +sudo groupadd docker +sudo usermod -aG docker $USER +newgrp docker + +exit 0 From d09b7c2d8ab5cfea0d04e8d997493b0118a699fe Mon Sep 17 00:00:00 2001 From: Ammar Qammaz Date: Wed, 25 Oct 2023 21:02:17 +0300 Subject: [PATCH 13/41] set a framerate.. --- docker/run.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker/run.sh b/docker/run.sh index 1971107ca..8a8dc7497 100755 --- a/docker/run.sh +++ b/docker/run.sh @@ -9,7 +9,7 @@ cd .. mkdir -p $1-data/input mkdir -p $1-data/output -ffmpeg -i $1 -qscale:v 1 -qmin 1 -vf fps={fps} $1-data/input/%04d.jpg +ffmpeg -i $1 -qscale:v 1 -qmin 1 -vf fps=5 $1-data/input/%04d.jpg python3.10 convert.py -s $1-data/ --no_gpu From e9bb1000c640793670b28b144975d22055f0c6cf Mon Sep 17 00:00:00 2001 From: Ammar Qammaz Date: Wed, 25 Oct 2023 21:05:06 +0300 Subject: [PATCH 14/41] add a check.. --- docker/run.sh | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/docker/run.sh b/docker/run.sh index 8a8dc7497..f140960b2 100755 --- a/docker/run.sh +++ b/docker/run.sh @@ -9,10 +9,18 @@ cd .. mkdir -p $1-data/input mkdir -p $1-data/output -ffmpeg -i $1 -qscale:v 1 -qmin 1 -vf fps=5 $1-data/input/%04d.jpg +FPS="5" #<-change this to change framerate + + +if [ -f $1-data/input/0000.jpg ] +then + echo "File $1 appears to have already been split .." +else + ffmpeg -i $1 -qscale:v 1 -qmin 1 -vf fps=$FPS $1-data/input/%04d.jpg +fi python3.10 convert.py -s $1-data/ --no_gpu -python3.10 train.py -s $1-data/ -r 1 --model_path=$1-data/output/ +python3.10 train.py -s $1-data/ -r 1 --model_path=$1-data/output/ exit 0 From 568812e0e4d3bc42787c80d36af8706298548392 Mon Sep 17 00:00:00 2001 From: Ammar Qammaz Date: Wed, 25 Oct 2023 22:01:43 +0300 Subject: [PATCH 15/41] first file is 0001.jpg --- docker/run.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker/run.sh b/docker/run.sh index f140960b2..e936e9d31 100755 --- a/docker/run.sh +++ b/docker/run.sh @@ -12,7 +12,7 @@ mkdir -p $1-data/output FPS="5" #<-change this to change framerate -if [ -f $1-data/input/0000.jpg ] +if [ -f $1-data/input/0001.jpg ] then echo "File $1 appears to have already been split .." else From 16bf6862838cd33af13a2f8a6b493037c0b4b405 Mon Sep 17 00:00:00 2001 From: Ammar Qammaz Date: Fri, 27 Oct 2023 12:54:26 +0300 Subject: [PATCH 16/41] ... --- docker/initialize.sh | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/docker/initialize.sh b/docker/initialize.sh index 03d2f5ce3..39aeabdce 100755 --- a/docker/initialize.sh +++ b/docker/initialize.sh @@ -1,7 +1,7 @@ #!/bin/bash -#git clone https://github.com/NVIDIA/cuda-samples +#git clone https://github.com/NVIDIA/cuda-samples #<- To Test docker Cuda image.. #cd cuda-samples @@ -11,8 +11,6 @@ git checkout $(git describe --tags) # Checkout the latest release mkdir build cd build cmake .. -DBUILD_TESTING=OFF -DBUILD_EXAMPLES=OFF -DCMAKE_CUDA_ARCHITECTURES="60;70;80" #-DUSE_CUDA=OFF - - make sudo make install cd .. @@ -27,7 +25,6 @@ cd build cmake .. -DCMAKE_CUDA_ARCHITECTURES="60;70;80" #-DCUDA_ENABLED=OFF make sudo make install -#CC=/usr/bin/gcc-6 CXX=/usr/bin/g++-6 cmake .. cd .. cd .. @@ -37,6 +34,7 @@ pip install -q plyfile python3.10 -m pip install -q https://huggingface.co/camenduru/gaussian-splatting/resolve/main/diff_gaussian_rasterization-0.0.0-cp310-cp310-linux_x86_64.whl python3.10 -m pip install -q https://huggingface.co/camenduru/gaussian-splatting/resolve/main/simple_knn-0.0.0-cp310-cp310-linux_x86_64.whl +python3.10 -m pip install torchvision ln -s docker/run.sh ./run.sh From 4c2d43e6fa5a445d7f4a9db9af9626eb43b1ff9e Mon Sep 17 00:00:00 2001 From: Ammar Qammaz Date: Sat, 28 Oct 2023 17:56:50 +0300 Subject: [PATCH 17/41] fix cuda error --- docker/initialize.sh | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/docker/initialize.sh b/docker/initialize.sh index 03d2f5ce3..bc1067101 100755 --- a/docker/initialize.sh +++ b/docker/initialize.sh @@ -32,10 +32,13 @@ cd .. cd .. -pip install -q plyfile +sudo apt-get -y install cuda +sudo apt install nvidia-cuda-toolkit -python3.10 -m pip install -q https://huggingface.co/camenduru/gaussian-splatting/resolve/main/diff_gaussian_rasterization-0.0.0-cp310-cp310-linux_x86_64.whl -python3.10 -m pip install -q https://huggingface.co/camenduru/gaussian-splatting/resolve/main/simple_knn-0.0.0-cp310-cp310-linux_x86_64.whl +pip install plyfile tqdm + +python3.10 -m pip install https://huggingface.co/camenduru/gaussian-splatting/resolve/main/diff_gaussian_rasterization-0.0.0-cp310-cp310-linux_x86_64.whl +python3.10 -m pip install https://huggingface.co/camenduru/gaussian-splatting/resolve/main/simple_knn-0.0.0-cp310-cp310-linux_x86_64.whl ln -s docker/run.sh ./run.sh From 65965d936c2694116a0e457073e3307a9d3fde36 Mon Sep 17 00:00:00 2001 From: Ammar Qammaz Date: Sat, 28 Oct 2023 18:19:34 +0300 Subject: [PATCH 18/41] ... --- docker/Dockerfile | 1 + 1 file changed, 1 insertion(+) diff --git a/docker/Dockerfile b/docker/Dockerfile index 15a2779ed..331930980 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -17,6 +17,7 @@ RUN \ build-essential \ cmake \ ffmpeg \ + unzip \ freeglut3-dev \ libopencv-dev \ libjpeg-dev \ From 565d3fd19c12aa85e58e4181c4e46678281be0a4 Mon Sep 17 00:00:00 2001 From: Ammar Qammaz Date: Sat, 28 Oct 2023 18:35:50 +0300 Subject: [PATCH 19/41] more fixes.. --- docker/initialize.sh | 6 ++---- docker/run.sh | 2 +- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/docker/initialize.sh b/docker/initialize.sh index e1daa1a8e..7ea400d82 100755 --- a/docker/initialize.sh +++ b/docker/initialize.sh @@ -30,13 +30,11 @@ cd .. sudo apt-get -y install cuda -sudo apt install nvidia-cuda-toolkit - -pip install plyfile tqdm +sudo apt -y install nvidia-cuda-toolkit +python3.10 -m pip install plyfile tqdm python3.10 -m pip install https://huggingface.co/camenduru/gaussian-splatting/resolve/main/diff_gaussian_rasterization-0.0.0-cp310-cp310-linux_x86_64.whl python3.10 -m pip install https://huggingface.co/camenduru/gaussian-splatting/resolve/main/simple_knn-0.0.0-cp310-cp310-linux_x86_64.whl - python3.10 -m pip install torchvision ln -s docker/run.sh ./run.sh diff --git a/docker/run.sh b/docker/run.sh index e936e9d31..306b7de3c 100755 --- a/docker/run.sh +++ b/docker/run.sh @@ -20,7 +20,7 @@ else fi -python3.10 convert.py -s $1-data/ --no_gpu +python3.10 convert.py -s $1-data/ #--no_gpu python3.10 train.py -s $1-data/ -r 1 --model_path=$1-data/output/ exit 0 From 6643d4e2bfd64d04e485a8c9d62164bf8082375c Mon Sep 17 00:00:00 2001 From: Ammar Qammaz Date: Sat, 28 Oct 2023 18:42:07 +0300 Subject: [PATCH 20/41] ... --- docker/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker/Dockerfile b/docker/Dockerfile index 331930980..68c012e25 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -79,5 +79,5 @@ WORKDIR /home/${user_name}/ RUN git config --global http.sslverify false -RUN cd /home/${user_name}/workspace && git clone --recursive https://github.com/graphdeco-inria/gaussian-splatting && cd gaussian-splatting # && docker/initialize.sh +RUN cd /home/${user_name}/workspace && git clone --recursive https://github.com/graphdeco-inria/gaussian-splatting && cd gaussian-splatting && docker/initialize.sh From ed3f394846ae8c719133ce096f134d536320fe90 Mon Sep 17 00:00:00 2001 From: Ammar Qammaz Date: Sat, 28 Oct 2023 18:50:38 +0300 Subject: [PATCH 21/41] ... --- docker/initialize.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docker/initialize.sh b/docker/initialize.sh index 7ea400d82..af587b3d0 100755 --- a/docker/initialize.sh +++ b/docker/initialize.sh @@ -29,8 +29,8 @@ cd .. cd .. -sudo apt-get -y install cuda -sudo apt -y install nvidia-cuda-toolkit +#sudo apt-get -y install cuda +#sudo apt -y install nvidia-cuda-toolkit python3.10 -m pip install plyfile tqdm python3.10 -m pip install https://huggingface.co/camenduru/gaussian-splatting/resolve/main/diff_gaussian_rasterization-0.0.0-cp310-cp310-linux_x86_64.whl From cfb2c629c333b787a8624a70ea2f2ea33fa4072c Mon Sep 17 00:00:00 2001 From: Ammar Qammaz Date: Sat, 28 Oct 2023 19:04:56 +0300 Subject: [PATCH 22/41] ... --- docker/initialize.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docker/initialize.sh b/docker/initialize.sh index af587b3d0..ad3801970 100755 --- a/docker/initialize.sh +++ b/docker/initialize.sh @@ -11,7 +11,7 @@ git checkout $(git describe --tags) # Checkout the latest release mkdir build cd build cmake .. -DBUILD_TESTING=OFF -DBUILD_EXAMPLES=OFF -DCMAKE_CUDA_ARCHITECTURES="60;70;80" #-DUSE_CUDA=OFF -make +make -j8 sudo make install cd .. cd .. @@ -23,7 +23,7 @@ git checkout dev mkdir build cd build cmake .. -DCMAKE_CUDA_ARCHITECTURES="60;70;80" #-DCUDA_ENABLED=OFF -make +make -j8 sudo make install cd .. cd .. From 0f89c74348471ac2abc8208db6dcfead4f6727da Mon Sep 17 00:00:00 2001 From: Ammar Qammaz Date: Sat, 28 Oct 2023 20:27:48 +0300 Subject: [PATCH 23/41] ... --- docker/initialize.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/docker/initialize.sh b/docker/initialize.sh index ad3801970..719492eff 100755 --- a/docker/initialize.sh +++ b/docker/initialize.sh @@ -29,8 +29,6 @@ cd .. cd .. -#sudo apt-get -y install cuda -#sudo apt -y install nvidia-cuda-toolkit python3.10 -m pip install plyfile tqdm python3.10 -m pip install https://huggingface.co/camenduru/gaussian-splatting/resolve/main/diff_gaussian_rasterization-0.0.0-cp310-cp310-linux_x86_64.whl @@ -39,4 +37,7 @@ python3.10 -m pip install torchvision ln -s docker/run.sh ./run.sh +#sudo apt-get -y install cuda +sudo apt -y install nvidia-cuda-toolkit + exit 0 From 39c6cc375ea653bdec53e44c2519eafed9ddbcf6 Mon Sep 17 00:00:00 2001 From: Ammar Qammaz Date: Sat, 28 Oct 2023 20:31:17 +0300 Subject: [PATCH 24/41] ... --- docker/run.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker/run.sh b/docker/run.sh index 306b7de3c..546f90a01 100755 --- a/docker/run.sh +++ b/docker/run.sh @@ -21,6 +21,6 @@ fi python3.10 convert.py -s $1-data/ #--no_gpu -python3.10 train.py -s $1-data/ -r 1 --model_path=$1-data/output/ +python3.10 train.py -s $1-data/ --model_path=$1-data/output/ #-r 1 exit 0 From eef9ec607308220fe4595ac1d21c7eb2c564d7f9 Mon Sep 17 00:00:00 2001 From: Ammar Qammaz Date: Sat, 28 Oct 2023 23:20:04 +0300 Subject: [PATCH 25/41] ... --- docker/run.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/docker/run.sh b/docker/run.sh index 546f90a01..6d2700255 100755 --- a/docker/run.sh +++ b/docker/run.sh @@ -23,4 +23,8 @@ fi python3.10 convert.py -s $1-data/ #--no_gpu python3.10 train.py -s $1-data/ --model_path=$1-data/output/ #-r 1 +#pack it in +tar cvfjh "$1.tar.bz2" $1-data/ + + exit 0 From ffea011444fabddf8ee05e46a57094237bb07198 Mon Sep 17 00:00:00 2001 From: Ammar Qammaz Date: Sat, 28 Oct 2023 23:31:30 +0300 Subject: [PATCH 26/41] ,,, --- docker/initialize.sh | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/docker/initialize.sh b/docker/initialize.sh index 719492eff..0fe985ee6 100755 --- a/docker/initialize.sh +++ b/docker/initialize.sh @@ -5,6 +5,13 @@ #cd cuda-samples +#also get add-ons +git clone https://github.com/antimatter15/splat +git clone https://github.com/ReshotAI/gaussian-splatting-blender-addon/ + + + + git clone https://ceres-solver.googlesource.com/ceres-solver cd ceres-solver git checkout $(git describe --tags) # Checkout the latest release From 90ffc7dbb0f6680601a160f3ab5c8003e5ab5fd3 Mon Sep 17 00:00:00 2001 From: Ammar Qammaz Date: Sun, 29 Oct 2023 00:03:22 +0300 Subject: [PATCH 27/41] ... --- docker/Dockerfile | 1 + docker/run.sh | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/docker/Dockerfile b/docker/Dockerfile index 68c012e25..637187e5b 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -17,6 +17,7 @@ RUN \ build-essential \ cmake \ ffmpeg \ + imagemagick \ unzip \ freeglut3-dev \ libopencv-dev \ diff --git a/docker/run.sh b/docker/run.sh index 6d2700255..f1cc0da3b 100755 --- a/docker/run.sh +++ b/docker/run.sh @@ -21,10 +21,10 @@ fi python3.10 convert.py -s $1-data/ #--no_gpu -python3.10 train.py -s $1-data/ --model_path=$1-data/output/ #-r 1 +python3.10 train.py -s $1-data/ -r 1 #--model_path=$1-data/output/ # #pack it in -tar cvfjh "$1.tar.bz2" $1-data/ +#tar cvfjh "$1.tar.bz2" $1-data/ exit 0 From 00e5e6eb1feadcc3bc7f3fbe96040390b5851ddb Mon Sep 17 00:00:00 2001 From: Ammar Qammaz Date: Sun, 29 Oct 2023 00:24:39 +0300 Subject: [PATCH 28/41] ... --- docker/initialize.sh | 4 ++-- docker/run.sh | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/docker/initialize.sh b/docker/initialize.sh index 0fe985ee6..350f56684 100755 --- a/docker/initialize.sh +++ b/docker/initialize.sh @@ -14,7 +14,7 @@ git clone https://github.com/ReshotAI/gaussian-splatting-blender-addon/ git clone https://ceres-solver.googlesource.com/ceres-solver cd ceres-solver -git checkout $(git describe --tags) # Checkout the latest release +#git checkout $(git describe --tags) # Checkout the latest release mkdir build cd build cmake .. -DBUILD_TESTING=OFF -DBUILD_EXAMPLES=OFF -DCMAKE_CUDA_ARCHITECTURES="60;70;80" #-DUSE_CUDA=OFF @@ -26,7 +26,7 @@ cd .. git clone https://github.com/colmap/colmap cd colmap -git checkout dev +#git checkout dev mkdir build cd build cmake .. -DCMAKE_CUDA_ARCHITECTURES="60;70;80" #-DCUDA_ENABLED=OFF diff --git a/docker/run.sh b/docker/run.sh index f1cc0da3b..3dde6ba6f 100755 --- a/docker/run.sh +++ b/docker/run.sh @@ -20,7 +20,7 @@ else fi -python3.10 convert.py -s $1-data/ #--no_gpu +python3.10 convert.py -s $1-data/ #--skip_matching #--no_gpu python3.10 train.py -s $1-data/ -r 1 #--model_path=$1-data/output/ # #pack it in From ef5f8e9fd211cbe4b5276235f63411a494bf5ac4 Mon Sep 17 00:00:00 2001 From: Ammar Qammaz Date: Sun, 29 Oct 2023 00:40:29 +0300 Subject: [PATCH 29/41] ... --- docker/run.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker/run.sh b/docker/run.sh index 3dde6ba6f..9d97898d1 100755 --- a/docker/run.sh +++ b/docker/run.sh @@ -21,7 +21,7 @@ fi python3.10 convert.py -s $1-data/ #--skip_matching #--no_gpu -python3.10 train.py -s $1-data/ -r 1 #--model_path=$1-data/output/ # +python3.10 train.py -s $1-data/ -r 1 --model_path=$1-data/output/ # #pack it in #tar cvfjh "$1.tar.bz2" $1-data/ From 93a9a1ef8883d3c592eb416f70ad551eb161ca8b Mon Sep 17 00:00:00 2001 From: Ammar Qammaz Date: Sun, 29 Oct 2023 02:33:24 +0300 Subject: [PATCH 30/41] ... --- docker/initialize.sh | 8 ++++++++ docker/run.sh | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/docker/initialize.sh b/docker/initialize.sh index 350f56684..007ef11c4 100755 --- a/docker/initialize.sh +++ b/docker/initialize.sh @@ -44,6 +44,14 @@ python3.10 -m pip install torchvision ln -s docker/run.sh ./run.sh +#Build viewer +#sudo apt install -y libimgui-dev libglew-dev libassimp-dev libboost-all-dev libgtk-3-dev libopencv-dev libglfw3-dev libavdevice-dev libavcodec-dev libeigen3-dev libxxf86vm-dev libembree-dev +#git clone https://github.com/JayFoxRox/SIBR_viewers +#cd SIBR_viewers +#cmake -Bbuild . -DCMAKE_BUILD_TYPE=Release -DASSIMP_LIBRARY=/usr/lib/x86_64-linux-gnu/libassimp.so +#cmake --build build -j24 --target install +#cd .. + #sudo apt-get -y install cuda sudo apt -y install nvidia-cuda-toolkit diff --git a/docker/run.sh b/docker/run.sh index 9d97898d1..ab9a410f1 100755 --- a/docker/run.sh +++ b/docker/run.sh @@ -20,7 +20,7 @@ else fi -python3.10 convert.py -s $1-data/ #--skip_matching #--no_gpu +python3.10 convert.py -s $1-data/ --camera SIMPLE_RADIAL --no_gpu #GPU produces worse results (?) python3.10 train.py -s $1-data/ -r 1 --model_path=$1-data/output/ # #pack it in From 86e0d77b6b8b04604fd5cd1b3864c64f9db54caa Mon Sep 17 00:00:00 2001 From: Ammar Qammaz Date: Mon, 30 Oct 2023 16:40:34 +0200 Subject: [PATCH 31/41] ... --- docker/run.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker/run.sh b/docker/run.sh index ab9a410f1..81f6d76dd 100755 --- a/docker/run.sh +++ b/docker/run.sh @@ -4,7 +4,7 @@ DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" cd "$DIR" -cd .. +#cd .. mkdir -p $1-data/input mkdir -p $1-data/output From c2fe77c0aad83de220f5623a154d808adf17788b Mon Sep 17 00:00:00 2001 From: Ammar Qammaz Date: Tue, 31 Oct 2023 18:03:28 +0200 Subject: [PATCH 32/41] add 3dgsconverter --- docker/initialize.sh | 3 ++- docker/run.sh | 3 +++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/docker/initialize.sh b/docker/initialize.sh index 007ef11c4..b9753faa3 100755 --- a/docker/initialize.sh +++ b/docker/initialize.sh @@ -8,6 +8,7 @@ #also get add-ons git clone https://github.com/antimatter15/splat git clone https://github.com/ReshotAI/gaussian-splatting-blender-addon/ +git clone https://github.com/francescofugazzi/3dgsconverter #needs scikit-learn @@ -37,7 +38,7 @@ cd .. -python3.10 -m pip install plyfile tqdm +python3.10 -m pip install plyfile tqdm scikit-learn python3.10 -m pip install https://huggingface.co/camenduru/gaussian-splatting/resolve/main/diff_gaussian_rasterization-0.0.0-cp310-cp310-linux_x86_64.whl python3.10 -m pip install https://huggingface.co/camenduru/gaussian-splatting/resolve/main/simple_knn-0.0.0-cp310-cp310-linux_x86_64.whl python3.10 -m pip install torchvision diff --git a/docker/run.sh b/docker/run.sh index 81f6d76dd..834e1f018 100755 --- a/docker/run.sh +++ b/docker/run.sh @@ -23,6 +23,9 @@ fi python3.10 convert.py -s $1-data/ --camera SIMPLE_RADIAL --no_gpu #GPU produces worse results (?) python3.10 train.py -s $1-data/ -r 1 --model_path=$1-data/output/ # +python3.10 3dgsconverter/3dgsconverter.py -i $1-data/output/point_cloud/iteration_30000/point_cloud.ply -o $1-data/output/point_cloud/iteration_30000/output_cc.ply -f cc --rgb --density_filter --remove_flyers +python3.10 3dgsconverter/3dgsconverter.py -i $1-data/output/output/point_cloud/iteration_30000/output_cc.ply -o $1-data/output/output/point_cloud/iteration_30000/point_cloud_clean.ply -f 3dgs + #pack it in #tar cvfjh "$1.tar.bz2" $1-data/ From b4b6635bff3d6d756e89b50faecf7e80fd14f002 Mon Sep 17 00:00:00 2001 From: Ammar Qammaz Date: Thu, 2 Nov 2023 21:32:58 +0200 Subject: [PATCH 33/41] allow more budget.. --- docker/run.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker/run.sh b/docker/run.sh index 81f6d76dd..9ea63dcf8 100755 --- a/docker/run.sh +++ b/docker/run.sh @@ -21,7 +21,7 @@ fi python3.10 convert.py -s $1-data/ --camera SIMPLE_RADIAL --no_gpu #GPU produces worse results (?) -python3.10 train.py -s $1-data/ -r 1 --model_path=$1-data/output/ # +python3.10 train.py -s $1-data/ -r 1 --model_path=$1-data/output/ --position_lr_init 0.000016 --scaling_lr 0.001 --iterations 100000 #Test more training budget #pack it in #tar cvfjh "$1.tar.bz2" $1-data/ From 1ceaf718bbe6db4063391e9c966809c3d0fbdaa8 Mon Sep 17 00:00:00 2001 From: Ammar Qammaz Date: Thu, 2 Nov 2023 22:00:49 +0200 Subject: [PATCH 34/41] ... --- docker/run.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker/run.sh b/docker/run.sh index 71c88cd58..8210625b2 100755 --- a/docker/run.sh +++ b/docker/run.sh @@ -21,7 +21,7 @@ fi python3.10 convert.py -s $1-data/ --camera SIMPLE_RADIAL --no_gpu #GPU produces worse results (?) -python3.10 train.py -s $1-data/ -r 1 --model_path=$1-data/output/ --position_lr_init 0.000016 --scaling_lr 0.001 --iterations 100000 #Test more training budget +python3.10 train.py -s $1-data/ -r 1 --model_path=$1-data/output/ --position_lr_init 0.000016 --position_lr_final 0.000001 --scaling_lr 0.001 --iterations 100000 #Test more training budget python3.10 3dgsconverter/3dgsconverter.py -i $1-data/output/point_cloud/iteration_30000/point_cloud.ply -o $1-data/output/point_cloud/iteration_30000/output_cc.ply -f cc --rgb --density_filter --remove_flyers python3.10 3dgsconverter/3dgsconverter.py -i $1-data/output/output/point_cloud/iteration_30000/output_cc.ply -o $1-data/output/output/point_cloud/iteration_30000/point_cloud_clean.ply -f 3dgs From af89ad77cecc6fac57c9a56cf20bbcc9fe024d26 Mon Sep 17 00:00:00 2001 From: Ammar Qammaz Date: Fri, 3 Nov 2023 09:07:24 +0200 Subject: [PATCH 35/41] add best last results.. --- docker/run.sh | 2 +- train.py | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/docker/run.sh b/docker/run.sh index 8210625b2..64735fa7e 100755 --- a/docker/run.sh +++ b/docker/run.sh @@ -21,7 +21,7 @@ fi python3.10 convert.py -s $1-data/ --camera SIMPLE_RADIAL --no_gpu #GPU produces worse results (?) -python3.10 train.py -s $1-data/ -r 1 --model_path=$1-data/output/ --position_lr_init 0.000016 --position_lr_final 0.000001 --scaling_lr 0.001 --iterations 100000 #Test more training budget +python3.10 train.py -s $1-data/ -r 1 --model_path=$1-data/output/ --position_lr_init 0.000016 --scaling_lr 0.001 --iterations 35000 #Test more training budget python3.10 3dgsconverter/3dgsconverter.py -i $1-data/output/point_cloud/iteration_30000/point_cloud.ply -o $1-data/output/point_cloud/iteration_30000/output_cc.ply -f cc --rgb --density_filter --remove_flyers python3.10 3dgsconverter/3dgsconverter.py -i $1-data/output/output/point_cloud/iteration_30000/output_cc.ply -o $1-data/output/output/point_cloud/iteration_30000/point_cloud_clean.ply -f 3dgs diff --git a/train.py b/train.py index 5d819b348..c0f8b220d 100644 --- a/train.py +++ b/train.py @@ -29,6 +29,9 @@ TENSORBOARD_FOUND = False def training(dataset, opt, pipe, testing_iterations, saving_iterations, checkpoint_iterations, checkpoint, debug_from): + bestLossEncountered = 1000000 + pickBetweenFinalNLosses = 10 + first_iter = 0 tb_writer = prepare_output_and_logger(dataset) gaussians = GaussianModel(dataset.sh_degree) @@ -103,6 +106,10 @@ def training(dataset, opt, pipe, testing_iterations, saving_iterations, checkpoi if iteration == opt.iterations: progress_bar.close() + if (bestLossEncountered>ema_loss_for_log) and (pickBetweenFinalNLosses+iteration > opt.iterations): + print("\n[ITER {}] Also remembering this iteration..".format(iteration)) + saving_iterations.append(iteration) + # Log and save training_report(tb_writer, iteration, Ll1, loss, l1_loss, iter_start.elapsed_time(iter_end), testing_iterations, scene, render, (pipe, background)) if (iteration in saving_iterations): From 4e36f28d47b15b2f25c45e3412986fbc7e87c6a5 Mon Sep 17 00:00:00 2001 From: Ammar Qammaz Date: Fri, 3 Nov 2023 09:31:20 +0200 Subject: [PATCH 36/41] ... --- train.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/train.py b/train.py index c0f8b220d..abcf056f2 100644 --- a/train.py +++ b/train.py @@ -29,8 +29,9 @@ TENSORBOARD_FOUND = False def training(dataset, opt, pipe, testing_iterations, saving_iterations, checkpoint_iterations, checkpoint, debug_from): - bestLossEncountered = 1000000 - pickBetweenFinalNLosses = 10 + bestLossEncountered = 1000000 + bestIterationEncountered = 0 + pickBetweenFinalNLosses = 10 first_iter = 0 tb_writer = prepare_output_and_logger(dataset) @@ -107,7 +108,12 @@ def training(dataset, opt, pipe, testing_iterations, saving_iterations, checkpoi progress_bar.close() if (bestLossEncountered>ema_loss_for_log) and (pickBetweenFinalNLosses+iteration > opt.iterations): - print("\n[ITER {}] Also remembering this iteration..".format(iteration)) + if (bestIterationEncountered!=0): + print("\n[ITER {}] Erasing this iteration..".format(bestIterationEncountered)) + os.system("rm point_cloud/iteration_%u/*.ply && rmdir point_cloud/iteration_%u/"%iteration) + bestLossEncountered = ema_loss_for_log + bestIterationEncountered = iteration + print("\n[ITER {}] Now remembering this iteration..".format(iteration)) saving_iterations.append(iteration) # Log and save From 7c6d2ca956bc1bea5895d4fc5f097de7e863e285 Mon Sep 17 00:00:00 2001 From: Ammar Qammaz Date: Fri, 3 Nov 2023 09:32:50 +0200 Subject: [PATCH 37/41] ... --- train.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/train.py b/train.py index abcf056f2..deead1c0b 100644 --- a/train.py +++ b/train.py @@ -31,7 +31,7 @@ def training(dataset, opt, pipe, testing_iterations, saving_iterations, checkpoint_iterations, checkpoint, debug_from): bestLossEncountered = 1000000 bestIterationEncountered = 0 - pickBetweenFinalNLosses = 10 + pickBetweenFinalNLosses = 500 #Closely monitor last 500 solutions first_iter = 0 tb_writer = prepare_output_and_logger(dataset) From 82fbc36df607853362e3fe8a3b44f639158e435b Mon Sep 17 00:00:00 2001 From: Ammar Qammaz Date: Fri, 3 Nov 2023 10:02:33 +0200 Subject: [PATCH 38/41] ... --- train.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/train.py b/train.py index deead1c0b..0f2f642fa 100644 --- a/train.py +++ b/train.py @@ -31,7 +31,7 @@ def training(dataset, opt, pipe, testing_iterations, saving_iterations, checkpoint_iterations, checkpoint, debug_from): bestLossEncountered = 1000000 bestIterationEncountered = 0 - pickBetweenFinalNLosses = 500 #Closely monitor last 500 solutions + goodLossThreshold = 0.07 first_iter = 0 tb_writer = prepare_output_and_logger(dataset) @@ -107,13 +107,14 @@ def training(dataset, opt, pipe, testing_iterations, saving_iterations, checkpoi if iteration == opt.iterations: progress_bar.close() - if (bestLossEncountered>ema_loss_for_log) and (pickBetweenFinalNLosses+iteration > opt.iterations): + + if (bestLossEncountered>ema_loss_for_log) and (goodLossThreshold > ema_loss_for_log): if (bestIterationEncountered!=0): - print("\n[ITER {}] Erasing this iteration..".format(bestIterationEncountered)) - os.system("rm point_cloud/iteration_%u/*.ply && rmdir point_cloud/iteration_%u/"%iteration) + print("\n[GOOD ITER {}] Erasing previous best iteration..".format(bestIterationEncountered)) + os.system("rm point_cloud/iteration_%u/*.ply && rmdir point_cloud/iteration_%u/"%bestIterationEncountered) bestLossEncountered = ema_loss_for_log bestIterationEncountered = iteration - print("\n[ITER {}] Now remembering this iteration..".format(iteration)) + print("\n[GOOD ITER {}] Now remembering this iteration..".format(iteration)) saving_iterations.append(iteration) # Log and save From de5bce3b2e00e02b6244f15d7058eb6770e40880 Mon Sep 17 00:00:00 2001 From: Ammar Qammaz Date: Fri, 3 Nov 2023 10:03:42 +0200 Subject: [PATCH 39/41] ... --- train.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/train.py b/train.py index 0f2f642fa..333f3d838 100644 --- a/train.py +++ b/train.py @@ -111,7 +111,7 @@ def training(dataset, opt, pipe, testing_iterations, saving_iterations, checkpoi if (bestLossEncountered>ema_loss_for_log) and (goodLossThreshold > ema_loss_for_log): if (bestIterationEncountered!=0): print("\n[GOOD ITER {}] Erasing previous best iteration..".format(bestIterationEncountered)) - os.system("rm point_cloud/iteration_%u/*.ply && rmdir point_cloud/iteration_%u/"%bestIterationEncountered) + os.system("rm point_cloud/iteration_%u/*.ply && rmdir point_cloud/iteration_%u/"%(bestIterationEncountered,bestIterationEncountered)) bestLossEncountered = ema_loss_for_log bestIterationEncountered = iteration print("\n[GOOD ITER {}] Now remembering this iteration..".format(iteration)) From f5b136264bf029c00a9b81ef30d8799592b2225b Mon Sep 17 00:00:00 2001 From: Ammar Qammaz Date: Fri, 3 Nov 2023 10:29:50 +0200 Subject: [PATCH 40/41] ... --- train.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/train.py b/train.py index 333f3d838..19ed7d874 100644 --- a/train.py +++ b/train.py @@ -111,7 +111,7 @@ def training(dataset, opt, pipe, testing_iterations, saving_iterations, checkpoi if (bestLossEncountered>ema_loss_for_log) and (goodLossThreshold > ema_loss_for_log): if (bestIterationEncountered!=0): print("\n[GOOD ITER {}] Erasing previous best iteration..".format(bestIterationEncountered)) - os.system("rm point_cloud/iteration_%u/*.ply && rmdir point_cloud/iteration_%u/"%(bestIterationEncountered,bestIterationEncountered)) + os.system("rm %s/point_cloud/iteration_%u/*.ply && rmdir %s/point_cloud/iteration_%u/"%(scene.model_path,bestIterationEncountered,scene.model_path,bestIterationEncountered)) bestLossEncountered = ema_loss_for_log bestIterationEncountered = iteration print("\n[GOOD ITER {}] Now remembering this iteration..".format(iteration)) From 1acf7a3900ece5d23d7621f0b8090816301a5e45 Mon Sep 17 00:00:00 2001 From: Ammar Qammaz Date: Fri, 3 Nov 2023 23:24:59 +0200 Subject: [PATCH 41/41] ... --- docker/run.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker/run.sh b/docker/run.sh index 64735fa7e..f0bc983c6 100755 --- a/docker/run.sh +++ b/docker/run.sh @@ -24,7 +24,7 @@ python3.10 convert.py -s $1-data/ --camera SIMPLE_RADIAL --no_gpu #GPU produces python3.10 train.py -s $1-data/ -r 1 --model_path=$1-data/output/ --position_lr_init 0.000016 --scaling_lr 0.001 --iterations 35000 #Test more training budget python3.10 3dgsconverter/3dgsconverter.py -i $1-data/output/point_cloud/iteration_30000/point_cloud.ply -o $1-data/output/point_cloud/iteration_30000/output_cc.ply -f cc --rgb --density_filter --remove_flyers -python3.10 3dgsconverter/3dgsconverter.py -i $1-data/output/output/point_cloud/iteration_30000/output_cc.ply -o $1-data/output/output/point_cloud/iteration_30000/point_cloud_clean.ply -f 3dgs +python3.10 3dgsconverter/3dgsconverter.py -i $1-data/output/point_cloud/iteration_30000/output_cc.ply -o $1-data/output/point_cloud/iteration_30000/point_cloud_clean.ply -f 3dgs #pack it in #tar cvfjh "$1.tar.bz2" $1-data/