Files
HSAP/algorithms/lane_ufld/code.embedded.bak/pytorch-auto-drive-master/docs/LANEDETECTION.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

3.0 KiB

Lane detection

Before diving into this, please make sure you followed the instructions to prepare datasets in DATASET.md

Execution is based on config files

Training:

Some models' ImageNet pre-trained weights need to be manually downloaded, refer to this table.

python main_landet.py --train \
                      --config=<config file path> \
                      --mixed-precision  # Optional, enable mixed precision \
                      --cfg-options=<overwrite cfg dict>  # Optional

Your <overwrite cfg dict> is used to manually override config file options in commandline so you don't have to modify config file each time. It should look like this (the quotation marks are necessary!): "train.batch_size=8 train.workers=4 model.lane_classifier_cfg.dropout=0.1"

Some options can be used by shortcuts, such as --batch-size will set both train.batch_size and test.batch_size, for more info:

python main_landet.py --help

Example shells are provided in tools/shells.

Distributed Training

We support multi-GPU training with Distributed Data Parallel (DDP):

python -m torch.distributed.launch --nproc_per_node=<number of GPU per-node> --use_env main_landet.py <your normal args>

With DDP, batch size and number of workers are per-GPU. Do not forget to set device args like world_size in your config.

Testing

Evaluation:

Important Notice: Do not simoutanously run multiple evaluation on CULane, since the eval use the same pytorch-auto-drive/output cache directory, the results could be overwritten! Same goes for LLAMAS!

  1. Predict lane lines:
python main_landet.py --test \  # Or --val for validation
                      --config=<config file path> \
                      --mixed-precision  # Optional, enable mixed precision \
                      --cfg-options=<overwrite cfg dict>  # Optional

To test a downloaded pt file, try add --checkpoint=<pt file path>.

Note that LLAMAS doesn't have test set labels.

  1. Test with official scripts on <my_dataset>:
./autotest_<my_dataset>.sh <exp_name> <mode> <save_dir>

<mode> includes test and val.

<save_dir> and <exp_name> are recommended to set the same as in config file, so detail evaluation results will be saved to <save_dir>/<exp_name>/

Overall result will be saved to log.txt.

Training contains online fast validations by using val_num_steps and the best model is saved, but we find that the best checkpoint is usually the last, so probably no need for validations. For log details you can checkout tensorboard.

To validate a trained model on mean IoU, you can use either mixed-precision or fp32 for any model trained with/without mixed-precision:

python main_landet.py --valfast \
                      --config=<config file path> \
                      --mixed-precision  # Optional, enable mixed precision \
                      --cfg-options=<overwrite cfg dict>  # Optional