Skip to content

Commit 3557350

Browse files
committed
pySLAM v2 master update
very concise list of updates: - fixed many bugs - huge refactoring - added keyframe management with covisibility graph - added multi-threading - added support for many modern local features
1 parent 76c9a64 commit 3557350

File tree

614 files changed

+132242
-3306
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

614 files changed

+132242
-3306
lines changed

.gitignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,9 @@ matches.txt
1414
map.png
1515
.vscode
1616
videos/webcam
17+
18+
kf_info.log
19+
local_mapping.log
20+
tum_association_matches.txt
21+
22+
thirdparty/protoc

.gitmodules

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,27 @@
44
[submodule "thirdparty/tfeat"]
55
path = thirdparty/tfeat
66
url = https://github.com/vbalnt/tfeat.git
7+
[submodule "thirdparty/hardnet"]
8+
path = thirdparty/hardnet
9+
url = https://github.com/DagnyT/hardnet
10+
[submodule "thirdparty/SOSNet"]
11+
path = thirdparty/SOSNet
12+
url = https://github.com/yuruntian/SOSNet.git
13+
[submodule "thirdparty/logpolar"]
14+
path = thirdparty/logpolar
15+
url = https://github.com/cvlab-epfl/log-polar-descriptors.git
16+
[submodule "thirdparty/d2net"]
17+
path = thirdparty/d2net
18+
url = https://github.com/mihaidusmanu/d2-net.git
19+
[submodule "thirdparty/tensorflow_models"]
20+
path = thirdparty/tensorflow_models
21+
url = https://github.com/tensorflow/models
22+
[submodule "thirdparty/lfnet"]
23+
path = thirdparty/lfnet
24+
url = https://github.com/vcg-uvic/lf-net-release.git
25+
[submodule "thirdparty/r2d2"]
26+
path = thirdparty/r2d2
27+
url = https://github.com/naver/r2d2.git
28+
[submodule "thirdparty/keynet"]
29+
path = thirdparty/keynet
30+
url = https://github.com/axelBarroso/Key.Net.git

CONDA.md

Lines changed: 69 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,80 @@
1-
# Test under Anaconda
1+
# Install under Anaconda or Miniconda
2+
3+
I've successfully tested `pyslam` under [Anaconda](https://docs.anaconda.com/anaconda/install/linux/) (version *2019.10*, build *py37_0*) and [Miniconda](https://docs.conda.io/en/latest/miniconda.html#linux-installers) (SHA256 hash *957d2f0f0701c3d1335e3b39f235d197837ad69a944fa6f5d8ad2c686b69df3b*).
4+
Please, follow the instructions below.
5+
6+
## Create a `pyslam` conda environment
7+
8+
In order to create a custom `pyslam` conda environment, run the following command:
9+
```
10+
$ . pyenv-conda-create.sh
11+
```
12+
13+
## Activate the created `pyslam` conda environment
14+
15+
Run the following command:
16+
```
17+
$ . pyenv-conda-activate.sh
18+
```
19+
or
20+
```
21+
$ conda activate pyslam
22+
```
23+
24+
# Deactivate `pyslam` conda environment
25+
26+
To deactivate the `pyslam` environment, use
27+
```
28+
$ conda deactivate
29+
```
30+
31+
---
32+
# General Notes About Conda
33+
34+
Below, you can find some useful details. The scripts mentioned above make the work for you.
35+
36+
## Install packages/env from file
37+
38+
You can generate a `requirements.txt` file by running:
39+
```
40+
$ conda list -e > requirements-conda.txt
41+
```
42+
You can create and environment from such a file by runnning:
43+
```
44+
$ conda create --name <env> --file requirements-conda.txt
45+
```
46+
47+
**N.B.**: the file `requirements.txt` generated by conda cannot be used with pip3 (and viceversa)!
48+
49+
Another approach is to use `.yml` files. In order to create a file `requirements-conda.yml` run:
50+
```
51+
$ conda env export > requirements-conda.yml
52+
```
53+
You can create an environment from it by running:
54+
```
55+
$ conda env create -f requirements.yml
56+
```
57+
58+
## Deleting an environment
59+
60+
To delete an environment, in your terminal window or an Anaconda Prompt, run:
61+
`$ conda remove --name myenv --all`
62+
63+
You may instead use
64+
`$ conda env remove --name myenv`
65+
To verify that the environment was removed, in your terminal window or an Anaconda Prompt, run:
66+
`$ conda info --envs`
67+
The environments list that displays should not show the removed environment.
268

