-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathrun_s3li_evaluation.sh
More file actions
76 lines (67 loc) · 2.17 KB
/
run_s3li_evaluation.sh
File metadata and controls
76 lines (67 loc) · 2.17 KB
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
#!/bin/bash
# run_s3li_evaluation.sh - Main script to build and run S3LI evaluation
set -e
echo "=========================================="
echo "DLR S3LI Dataset SLAM Evaluation"
echo "=========================================="
# Configuration
CONTAINER_NAME="s3li_slam_eval"
IMAGE_NAME="s3li_slam:latest"
DATASET_DIR="./dataset"
RESULTS_DIR="./results"
# Create necessary directories
mkdir -p $DATASET_DIR $RESULTS_DIR configs evaluation_scripts
# Check if container already exists
if docker ps -a --format '{{.Names}}' | grep -q "^${CONTAINER_NAME}$"; then
echo "Container $CONTAINER_NAME already exists."
read -p "Do you want to restart it? (y/n) " -n 1 -r
echo
if [[ $REPLY =~ ^[Yy]$ ]]; then
docker stop $CONTAINER_NAME || true
docker rm $CONTAINER_NAME || true
else
echo "Starting existing container..."
docker start $CONTAINER_NAME
echo "Container started. Access it with: docker exec -it $CONTAINER_NAME bash"
exit 0
fi
fi
# Build Docker image
echo "Building Docker image..."
docker build -t $IMAGE_NAME .
# Run container
echo "Starting container..."
docker run -d \
--name $CONTAINER_NAME \
--restart unless-stopped \
-v $(pwd)/$DATASET_DIR:/workspace/dataset \
-v $(pwd)/$RESULTS_DIR:/workspace/results \
-v $(pwd)/configs:/workspace/configs \
-v $(pwd)/evaluation_scripts:/workspace/scripts \
--shm-size=8gb \
$IMAGE_NAME
# Wait for container to be ready
sleep 3
echo ""
echo "=========================================="
echo "Container started successfully!"
echo "=========================================="
echo ""
echo "Container Name: $CONTAINER_NAME"
echo "Container ID: $(docker ps -qf "name=$CONTAINER_NAME")"
echo ""
echo "To access the container:"
echo " docker exec -it $CONTAINER_NAME bash"
echo ""
echo "To download dataset:"
echo " docker exec -it $CONTAINER_NAME bash /workspace/scripts/download_dataset.sh"
echo ""
echo "To run evaluations:"
echo " docker exec -it $CONTAINER_NAME bash /workspace/scripts/run_evaluation.sh"
echo ""
echo "To stop container:"
echo " docker stop $CONTAINER_NAME"
echo ""
echo "To view logs:"
echo " docker logs -f $CONTAINER_NAME"
echo ""