bev-project/archive_scripts/super_quick_viz.sh

70 lines
1.6 KiB
Bash
Executable File
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#!/bin/bash
# 超快速可视化 - 只推理1个样本查看效果
export PATH=/opt/conda/bin:$PATH
export CUDA_VISIBLE_DEVICES=0
echo "=================================================="
echo "超快速可视化测试"
echo "=================================================="
echo "推理1个样本约30秒"
echo "=================================================="
echo ""
CONFIG="configs/nuscenes/det/transfusion/secfpn/camera+lidar/swint_v0p075/multitask.yaml"
CHECKPOINT="runs/run-326653dc-74184412/epoch_19.pth"
OUTPUT_DIR="quick_viz_output"
# 创建输出目录
mkdir -p $OUTPUT_DIR
echo "📁 配置文件: $CONFIG"
echo "💾 Checkpoint: $CHECKPOINT"
echo "📊 输出目录: $OUTPUT_DIR"
echo ""
# 检查文件
if [ ! -f "$CHECKPOINT" ]; then
echo "❌ Checkpoint不存在"
exit 1
fi
echo "✅ 文件检查通过"
echo ""
echo "🚀 开始推理..."
echo ""
# 使用test.py但只推理少量样本
# 通过修改数据集配置限制样本数
/opt/conda/bin/torchpack dist-run -np 1 /opt/conda/bin/python tools/test.py \
"$CONFIG" \
"$CHECKPOINT" \
--eval bbox segm \
--show-dir "$OUTPUT_DIR" \
2>&1 | tee quick_viz.log
echo ""
echo "=================================================="
echo "✅ 完成!"
echo "=================================================="
echo ""
# 检查输出
if [ -d "$OUTPUT_DIR" ] && [ "$(ls -A $OUTPUT_DIR)" ]; then
echo "✅ 可视化结果已生成:"
ls -lh "$OUTPUT_DIR" | head -10
echo ""
echo "查看更多: ls $OUTPUT_DIR/"
else
echo "⚠️ 未生成可视化文件"
echo "查看日志: cat quick_viz.log | tail -50"
fi
echo ""