3-
I've successfully tested `main_vo.py` under Anaconda (version 2019.10). Please, follow the instructions below.
469

570
In order to create a new conda environment `opencvenv`, activate it and install OpenCV in it, run the following commands:
671
```
7-
$ conda create -yn opencvenv python=3.6
72+
$ conda create -yn opencvenv python=3.6.9
873
$ conda activate opencvenv
974
$ conda install -c menpo opencv3
1075
```
1176
This should install OpenCV 3.4.1 and everything you need to run SIFT and SURF.
77+
1278
In order to install pytorch and torchvision:
1379
```
1480
$ conda install pytorch torchvision cudatoolkit=10.1 -c pytorch
@@ -33,9 +99,3 @@ To re-activate the conda `opencvenv` environment, use
3399
```
34100
$ conda activate opencvenv
35101
```
36-
37-
## TODO
38-
Test the following script under Anaconda
39-
```
40-
$ ./install_thirdparty.sh
41-
```

PYTHON-VIRTUAL-ENVS.md

Lines changed: 110 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,110 @@
1+
# pySLAM2 Virtual Environment
2+
3+
## Create a `pyslam` python virtual environment
4+
5+
In order to create a custom `pyslam` python virtual environment, get in the root of this repository and run the following command:
6+
```
7+
$ . pyenv-create.sh
8+
```
9+
**N.B.**: do not forget the dot!
10+
11+
This will create and activate a python virtual environment `pyslam` where to safely run pyslam scripts.
12+
13+
## Activate the created `pyslam` environment
14+
15+
Run the following command:
16+
```
17+
$ . pyenv-activate.sh
18+
```
19+
Now, you can launch pySLAM scripts.
20+
21+
## Deactivate `pyslam` environment
22+
23+
Run the command:
24+
```
25+
$ deactivate
26+
```
27+
28+
29+
---
30+
# General Notes About Python Virtual Environments
31+
32+
Below, you can find some useful details. The scripts mentioned above make the work for you.
33+
34+
## Install virtualenv package
35+
36+
```
37+
sudo apt install python3-venv
38+
```
39+
40+
## Where to create a new virtual environment
41+
42+
You can create a new directory where to deploy the new environment with name `venv-name`
43+
```
44+
$ mkdir -p ~/.python/venvs/<venv-name>
45+
$ cd ~/.python/venvs/<venv-name>
46+
```
47+
Create a new virtual environment inside the directory:
48+
```
49+
$ python3 -m venv <venv-name>
50+
```
51+
52+
## Activate the environment
53+
54+
In order to use this environment’s packages/resources in isolation, you need to “activate” it. To do this, just run the following:
55+
56+
```
57+
$ source ~/.python/venvs/<venv-name>/bin/activate
58+
```
59+
This will return in your shell a prefixed prompt with the name of your environment
60+
```
61+
(env) $
62+
```
63+
This is the indicator that env is currently active, which means the python executable will only use this environment’s packages and settings.
64+
65+
66+
## Deactivate the environment
67+
68+
Run the following command
69+
```
70+
(env) $ deactivate
71+
```
72+
This will removed the prefixed prompt.
73+
74+
## Install packages from requirements.txt
75+
76+
You can generate a `requirements.txt` file by running:
77+
```
78+
$ pip3 freeze > requirements-pip3.txt
79+
```
80+
You can install from such a file by runnning:
81+
```
82+
$ pip3 install -r requirements-pip3.txt
83+
```
84+
85+
**N.B.**: the file `requirements.txt` generated by pip3 cannot be used with conda (and viceversa)!
86+
87+
## Check if you are in an activated virtual environment
88+
89+
From shell check the shell prefix, as explained above
90+
91+
From a script, you can use the following code:
92+
```
93+
function get_after_last_slash(){
94+
ret=$(echo $1 | sed 's:.*/::')
95+
echo $ret
96+
}
97+
function get_virtualenv_name(){
98+
cmd_out=$(printenv | grep VIRTUAL_ENV)
99+
virtual_env_name=$(get_after_last_slash $cmd_out)
100+
echo $virtual_env_name
101+
}
102+
```
103+
the function `get_virtualenv_name` returns the name of the path of the activated virtual environment.
104+
If no virtual environment has been activated then the output will be empty.
105+
106+
107+
108+
## Links
109+
110+
* https://realpython.com/python-virtual-environments-a-primer/ (first and clear reference)

0 commit comments

Comments
 (0)