159 lines
4.2 KiB
Markdown
159 lines
4.2 KiB
Markdown
|
|
# Phase 4B RMT-PPAD 评估结果可视化指南
|
|||
|
|
|
|||
|
|
## 📊 可视化工具概览
|
|||
|
|
|
|||
|
|
本项目提供了完整的评估结果可视化工具,帮助您直观地分析BEVFusion Phase 4B RMT-PPAD模型的性能。
|
|||
|
|
|
|||
|
|
## 🛠️ 可视化工具
|
|||
|
|
|
|||
|
|
### 1. 自动评估和可视化脚本 (`EVAL_AND_VISUALIZE.sh`)
|
|||
|
|
|
|||
|
|
**一键运行评估和可视化**:
|
|||
|
|
```bash
|
|||
|
|
cd /workspace/bevfusion
|
|||
|
|
./EVAL_AND_VISUALIZE.sh
|
|||
|
|
```
|
|||
|
|
|
|||
|
|
**功能**:
|
|||
|
|
- ✅ 运行快速评估(602样本,10x降采样)
|
|||
|
|
- ✅ 自动解析评估结果
|
|||
|
|
- ✅ 生成可视化图表
|
|||
|
|
- ✅ 输出性能摘要
|
|||
|
|
|
|||
|
|
**输出文件**:
|
|||
|
|
```
|
|||
|
|
eval_complete/complete_YYYYMMDD_HHMMSS/
|
|||
|
|
├── fast_results.pkl # 原始评估结果
|
|||
|
|
├── eval.log # 评估日志
|
|||
|
|
└── visualization/ # 可视化结果
|
|||
|
|
├── bbox_metrics.png # 3D检测指标图表
|
|||
|
|
├── map_metrics.png # BEV分割指标图表
|
|||
|
|
└── evaluation_summary.txt # 性能摘要
|
|||
|
|
```
|
|||
|
|
|
|||
|
|
### 2. 单独可视化脚本 (`VISUALIZE_RESULTS.py`)
|
|||
|
|
|
|||
|
|
**仅对已有结果进行可视化**:
|
|||
|
|
```bash
|
|||
|
|
cd /workspace/bevfusion
|
|||
|
|
python VISUALIZE_RESULTS.py path/to/results.pkl --out-dir visualization
|
|||
|
|
```
|
|||
|
|
|
|||
|
|
**参数**:
|
|||
|
|
- `results_file`: 评估结果文件路径 (.pkl格式)
|
|||
|
|
- `--out-dir`: 输出目录 (默认: visualization)
|
|||
|
|
|
|||
|
|
## 📈 可视化内容
|
|||
|
|
|
|||
|
|
### 3D检测指标图表 (`bbox_metrics.png`)
|
|||
|
|
- **AP@0.5:0.95**: 平均精确率 (IoU 0.5-0.95)
|
|||
|
|
- **AP@0.5**: 平均精确率 (IoU 0.5)
|
|||
|
|
- **AP@0.75**: 平均精确率 (IoU 0.75)
|
|||
|
|
- 支持类别:car, truck, bus, pedestrian等
|
|||
|
|
|
|||
|
|
### BEV分割指标图表 (`map_metrics.png`)
|
|||
|
|
- **IoU**: 交并比
|
|||
|
|
- **Dice**: Dice系数
|
|||
|
|
- 支持类别:drivable_area, ped_crossing, walkway, divider等
|
|||
|
|
|
|||
|
|
### 性能摘要 (`evaluation_summary.txt`)
|
|||
|
|
- 各类别详细指标
|
|||
|
|
- 整体性能统计
|
|||
|
|
- 评估时间戳
|
|||
|
|
|
|||
|
|
## 🔍 手动可视化方法
|
|||
|
|
|
|||
|
|
### 使用MMDetection3D内置工具
|
|||
|
|
|
|||
|
|
#### 可视化单样本预测结果:
|
|||
|
|
```bash
|
|||
|
|
cd /workspace/bevfusion
|
|||
|
|
python tools/visualize_single.py \
|
|||
|
|
configs/nuscenes/det/transfusion/secfpn/camera+lidar/swint_v0p075/multitask_BEV2X_phase4b_rmtppad_segmentation.yaml \
|
|||
|
|
--mode pred \
|
|||
|
|
--checkpoint runs/run-4c8ec7e5-fabdc997/epoch_1.pth \
|
|||
|
|
--split val \
|
|||
|
|
--out-dir viz_pred
|
|||
|
|
```
|
|||
|
|
|
|||
|
|
#### 可视化Ground Truth:
|
|||
|
|
```bash
|
|||
|
|
python tools/visualize_single.py \
|
|||
|
|
configs/nuscenes/det/transfusion/secfpn/camera+lidar/swint_v0p075/multitask_BEV2X_phase4b_rmtppad_segmentation.yaml \
|
|||
|
|
--mode gt \
|
|||
|
|
--split val \
|
|||
|
|
--out-dir viz_gt
|
|||
|
|
```
|
|||
|
|
|
|||
|
|
#### 可视化向量地图:
|
|||
|
|
```bash
|
|||
|
|
python tools/visualize_vector_map.py \
|
|||
|
|
--data-root data/nuscenes \
|
|||
|
|
--split val \
|
|||
|
|
--out-dir viz_map
|
|||
|
|
```
|
|||
|
|
|
|||
|
|
## 📋 评估结果解析
|
|||
|
|
|
|||
|
|
### 结果文件结构
|
|||
|
|
```python
|
|||
|
|
{
|
|||
|
|
'bbox': { # 3D检测结果
|
|||
|
|
'car_ap': 0.789,
|
|||
|
|
'car_ap_0.5': 0.856,
|
|||
|
|
'truck_ap': 0.723,
|
|||
|
|
# ... 其他类别
|
|||
|
|
},
|
|||
|
|
'map': { # BEV分割结果
|
|||
|
|
'drivable_area': {
|
|||
|
|
'IoU': 0.834,
|
|||
|
|
'Dice': 0.876
|
|||
|
|
},
|
|||
|
|
# ... 其他类别
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
```
|
|||
|
|
|
|||
|
|
### 关键指标说明
|
|||
|
|
|
|||
|
|
#### 3D检测 (bbox)
|
|||
|
|
- **NDS**: NuScenes Detection Score (综合指标)
|
|||
|
|
- **mAP**: Mean Average Precision
|
|||
|
|
- **AP@0.5**: IoU=0.5时的精确率
|
|||
|
|
- **AP@0.75**: IoU=0.75时的精确率
|
|||
|
|
|
|||
|
|
#### BEV分割 (map)
|
|||
|
|
- **IoU**: Intersection over Union
|
|||
|
|
- **Dice**: Dice Similarity Coefficient
|
|||
|
|
- **mIoU**: Mean IoU (所有类别的平均)
|
|||
|
|
|
|||
|
|
## 🚀 使用建议
|
|||
|
|
|
|||
|
|
1. **快速验证**: 使用 `EVAL_AND_VISUALIZE.sh` 进行完整的评估和可视化
|
|||
|
|
2. **详细分析**: 使用 `VISUALIZE_RESULTS.py` 单独分析已有结果
|
|||
|
|
3. **单样本检查**: 使用MMDetection3D工具检查具体样本
|
|||
|
|
4. **性能对比**: 在训练过程中定期运行可视化,跟踪性能变化
|
|||
|
|
|
|||
|
|
## 📊 示例输出
|
|||
|
|
|
|||
|
|
运行完整评估后,您将得到类似以下的可视化结果:
|
|||
|
|
|
|||
|
|
```
|
|||
|
|
Phase 4B RMT-PPAD 评估结果摘要
|
|||
|
|
========================================
|
|||
|
|
|
|||
|
|
🚗 3D检测性能:
|
|||
|
|
NDS: 0.456
|
|||
|
|
car: AP@0.5:0.95 = 0.723, AP@0.5 = 0.856
|
|||
|
|
truck: AP@0.5:0.95 = 0.645, AP@0.5 = 0.789
|
|||
|
|
pedestrian: AP@0.5:0.95 = 0.567, AP@0.5 = 0.723
|
|||
|
|
|
|||
|
|
🗺️ BEV分割性能:
|
|||
|
|
drivable_area: IoU = 0.834, Dice = 0.876
|
|||
|
|
divider: IoU = 0.723, Dice = 0.801
|
|||
|
|
ped_crossing: IoU = 0.645, Dice = 0.756
|
|||
|
|
平均IoU: 0.745, 平均Dice: 0.812
|
|||
|
|
```
|
|||
|
|
|
|||
|
|
可视化图表将以PNG格式保存,方便在报告或演示中使用。
|