Merge branch 'vlad_devel' into 'master'

Euroc evaluation in CI

See merge request VladyslavUsenko/basalt!2
This commit is contained in:
Vladyslav Usenko 2019-04-15 15:39:02 +00:00
commit e4d5eca876
3 changed files with 59 additions and 13 deletions

View File

@ -1,5 +1,11 @@
image: vladyslavusenko/b_image:latest image: vladyslavusenko/b_image:latest
stages:
- build
- test
- test_results
- deploy
compile: compile:
stage: build stage: build
variables: variables:
@ -26,10 +32,13 @@ compile:
artifacts: artifacts:
paths: paths:
- deb_bionic/*.deb - deb_bionic/*.deb
- scripts/eval_full/*
expire_in: 1 week expire_in: 1 week
compile_16_04: compile_16_04:
stage: build stage: build
variables:
CXX_MARCH: 'corei7-avx'
before_script: before_script:
- mkdir -p ccache - mkdir -p ccache
- export CCACHE_BASEDIR=${PWD} - export CCACHE_BASEDIR=${PWD}
@ -57,6 +66,42 @@ compile_16_04:
- master - master
image: vladyslavusenko/b_image_xenial:latest image: vladyslavusenko/b_image_xenial:latest
eval_euroc:
stage: test
parallel: 10
tags:
- euroc-eval
variables:
GIT_STRATEGY: none
only:
- master
artifacts:
paths:
- scripts/eval_full/eval_results/*
expire_in: 1 week
script:
- dpkg -i deb_bionic/*.deb
- cd scripts/eval_full
- ./run_evaluations.sh
gen_results_euroc:
stage: test_results
variables:
GIT_STRATEGY: none
when: on_success
only:
- master
artifacts:
paths:
- euroc_results.txt
script:
- cd scripts/eval_full
- ./gen_results.py eval_results > euroc_results.txt
- cat euroc_results.txt
- mv euroc_results.txt ../../
deploy: deploy:
stage: deploy stage: deploy
before_script: before_script:

View File

@ -2,7 +2,6 @@
import os import os
import sys import sys
import numpy as np
datasets = ['MH_01_easy', 'MH_02_easy', 'MH_03_medium', 'MH_04_difficult', datasets = ['MH_01_easy', 'MH_02_easy', 'MH_03_medium', 'MH_04_difficult',
@ -20,14 +19,16 @@ out_dir = sys.argv[1]
for key in datasets: for key in datasets:
fname = out_dir + '/vio_' + key fname = out_dir + '/vio_' + key
if os.path.isfile(fname): if os.path.isfile(fname):
res = round(float(np.loadtxt(fname)), 3) with open(fname, 'r') as f:
res = round(float(f.read()), 3)
results_vio.append(float(res)) results_vio.append(float(res))
else: else:
results_vio.append(float('Inf')) results_vio.append(float('Inf'))
fname = out_dir + '/mapper_' + key fname = out_dir + '/mapper_' + key
if os.path.isfile(fname): if os.path.isfile(fname):
res = round(float(np.loadtxt(fname)), 3) with open(fname, 'r') as f:
res = round(float(f.read()), 3)
results_mapping.append(float(res)) results_mapping.append(float(res))
else: else:
results_mapping.append(float('Inf')) results_mapping.append(float('Inf'))

View File

@ -5,22 +5,22 @@ set -x
DATASET_PATH=/data/euroc DATASET_PATH=/data/euroc
DATASETS=(MH_01_easy MH_02_easy MH_03_medium MH_04_difficult MH_05_difficult V1_01_easy V1_02_medium V1_03_difficult V2_01_easy V2_02_medium V2_03_difficult) DATASETS=(MH_01_easy MH_02_easy MH_03_medium MH_04_difficult MH_05_difficult V1_01_easy V1_02_medium V1_03_difficult V2_01_easy V2_02_medium)
folder_name=eval_$(date +%Y%m%d_%H%M%S) folder_name=eval_results
mkdir $folder_name mkdir $folder_name
cp ../../data/euroc_config.json $folder_name/config.json
for d in ${DATASETS[@]}; do for d in ${DATASETS[$CI_NODE_INDEX-1]}; do
../../build/basalt_vio --dataset-path $DATASET_PATH/$d --cam-calib ../../data/euroc_ds_calib.json \ basalt_vio --dataset-path $DATASET_PATH/$d --cam-calib /usr/etc/basalt/euroc_ds_calib.json \
--dataset-type euroc --show-gui 0 --config-path $folder_name/config.json \ --dataset-type euroc --show-gui 0 --config-path /usr/etc/basalt/euroc_config.json \
--result-path $folder_name/vio_$d --marg-data $folder_name/marg_$d/ --result-path $folder_name/vio_$d --marg-data eval_tmp_marg_data
../../build/basalt_mapper --show-gui 0 --cam-calib ../../data/euroc_ds_calib.json --marg-data $folder_name/marg_$d/ \ basalt_mapper --show-gui 0 --cam-calib /usr/etc/basalt/euroc_ds_calib.json --marg-data eval_tmp_marg_data \
--vocabulary ../../thirdparty/DBoW3/vocab/orbvoc.dbow3 --result-path $folder_name/mapper_$d --vocabulary /usr/etc/basalt/orbvoc.dbow3 --result-path $folder_name/mapper_$d
rm -rf eval_tmp_marg_data
done done
./gen_results.py $folder_name #./gen_results.py $folder_name > euroc_results.txt