Files
HSAP/algorithms/lane_ufld/code.embedded.bak/UFLD/README.md
Chengfang Lu e72bc061c5 feat: HSAP platform v2 — modular navigation, quality review, audit log, world model simulation
Major changes:
- New frontend (platform/web/): Vite + React 18 + TypeScript + Tailwind
- 4-module navigation: 数据送标 / 模型管理 / 车队管理 / 系统管理
- Data catalog with charts (DMS/ADAS/Lane 3-tab view)
- Quality review workflow (标注质检): Good/Fine/Bad scoring with auto-advance
- Audit enhancements: batch operations, rejection categories, Feishu notifications
- Operation audit log (操作日志)
- World model simulation studio (仿真工坊)
- Dataset version management with snapshots and diff
- ADAS 7-class dataset integration (138K images organized + compressed)
- User management with Feishu integration and pagination
- CRUD/search/filter on all pages, card layout redesign
- PIL-optimized image overlay rendering
- Auto-snapshot on build, in_review workflow stage
- Removed embedded algorithm code (now in workspace)
2026-06-03 11:40:21 +08:00

139 lines
4.8 KiB
Markdown
Raw 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.
UFLD 使用说明lane0_copy 数据)
代码目录:/home/chengfanglu/DATA/BK2/UFLD
数据目录:/home/chengfanglu/DATA/lane0_copy/
一、环境
source ~/miniconda3/etc/profile.d/conda.sh
conda activate lane_light
cd /home/chengfanglu/DATA/BK2/UFLD
二、数据目录
lane0_copy/
DATASET/(基线包,勿改 list/train_gt.txt
images/
annotations/segmentation_masks/
list/train_gt.txt训练图 + mask 两列)
list/val_gt.txt
list/test_gt.txt
list/test.txt仅图片
DATASET-AddBy-zhangsan-20260615/(增量包,结构同上)
lists_merged/(多包合并列表,训练时自动生成)
datasets_registry.json短名别名
增量包命名DATASET-AddBy-姓名-YYYYMMDD日期 8 位,如 20260615
目录规范详见:/home/chengfanglu/DATA/lane0_copy/DATASETS_LAYOUT.md
新建增量包命令:
python /home/chengfanglu/DATA/lane0_copy/scripts/build_ufld_pack.py --src /path/to/archive --parent /home/chengfanglu/DATA/lane0_copy --engineer zhangsan --date 20260615
别名config 里可写 DATASET-A编辑 lane0_copy/datasets_registry.json例如
{"aliases": {"DATASET-A": "DATASET-AddBy-zhangsan-20260615"}}
三、配置文件
configs/mufld_lane_multi_pack.py — 推荐,多包训练,用 train_packs 控制合并
configs/mufld_lane_culane.py — 单包data_root 指向 DATASET 目录本身
configs/mufld_lane_smoke.py — 冒烟(少量样本)
configs/tusimple_res18_4lane_v1.py — 对接旧权重 best.pthgriding_num=100
多包训练请改 configs/mufld_lane_multi_pack.py
data_root = '/home/chengfanglu/DATA/lane0_copy'
train_packs = ['DATASET']
多包示例train_packs = ['DATASET', 'DATASET-A']
pack_list_name = 'list/train_gt.txt'
remerge_train_list = False增删包后改为 True强制重建 lists_merged
训练时自动合并列表到lane0_copy/lists_merged/train__DATASET__....txt
四、训练
conda activate lane_light
cd /home/chengfanglu/DATA/BK2/UFLD
冒烟:
UFLD_NUM_WORKERS=0 python train.py configs/mufld_lane_smoke.py
正式(多包):
python train.py configs/mufld_lane_multi_pack.py
断点续训:
python train.py configs/mufld_lane_multi_pack.py --resume log/你的实验目录/best.pth
日志与权重在log/时间_lr_.../best.pth
无 GPU 时可设 UFLD_NUM_WORKERS=0
常用 config 项:
batch_size = 16
learning_rate = 0.1
use_aux = TrueFalse 与旧 best.pth 一致,更省显存)
griding_num = 200旧权重用 100
num_lanes = 4
五、推理与测试
【5.1 可视化 demo】
先准备 test3.txt示例取 3 张):
awk '{print $1}' /home/chengfanglu/DATA/lane0_copy/DATASET/list/test_gt.txt | head -3 > /home/chengfanglu/DATA/lane0_copy/DATASET/test3.txt
python demo.py configs/tusimple_res18_4lane_v1.py --test_model log/20250702_165153_lr_1e-05_b_32_ufld_2lanes_res18/best.pth --data_root /home/chengfanglu/DATA/lane0_copy/DATASET
【5.2 批量测试】
python test.py configs/tusimple_res18_4lane_v1.py --test_model log/20250702_165153_lr_1e-05_b_32_ufld_2lanes_res18/best.pth --data_root /home/chengfanglu/DATA/lane0_copy/DATASET --test_list list/test_gt.txt
多包时 data_root 用 lane0_copy例如
python test.py configs/mufld_lane_multi_pack.py --test_model log/xxx/best.pth --data_root /home/chengfanglu/DATA/lane0_copy --test_list lists_merged/train__DATASET.txt
无 test_label.json 时只出预测,不算 TuSimple 官方指标。
【5.3 预测画到图上】
python vis_tusimple_pred.py --pred tmp/tusimple_eval_tmp.0.txt --data_root /home/chengfanglu/DATA/lane0_copy/DATASET --out_dir tmp/vis_pred
六、导出 ONNX
python pth_to_onnx.py --model_path log/20250702_165153_lr_1e-05_b_32_ufld_2lanes_res18/best.pth --output log/20250702_165153_lr_1e-05_b_32_ufld_2lanes_res18/best.onnx
需与训练时 backbone、griding_num、num_lanes 一致。
【6.1 VoVNet backbone】
已从 `BK2/archive/vovnet-detectron2-master` 移植 OSA+eSE 结构(无 detectron2 依赖),与 ResNet 相同接口。
| config `backbone` | 说明 |
|-------------------|------|
| `vov19slim` | V-19-slim-eSE约 52.7M 参数288×800 |
| `vov19slim_dw` | slim + depthwise |
| `vov19` / `vov39` / `vov57` / `vov99` | 更大变体 |
示例配置:`configs/tusimple_vov19slim_4lane_v1.py`
```bash
python train.py configs/tusimple_vov19slim_4lane_v1.py
python profile_model.py --backbone vov19slim --griding_num 100 --num_lanes 4
```
VoVNet **无** torchvision 预训练权重,需从头训或自行转换 detectron2 权重。旧 ResNet 的 `best.pth` **不能**直接用于 VoVNet。
七、路径速查
代码:/home/chengfanglu/DATA/BK2/UFLD
数据父目录:/home/chengfanglu/DATA/lane0_copy
基线数据:/home/chengfanglu/DATA/lane0_copy/DATASET
多包配置configs/mufld_lane_multi_pack.py
已有权重log/20250702_165153_lr_1e-05_b_32_ufld_2lanes_res18/best.pth