Skip to content

Commit

Permalink
update docker usage in documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
jmorat committed Mar 13, 2024
1 parent e4d7970 commit a908894
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 8 deletions.
33 changes: 27 additions & 6 deletions doc/installation.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,30 @@ We provide a docker image that can be run like this:

[source,bash]
----
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 \
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:
[source,bash]
----
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:

. https://github.com/colmap/colmap/discussions/2386[colmap xhost issue]
. https://github.com/colmap/colmap/blob/main/docker/run-gui.sh[colmap docker]

You can also build your own docker image as follow:

[source,bash]
Expand All @@ -37,16 +55,19 @@ Requirements:
=== linux (Ubuntu 22.04 LTS)

kapture-localization requires a recent version of COLMAP (>=3.6).
Unfortunately, `apt-get` in Ubuntu 20.04 will install COLMAP 3.4.
A solution is **to install COLMAP from source**. You will find instructions of how to do that in the link:../Dockerfile[Dockerfile] and on the https://colmap.github.io/install.html[COLMAP website].
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 link:../Dockerfile[Dockerfile]
and on the https://colmap.github.io/install.html[COLMAP website].

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

[source,bash]
----
# install requirements
# make sure you have COLMAP 3.6 (see above instructions)
sudo apt-get install -y python3.6 python3-pip
sudo apt-get install -y python3 python3-pip
# install kapture-localization
python3 -m pip install kapture-localization
----
Expand Down
17 changes: 15 additions & 2 deletions doc/tutorial.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,13 @@ to allow symlink. They should also enable long paths. See link:installation.adoc
.using docker
[source,bash]
----
docker run --runtime=nvidia -it --rm kapture/kapture-localization
docker run -it --rm \
--volume="/tmp/.X11-unix:/tmp/.X11-unix:rw" \
--env="QT_X11_NO_MITSHM=1" \
--env="DISPLAY" \
--gpus all \
--privileged \
kapture/kapture-localization
cd kapture-localization
----

Expand Down Expand Up @@ -303,7 +309,14 @@ The example scripts can be found in link:https://github.com/naver/kapture-locali
We will use the pre-built docker container for these examples.
```
docker pull kapture/kapture-localization
docker run --runtime=nvidia -it --rm --volume <my_data>:<my_data> kapture/kapture-localization
docker run -it --rm
--volume="/tmp/.X11-unix:/tmp/.X11-unix:rw" \
--env="QT_X11_NO_MITSHM=1" \
--env="DISPLAY" \
--gpus all \
--privileged \
--volume <my_data>:<my_data> \
kapture/kapture-localization
```

The path specified in WORKING_DIR (defined in the scripts) can be the same for all examples. There will be a subfolder that contains the downloaded datasets and a subfolder that contains the processed data for each example.
Expand Down

0 comments on commit a908894

Please sign in to comment.