Atlas-online-0318 / scripts /eval_checkpoint.sh
guoyb0's picture
Upload code snapshot 0318
f693366 verified
#!/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