File size: 1,824 Bytes
7dfc72e
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
#!/bin/bash
# Evaluate an Atlas checkpoint using online visual tokens (default).
# Uses live frozen StreamPETR + TopoMLP with temporal memory.
#
# Usage:
#   bash scripts/eval_checkpoint.sh <checkpoint> <data_json> [output_json] [max_samples]
#
# Examples:
#   bash scripts/eval_checkpoint.sh work_dirs/atlas_no_caption_online/epoch-0/checkpoint.pt data/atlas_planning_val_uniad_command.json
#   bash scripts/eval_checkpoint.sh work_dirs/atlas_no_caption_online/final/checkpoint.pt data/atlas_nuscenes_val.json work_dirs/eval_det.json 50
#
# For offline mode:
#   bash scripts/eval_checkpoint_offline.sh <checkpoint> <data_json> [output_json] [max_samples]
set -e

PROJECT_ROOT="$(cd "$(dirname "$0")/.." && pwd)"
cd "$PROJECT_ROOT"

CHECKPOINT="${1:?Usage: $0 <checkpoint> <data_json> [output_json] [max_samples]}"
DATA_JSON="${2:?Usage: $0 <checkpoint> <data_json> [output_json] [max_samples]}"
OUTPUT_JSON="${3:-}"
MAX_SAMPLES="${4:-0}"
PLANNING_TABLE3_MODE="${PLANNING_TABLE3_MODE:-atlas_high_level_ego}"

EXTRA_ARGS=""
if [ -n "$OUTPUT_JSON" ]; then
    EXTRA_ARGS="$EXTRA_ARGS --output_json $OUTPUT_JSON"
fi
if [ "$MAX_SAMPLES" -gt 0 ] 2>/dev/null; then
    EXTRA_ARGS="$EXTRA_ARGS --max_samples $MAX_SAMPLES"
fi

python eval_atlas.py \
    --checkpoint "$CHECKPOINT" \
    --llm_model pretrained/vicuna-7b-v1.5 \
    --data_json "$DATA_JSON" \
    --data_root /home/guoyuanbo/autodl-tmp/data/nuscenes \
    --visual_token_mode online \
    --planning_table3_mode "$PLANNING_TABLE3_MODE" \
    --streampetr_config configs/streampetr_atlas_aligned.py \
    --streampetr_ckpt pretrained/streampetr/streampetr_eva02_ep24.pth \
    --topomlp_config configs/topomlp_atlas_aligned.py \
    --topomlp_ckpt work_dirs/topomlp_atlas_aligned/epoch_24.pth \
    --bf16 \
    --batch_size 1 \
    --num_workers 2 \
    $EXTRA_ARGS