feat: initial HSAP platform

Huaxu Sentinel Active Safety Platform with embedded algorithm code,
Docker Compose setup, and vendored dataset scaffolds for clone-and-run.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-05-25 16:59:59 +08:00
commit 7c43b44c57
1619 changed files with 373355 additions and 0 deletions

View File

@@ -0,0 +1,28 @@
# Cityscapes
## Prepare the dataset
1. The dataset can be downloaded in their [official website](https://www.cityscapes-dataset.com/).
2. Change the `CITYSCAPES_ROOT` in [configs/semantic_segmentation/common/datasets/_utils.py](../../configs/semantic_segmentation/common/datasets/_utils.py) to your dataset's location.
3. Pre-processing:
```
python tools/cityscapes_data_list.py
```
## Description
### Directory Structure
```
├── <CITYSCAPES.BASE_DIR>
├── data_lists
├── gtFine
├── leftImage8bit
├── all_demoVideo
└── ...
```
*More details are coming soon.*

View File

@@ -0,0 +1,99 @@
# CULane
## Prepare the dataset
1. The CULane dataset can be downloaded in their [official website](https://xingangpan.github.io/projects/CULane.html).
2. Change the `CULANE_ROOT` in [configs/lane_detection/common/datasets/_utils.py](../../configs/lane_detection/common/datasets/_utils.py) to your dataset's location..
3. Pre-processing:
```
cd <CULANE.BASE_DIR>
mkdir lists
cp -r ./list/* ./lists/
cd -
python tools/culane_list_convertor.py
```
4. Prepare official evaluation scripts (**require CP++ OpenCV**):
*comment Line 21 in Makefile if using opencv2.*
```
cd tools/culane_evaluation
make
mkdir output
chmod 777 eval*
cd -
```
Check [this issue](https://github.com/voldemortX/pytorch-auto-drive/issues/80) if you have OpenCV >= 4.0.
5. Prepare python evaluation scripts (**If you have difficulty compiling in 4.**):
```
cd tools/culane_evaluation_py
mkdir output
chmod 777 *.sh
# change $backend from cpp to python in autotest_culane.sh
```
Then change `data_dir` to your CULane base directory in [eval.sh](../../tools/culane_evaluation/eval.sh) and [eval_validation.sh](../../tools/culane_evaluation/eval_validation.sh). *Mind that you need extra ../../ if relative path is used.*
If you use Bézier curve methods, download Bézier curve GT from [here](https://drive.google.com/file/d/1s7N45IjUWxZEUIuyDUCIqtDfhzxRjmfL/view?usp=sharing) and unzip them in `CULANE_ROOT/bezier_labels/`. More info on curves are in [CURVE.md](../CURVE.md).
## Description
### Directory Structure
```
<CULANE.BASE_DIR>
├─ driver_100_30frame
├─ driver_161_90frame
├─ driver_182_30frame
├─ driver_193_90frame
├─ driver_23_30frame
├─ driver_37_30frame
├─ laneseg_label_w16
├─ bezier_labels
│ ├─ train_3.json
│ └─ ...
├─ list
└─ lists
```
### Label Data Format
```
x1, y, x2, y-10, x3, y-20, ... , xn, y-10(n-1)
```
For each image, there would be a .txt annotation file, in which each line gives the x,y coordinates for key points of a lane marking. The CULane dataset, focus attention on the detection of four lane markings, which are paid most attention to in real applications.
For example,
```
-20.4835 580 19.3893 570 58.1682 560 98.1783 550 137.929 540 177.709 530 216.495 520 256.512 510 296.276 500 336.008 490 375.78 480 415.941 470 456.696 460 496.456 450 537.226 440 577.47 430 618.252 420 659.177 410
532.893 590 542.567 580 553.704 570 564.84 560 575.977 550 587.139 540 598.302 530 609.465 520 620.628 510 631.944 500 643.107 490 654.27 480 665.432 470 676.595 460 687.912 450 699.075 440 710.237 430 721.4 420 732.563 410
1170.27 590 1151.37 580 1130.68 570 1110.6 560 1089.91 550 1068.95 540 1048.26 530 1027.56 520 1007.77 510 986.81 500 966.115 490 945.788 480 925.092 470 904.506 460 883.81 450 863.13 440 842.434 430 821.739 420 801.059 410
1679.87 560 1626.23 550 1574.15 540 1520.62 530 1467.55 520 1414.57 510 1361.5 500 1307.8 490 1255.24 480 1202.18 470 1149.46 460 1096.4 450 1042.63 440 990.059 430 936.993 420 884.22 410
```
*Each row in xxx.txt represents a lane mark.*
Training/validation/testing list:
For train_gt.txt, which is used for training.
```
input image per-pixel label four 0/1 numbers which indicate the existance of four lane markings from left to right
```
For example,
```
/driver_23_30frame/05151649_0422.MP4/00000.jpg /laneseg_label_w16/driver_23_30frame/05151649_0422.MP4/00000.png 1 1 1 1
/driver_23_30frame/05151649_0422.MP4/00300.jpg /laneseg_label_w16/driver_23_30frame/05151649_0422.MP4/00300.png 1 1 1 1
...
/driver_23_30frame/05151649_0422.MP4/00330.jpg /laneseg_label_w16/driver_23_30frame/05151649_0422.MP4/00330.png 1 1 1 1
```

View File

@@ -0,0 +1,26 @@
# GTAV
## Prepare the dataset
1. The dataset can be downloaded in their [official website](https://download.visinf.tu-darmstadt.de/data/from_games/).
2. Change the `GTAV_ROOT` in [configs/semantic_segmentation/common/datasets/_utils.py](../../configs/semantic_segmentation/common/datasets/_utils.py) to your dataset's location.
3. Pre-processing:
```
python tools/gtav_data_list.py
```
## Description
### Directory Structure
```
├── <GTAV.BASE_DIR>
├── data_lists
├── images
└── labels
```
*More details are coming soon.*

View File

@@ -0,0 +1,88 @@
# LLAMAS
## Prepare the dataset
1. The LLAMAS dataset can be downloaded in their [official website](https://unsupervised-llamas.com/llamas/).
2. Change the `LLAMAS_ROOT` in [configs/lane_detection/common/datasets/_utils.py](../../configs/lane_detection/common/datasets/_utils.py) to your dataset's location..
3. Pre-processing:
```
python tools/llamas_list_convertor.py
```
LLAMAS dataset provides both color and gray images. We use color images in our framework.
4. Prepare official evaluation scripts:
```
cd tools/llamas_evaluation
mkdir output
```
Then change `data_dir` to your LLAMAS base directory in [autotest_llamas.sh](../../autotest_llamas.sh). *Mind that you need extra ../../ if relative path is used.*
5. If you use Bézier curve methods, download Bézier curve GT from [here](https://drive.google.com/file/d/1klugsr5lT9SxW0r5oyYjfo2qplt1TyxU/view?usp=sharing) and unzip them in `LLAMAS_ROOT/bezier_labels/`. More info on curves are in [CURVE.md](../CURVE.md).
## Description
### Directory Structure
```
<LLAMAS.BASE_DIR>
├─ color_images
│ ├─ test
│ ├─ train
│ └─ valid
├─ labels
│ ├─ train
│ └─ valid
├─ laneseg_labels
│ ├─ train
│ └─ valid
├─ bezier_labels
│ ├─ train_3.json
│ └─ ...
└─ lists
```
The test set' s annotations are not public.
### Label Data Format
```
{
"image_name": "...",
"projection_matrix": [[x11, 0, x13], [0, x21, x23], [0, 0, 1]],
"lanes":
[
{
"lane_id": "...",
"markers":
[
{
"lane_marker_id": "...",
"world_start":{"x":"...", "y": "...", "z": "..."}, "pixel_start": {"x": "...", "y": "..."},
"world_end":{"x":"...", "y": "...", "z": "..."}, "pixel_start": {"x": "...", "y": "..."}}
},
...
]
},
...
]
}
```
LLAMAS dataset employs json files to save annotations. Each image corresponds to a json file.
We utilize [the format of culane](CULANE.md) to reformat LLAMAS dataset.
We use the [script](https://github.com/XingangPan/seg_label_generate) provided by Xingang Pan to generate per-pixel labels.
The generated labels can be downloaded from [Google Drive](https://drive.google.com/file/d/1XA4nRLuAzsjJUSUs4HCjz7dksI9dHDNd/view?usp=sharing).

View File

@@ -0,0 +1,25 @@
# PASCAL VOC 2012
## Prepare the dataset
1. The PASCAL VOC 2012 dataset we use is the commonly used 10582 training set version. If you don't already have that dataset, we refer you to [Google](https://www.google.com) or this [blog](https://www.sun11.me/blog/2018/how-to-use-10582-trainaug-images-on-DeeplabV3-code/).
2. Change the `PASCAL_ROOT` in [configs/semantic_segmentation/common/datasets/_utils.py](../../configs/semantic_segmentation/common/datasets/_utils.py) to your dataset's location.
## Description
### Directory Structure
```
├── <PASCAL_VOC.BASE_DIR>/VOCtrainval_11-May-2012/VOCdevkit/VOC2012
├── Annotations
├── ImageSets
│ ├── Segmentation
│ └── ...
├── JPEGImages
├── SegmentationClass
├── SegmentationClassAug
└── ...
```
*More details are coming soon.*

View File

@@ -0,0 +1,28 @@
# SYNTHIA
## Prepare the dataset
1. The dataset can be downloaded in their [official website](http://synthia-dataset.net/downloads/).
2. Change the `SYNTHIA_ROOT` in [configs/semantic_segmentation/common/datasets/_utils.py](../../configs/semantic_segmentation/common/datasets/_utils.py) to your dataset's location.
3. Pre-processing:
```
python tools/synthia_label_convertor.py
python tools/synthia_data_list.py
```
## Description
### Directory Structure
```
├── <SYNTHIA.BASE_DIR>
├── data_lists
├── RGB
├── GT
└── ...
```
*More details are coming soon.*

View File

@@ -0,0 +1,79 @@
Do not overwrite folders with the same name, as the content of the training and testing sets is different
# Tusimple
## Prepare the dataset
1. The TuSimple dataset can be downloaded at their [github repo](https://github.com/TuSimple/tusimple-benchmark/issues/3). However, you'll also need [segmentation labels](https://drive.google.com/open?id=1LZDCnr79zuNH73NstZ8oIPDud0INCwb9), [list6_train.txt](https://github.com/cardwing/Codes-for-Lane-Detection/blob/master/ENet-TuSimple-Torch/list6/list6_train.txt), [list6_val.txt](https://github.com/cardwing/Codes-for-Lane-Detection/blob/master/ENet-TuSimple-Torch/list6/list6_val.txt) and [list_test.txt](https://github.com/cardwing/Codes-for-Lane-Detection/blob/master/ENet-TuSimple-Torch/list/list_test.txt) provided by [@cardwing](https://github.com/cardwing), thanks for their efforts.
2. Change the `TUSIMPLE_ROOT` in [configs/lane_detection/common/datasets/_utils.py](../../configs/lane_detection/common/datasets/_utils.py) to your dataset's location.
3. Pre-processing:
First put the data lists you downloaded before in `TUSIMPLE.BASE_DIR/lists`. Then:
```
python tools/tusimple_list_convertor.py
```
4. Prepare official evaluation scripts:
```
cd tools/tusimple_evaluation
mkdir output
```
Then change `data_dir` to your TuSimple base directory in [autotest_tusimple.sh](../../autotest_tusimple.sh). *Mind that you need extra ../../ if relative path is used.*
5. If you use Bézier curve methods, download Bézier curve GT from [here](https://drive.google.com/file/d/1aV1e5MAReIvtgW8RCoOMnvCnAK6uYtwn/view?usp=sharing) and unzip them in `TUSIMPLE_ROOT/bezier_labels/`. More info on curves are in [CURVE.md](../CURVE.md).
## Description
### Directory Structure
Note that the structure of Tusimple dataset downloaded from kaggle is different from the original structure. It contains `train_set` folder, `test_set` folder. You need to move the clips in the `test_set` folder to the `train_set` folder. **Do not overwrite folders with the same name**, as the content of the training and testing sets is different.
```
<TUSIMPLE.BASE_DIR>
├─ clips
├─ lists
├─ segGT6
├─ label_data_0313.json
├─ label_data_0531.json
├─ label_data_0601.json
├─ bezier_labels
│ ├─ train_3.json
│ └─ ...
└─ test_label.json
```
### Label Data Format
```
{
'lanes': list. A list of lanes. For each list of one lane, the elements are width values on image.
'h_samples': list. A list of height values corresponding to the 'lanes', which means len(h_samples) == len(lanes[i])
'raw_file': str. 20th frame file path in a clip.
}
```
There will be at most 5 lane markings in `lanes`. The polylines are organized by the same distance gap (`h_sample` in each label data) from the recording car. It means you can pair each element in one lane and h_samples to get position of lane marking in images.
For example,
```
{
"lanes": [
[-2, -2, -2, -2, 632, 625, 617, 609, 601, 594, 586, 578, 570, 563, 555, 547, 539, 532, 524, 516, 508, 501, 493, 485, 477, 469, 462, 454, 446, 438, 431, 423, 415, 407, 400, 392, 384, 376, 369, 361, 353, 345, 338, 330, 322, 314, 307, 299],
[-2, -2, -2, -2, 719, 734, 748, 762, 777, 791, 805, 820, 834, 848, 863, 877, 891, 906, 920, 934, 949, 963, 978, 992, 1006, 1021, 1035, 1049, 1064, 1078, 1092, 1107, 1121, 1135, 1150, 1164, 1178, 1193, 1207, 1221, 1236, 1250, 1265, -2, -2, -2, -2, -2],
[-2, -2, -2, -2, -2, 532, 503, 474, 445, 416, 387, 358, 329, 300, 271, 241, 212, 183, 154, 125, 96, 67, 38, 9, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2],
[-2, -2, -2, 781, 822, 862, 903, 944, 984, 1025, 1066, 1107, 1147, 1188, 1229, 1269, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2]
],
"h_samples": [240, 250, 260, 270, 280, 290, 300, 310, 320, 330, 340, 350, 360, 370, 380, 390, 400, 410, 420, 430, 440, 450, 460, 470, 480, 490, 500, 510, 520, 530, 540, 550, 560, 570, 580, 590, 600, 610, 620, 630, 640, 650, 660, 670, 680, 690, 700, 710],
"raw_file": "path_to_clip"
}
```
*`-2` in `lanes` means on some h_sample, there is no exsiting lane marking. The first existing point in the first lane is (632, 280).*
## Segmentation Label Generation \[Advanced\]
There is no precise corresponding generation script for the provided segmentation labels, although they are in good quality. If you plan to generate segmentation labels yourself, or simply can't download from Google Drive, refer to [#40](https://github.com/voldemortX/pytorch-auto-drive/issues/40) for links to [Baidu Drive](https://github.com/voldemortX/pytorch-auto-drive/issues/40#issuecomment-978728543), [C++ scripts](https://github.com/XingangPan/seg_label_generate) and [Python scripts](https://github.com/ZJULearning/resa/blob/main/tools/generate_seg_tusimple.py).