Skip to content

Latest commit

 

History

History
164 lines (121 loc) · 5.35 KB

installation.adoc

File metadata and controls

164 lines (121 loc) · 5.35 KB

kapture-localization / installation

You can install this toolbox using docker, pip or manually from the source code.

1. Docker: the fast way

We provide a docker image that can be run like this:

docker run --runtime=nvidia `# benefit from the GPU acceleration` \
    -it --rm `# automatically remove the container when it exits` \
    --volume <my_data>:<my_data> `# give access to your data on your machine` \
    kapture/kapture-localization

If you want to be able to open colmap gui, you need extra arguments:

xhost +local:root # allow access the running X server
docker run --runtime=nvidia -it --rm \
    --volume="/tmp/.X11-unix:/tmp/.X11-unix:rw" \
    --env="QT_X11_NO_MITSHM=1" \
    --env="DISPLAY"  \
    --gpus all \
    --privileged \
 kapture/kapture-localization

See full details on colmap repo:

You can also build your own docker image as follow:

git clone https://github.com/naver/kapture-localization.git
cd kapture-localization
docker build --tag kapture/kapture-localization .

2. pip: the simple way

Requirements:

  • python (>=3.8) + python3-pip

  • COLMAP (>=3.6)

linux (Ubuntu 22.04 LTS)

kapture-localization requires a recent version of COLMAP (>=3.6). Ubuntu 22.04 apt provides colmap 3.7, that should be ok. Unfortunately, Ubuntu 18.04 apt-get in will install COLMAP 3.4. A solution is to install COLMAP from source. You will find instructions of how to do that in the Dockerfile and on the COLMAP website.

Then, in a terminal (e.g. bash), run:

# install requirements
# make sure you have COLMAP 3.6 (see above instructions)
sudo apt-get install -y python3 python3-pip
# install kapture-localization
python3 -m pip install kapture-localization

Windows and MacOS

Download and install the latest python 3.6 release from https://www.python.org/downloads/ for your machine.

Note
For windows user: when running the installer, tick Add Python 3.6 to PATH, then customize, make sure pip, Python test suite and py launcher are installed.

Get the latest COLMAP binaries (>=3.6) from https://github.com/colmap/colmap/releases.

Finally, in a terminal (e.g. powershell), run:

pip3 install kapture-localization

For Windows users

Symlinks

kapture-localization uses symlinks to optimize file transfer operations. However, symbolic links are not fully supported on windows platforms and may lead to permission errors. For most kapture scripts, you can use copy or skip as transfer mode in order to avoid this issue. For the pipeline scripts, you cannot avoid the use of symlinks and will have to run them as administrator.

Long Paths

kapture matches folder contains file with long names. When running the pipelines, you will most likely hit the 260 character filename limit. On Windows 10 version 1607 and later, you can enable long paths by running the following command in an elevated powershell prompt. More information here

New-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\FileSystem" -Name "LongPathsEnabled" -Value 1 -PropertyType DWORD -Force
Python file extension

You should have the file extension .py associated to the python 3.6 executable:

Windows > Choose default apps by file type > .py > python

COLMAP path

You must use colmap.bat. If the COLMAP path is not available from your %PATH% environment variable, you must provide it to kapture tools through the parameter -colmap, e.g. -colmap C:/Workspace/dev/colmap/colmap.bat.

3. From source: for developers

Note
kapture-localization can also work as a stand-alone, without being installed.

In addition to the package (pip: the simple way) requirements, you need to install git, and optionally (for documentation), pandoc and asciidoctor.

When you install kapture-localization from source, you should also install kapture from source, as the most recent changes in kapture-localization might use code from kapture which are not part of a release or pushed to pip yet.

Linux (Ubuntu 22.04 LTS)

In a terminal, do:

# install developer requirements
sudo apt-get install -y git pandoc asciidoctor
# clone source repository
git clone https://github.com/naver/kapture-localization.git
cd kapture-localization
# check everything is fine
python3 -m unittest discover -s tests
# install
python3 setup.py build install

Windows and MacOS

Download and install :

Then, in a command prompt (cmd or powershell) run:

# clone source repository
git clone https://github.com/naver/kapture-localization.git
cd kapture-localization
# check everything is fine
python -m unittest discover -s tests
# install
python setup.py build install