Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add core dependencies installation script #80

Open
wants to merge 14 commits into
base: main
Choose a base branch
from
14 changes: 11 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,17 @@ T_w_i = sessions.trajectories[keys[0]] # first pose, from sensor/rig to world

:one: Install the core dependencies:

- Python >= 3.9
- [hloc v1.4](https://github.com/cvg/Hierarchical-Localization) and its dependencies, including [COLMAP 3.8](https://colmap.github.io/install.html) built from source.
- [pyceres](https://github.com/cvg/pyceres) built from source at tag v1.0.
- Python >= 3.9, we recommend to use the virtual environment of your choice.
ovysotska marked this conversation as resolved.
Show resolved Hide resolved
- Install in order:
* [Ceres 2.1](https://ceres-solver.googlesource.com/ceres-solver/+/refs/tags/2.1.0)
* [COLMAP 3.8](https://colmap.github.io/install.html) built from source. Follow the instructions on the page, but **DO NOT install libceres-dev!!!** We just installed a correct version in the previous step.
* [hloc 1.4](https://github.com/cvg/Hierarchical-Localization) and its dependencies
* [pyceres](https://github.com/cvg/pyceres) built from source at tag v1.0.

or use the provided script:
```bash
./install_core_dependencies.sh
```

:two: Install the LaMAR libraries and pull the remaining pip dependencies:
```bash
Expand Down
101 changes: 101 additions & 0 deletions install_core_dependencies.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
# Create a directory for all the dependencies
mkdir external
cd external

#######################
## Installing Ceres-Solver with tag 2.1.0
## Check webpage https://ceres-solver.googlesource.com/ceres-solver/+/refs/tags/2.1.0 for more details
git clone --no-checkout https://ceres-solver.googlesource.com/ceres-solver ceres_v2.1.0
cd ceres_v2.1.0
git checkout f68321e7de8929fbcdb95dd42877531e64f72f66

# Installing system-wide dependencies for Ceres
# Commands from http://ceres-solver.org/installation.html
echo "Installing system-wide dependencies cmake build-essential libgoogle-glog-dev libgflags-dev libatlas-base-dev libeigen3-dev libsuitesparse-dev"
sudo apt-get install cmake libgoogle-glog-dev libgflags-dev libatlas-base-dev libeigen3-dev libsuitesparse-dev build-essential

mkdir build
cd build
cmake ..
make -j4
sudo make install
cd .. # exit build folder
cd .. # Exiting ceres_v2.1.0


#######################
## Installing COLMAP version 3.8
git clone https://github.com/colmap/colmap colmap_v3.8
cd colmap_v3.8
git checkout 3.8
git submodule update --init --recursive

# # Installation instructions from https://colmap.github.io/install.html#build-from-source
echo "Installing system-wide dependencies
ninja-build \
libboost-program-options-dev \
libboost-filesystem-dev \
libboost-graph-dev \
libboost-system-dev \
libeigen3-dev \
libflann-dev \
libfreeimage-dev \
libmetis-dev \
libgoogle-glog-dev \
libgtest-dev \
libgmock-dev \
libsqlite3-dev \
libglew-dev \
qtbase5-dev \
libqt5opengl5-dev \
libcgal-dev \ "
sudo apt-get install \
ninja-build \
libboost-program-options-dev \
libboost-filesystem-dev \
libboost-graph-dev \
libboost-system-dev \
libeigen3-dev \
libflann-dev \
libfreeimage-dev \
libmetis-dev \
libgoogle-glog-dev \
libgtest-dev \
libgmock-dev \
libsqlite3-dev \
libglew-dev \
qtbase5-dev \
libqt5opengl5-dev \
libcgal-dev \

mkdir build
cd build
cmake .. -GNinja -DCMAKE_CUDA_ARCHITECTURES=all
ninja
sudo ninja install

cd .. # exit build folder
cd .. # exit colmap_v3.8

#######################
## Installing HLOC version 1.4
git clone --recursive https://github.com/cvg/Hierarchical-Localization/ hloc_v1.4
cd hloc_v1.4
git checkout v1.4
git submodule update --init --recursive

# installing
echo "Installing hloc...."
python -m pip install -e .

cd .. # exit hloc_v1.4 folder

### Installing pyceres version 1.0
git clone https://github.com/cvg/pyceres.git pyceres_v1.0
cd pyceres_v1.0
git checkout v1.0
git submodule update --init --recursive

# installing pyceres
python -m pip install .
cd .. # exit pyceres
5 changes: 3 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ dependencies = [
"numpy==1.26.3",
"torch>=1.1",
"tqdm>=4.36.0",
"pycolmap==0.6.0",
"pycolmap==0.4.0",
"scikit-learn==1.5.2", # is needed for hloc
"pyceres @ git+https://github.com/cvg/[email protected]",
]
urls = {Repository = "https://github.com/microsoft/lamar-benchmark"}
Expand All @@ -34,7 +35,7 @@ scantools = [
"pyzbar-upright==0.1.8",
"rawpy==0.19.1",
"scipy==1.11.4",
"numpy==1.26.4",
"numpy==1.26.3",
"pillow==10.3.0",
]
dev = [
Expand Down