This repository has been archived by the owner on Oct 24, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
fetch-euryale.sh
executable file
·60 lines (49 loc) · 1.7 KB
/
fetch-euryale.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
#!/usr/bin/env bash
# Rsyncs the segmentation result of kitti sequence.
function fail {
LAST_ERR="$?"
echo >&2 "Failed to process sequence: $1."
echo >&2 "Please check the output above for more details."
exit "$LAST_ERR"
}
# TODO(andrei): Cityscapify properly!
EURYALE_HOST="euryale"
#EURYALE_HOST="en02"
EUR_PROJECT_DIR="/import/euryale/projects/BARSANA.MSC.PROJECT"
#DATASET="kitti-odometry"
#DATASET="kitti"
DATASET="kitti-tracking"
REMOTE_KITTI_DIR="${EUR_PROJECT_DIR}/${DATASET}/"
if [[ "$#" -ne 1 && "$#" -ne 2 ]]; then
echo >&2 "Usage: $0 <kitti_sequence_root> <tracking_sequence_id>"
exit 1
fi
SEQUENCE_ROOT="$1"
SEQUENCE_ROOT="${SEQUENCE_ROOT%/}" # Removes trailing slashes
SEQUENCE_FOLDER="${SEQUENCE_ROOT##*/}"
# Quick sanity check for KITTI folders.
if [[ "$DATASET" == "kitti" ]]; then
if ! [[ -d "${SEQUENCE_ROOT}/image_00" ]]; then
echo >&2 "The folder ${SEQUENCE_ROOT} does not look like a KITTI dataset folder."
ls "${SEQUENCE_ROOT}"
exit 2
fi
fi
if [[ "$DATASET" == "kitti" ]]; then
SEG_OUTPUT_SUBFOLDER=seg_image_02/mnc
elif [[ "$DATASET" == "kitti-odometry" ]]; then
SEG_OUTPUT_SUBFOLDER=seg_image_2/mnc
elif [[ "$DATASET" == "cityscapes" ]]; then
SEG_OUTPUT_SUBFOLDER=seg/mnc
elif [[ "$DATASET" == "kitti-tracking" ]]; then
KT_ID="$2"
shift
echo "Will process 'kitti-tracking' sequence with ID #${KT_ID}."
SEG_OUTPUT_SUBFOLDER="training/seg_image_02/$(printf '%04d' ${KT_ID})/mnc"
else
fail "Unknown dataset name: ${DATASET}"
fi
rsync -a --info=progress2 \
"${EURYALE_HOST}:${REMOTE_KITTI_DIR}/${SEQUENCE_FOLDER}/${SEG_OUTPUT_SUBFOLDER}/" \
"${SEQUENCE_ROOT}/${SEG_OUTPUT_SUBFOLDER}"
echo "Fetched segmentation result from Euryale host: ${EURYALE_HOST}."