-
Notifications
You must be signed in to change notification settings - Fork 402
/
Copy pathclean.sh
executable file
·111 lines (82 loc) · 2.64 KB
/
clean.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
#!/usr/bin/env bash
# Author: Luigi Freda
# This file is part of https://github.com/luigifreda/pyslam
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) # get script dir
SCRIPT_DIR=$(readlink -f $SCRIPT_DIR) # this reads the actual path if a symbolic directory is used
ROOT_DIR="$SCRIPT_DIR"
# clean thirdparty install and compiled libraries
# get the first input if any
HARD_CLEAN=0
if [ "$1" == "--hard" ]; then
HARD_CLEAN=1
fi
# ====================================================
# import the bash utils
. "$ROOT_DIR"/bash_utils.sh
# ====================================================
set -e
print_blue "=================================================================="
print_blue "Cleaning thirdparty packages and utils..."
#echo ROOT_DIR: $ROOT_DIR
cd "$ROOT_DIR" # from bash_utils.sh
rm -Rf thirdparty/pangolin
rm -Rf thirdparty/g2opy
rm -Rf thirdparty/protoc # set by install_delf.sh
if [ -d "thirdparty/raft_stereo" ]; then
rm -Rf thirdparty/raft_stereo
fi
if [ -d "thirdparty/ml_depth_pro" ]; then
rm -Rf thirdparty/ml_depth_pro
fi
if [ -d "thirdparty/depth_anything_v2" ]; then
rm -Rf thirdparty/depth_anything_v2
fi
if [ -d "thirdparty/crestereo" ]; then
rm -Rf thirdparty/crestereo
fi
if [ -d "thirdparty/crestereo_pytorch" ]; then
rm -Rf thirdparty/crestereo_pytorch
fi
rm -Rf thirdparty/orbslam2_features/build
rm -Rf thirdparty/orbslam2_features/lib
rm -Rf cpp/build
rm -Rf cpp/lib
if [ -d "thirdparty/opencv-python" ]; then
rm -Rf "thirdparty/opencv-python"
fi
if [ -d "thirdparty/open3d" ]; then
rm -Rf thirdparty/open3d
fi
if [ -d "thirdparty/opencv" ]; then
rm -Rf thirdparty/opencv
fi
cd thirdparty/pydbow3
./clean.sh
cd "$ROOT_DIR"
cd thirdparty/pydbow2
./clean.sh
cd "$ROOT_DIR"
cd thirdparty/pyibow
./clean.sh
cd "$ROOT_DIR"
if [ -d "thirdparty/monogs/submodules/simple-knn/build" ]; then
rm -rf thirdparty/monogs/submodules/simple-knn/build thirdparty/monogs/submodules/simple-knn/*.egg-info
fi
if [ -d "thirdparty/monogs/submodules/diff-gaussian-rasterization/build" ]; then
rm -rf thirdparty/monogs/submodules/diff-gaussian-rasterization/build thirdparty/monogs/submodules/diff-gaussian-rasterization/*.egg-info
fi
if [ -d "thirdparty/mast3r" ]; then
rm -rf thirdparty/mast3r
fi
if [ -d "thirdparty/mvdust3r" ]; then
rm -rf thirdparty/mvdust3r
fi
if [ -f "$ROOT_DIR/.env" ]; then
echo "Removing $ROOT_DIR/.env file"
rm "$ROOT_DIR/.env"
fi
# clean downloaded models and reset submodules
if [ $HARD_CLEAN -eq 1 ]; then
print_blue "Resetting git submodules"
git submodule foreach 'git reset --hard; git clean -xfd'
fi