Skip to content

Commit

Permalink
updated reademe
Browse files Browse the repository at this point in the history
  • Loading branch information
zillur-av committed Jul 22, 2023
1 parent 280c5a3 commit 943dbd3
Show file tree
Hide file tree
Showing 26 changed files with 12 additions and 10 deletions.
19 changes: 10 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ $DATASETROOT/test_label.json # test label json file
```
### LVLane
Download [LVLane](https://drive.google.com/file/d/1lRhne-d87A4b0gLjf6quipDQ4MYvP7ky/view?usp=sharing). Then extract them to `$DATASETROOT` just like TuSimple dataset. This link contains class annotations for TuSimple dataset, so replace the orginal labels ones with the new ones. Lane annotations and class labels of Caltech dataset are also available in TuSimple format. Download the dataset from original site and resize them to 1280x720 to use with this model.
Download [LVLaneV1](https://drive.google.com/file/d/1lRhne-d87A4b0gLjf6quipDQ4MYvP7ky/view?usp=sharing). Then extract them to `$DATASETROOT` just like TuSimple dataset. This link contains class annotations for TuSimple dataset, so replace the orginal labels ones with the new ones. Lane annotations and class labels of Caltech dataset are also available in TuSimple format. Download the dataset from original site and resize them to 1280x720 to use with this model.

```
$DATASETROOT/clips/0531/
Expand All @@ -90,13 +90,14 @@ $DATASETROOT/LVLane_test_sunny.json
$DATASETROOT/LVLane_train_sunny.json
```

If you want to create a dataset in tusimple format, please follow instructions on [tusimple-annotation](https://github.com/zillur-av/tusimple-annotation)
We need to generate segmentation from the json annotation.

### Generate masks
```Shell
python tools/generate_seg_tusimple.py --root $DATASETROOT
python tools/generate_seg_tusimple.py --root $DATASETROOT --filename 'LVLane_test_sunny'
# this will generate seg_label directory
```
Then you will find new `json` annotations files that have both lane location and class id in `$DATASETROOT/seg_label/list/`. Replace the old annotation files in `$DATASETROOT` by these new files.

## Getting Started
If we want just detection, no lane classification, switch to `detection` branch by running `git checkout detection`.
Expand All @@ -111,7 +112,7 @@ python main.py [configs/path_to_your_config] --gpus [gpu_ids]

For example, run
```Shell
python main.py configs/resa/resa50_culane.py --gpus 0
python main.py configs/ufld/resnet18_tusimple.py --gpus 0
```

### Testing
Expand All @@ -122,15 +123,15 @@ python main.py [configs/path_to_your_config] --validate --load_from [path_to_you

For example, run
```Shell
python main.py configs/resa/resa50_culane.py --validate --load_from culane_resnet50.pth --gpus 0
python main.py configs/ufld/resnet18_tusimple.py --validate --load_from ufld_tusimple.pth --gpus 0
```

Currently, this code can output the visualization result when testing, just add `--view`.
We will get the visualization result in `work_dirs/xxx/xxx/visualization`.

For example, run
```Shell
python main.py configs/resa/resa50_culane.py --validate --load_from culane_resnet50.pth --gpus 0 --view
python main.py configs/ufld/resnet18_tusimple.py --validate --load_from ufld_tusimple.pth --gpus 0 --view
```

### Inference
Expand All @@ -156,8 +157,8 @@ optional arguments:
```
To run inference on example images in `./images` and save the visualization images in `vis` folder:
```
python tools/detect.py configs/resa/resa34_culane.py --img images\
--load_from resa_r34_culane.pth --savedir ./vis
python tools/detect.py configs/ufld/resnet18_tusimple.py --img images\
--load_from ufld_tusimple.pth --savedir ./vis
```


Expand Down
Binary file not shown.
Binary file removed test-det-only-ts-ufld/lane_images_sunny_202302.jpg
Binary file not shown.
Binary file removed test-det-only-ts-ufld/original-det3.jpg
Binary file not shown.
Binary file removed test-det-only-ts-ufld/original-det4.jpg
Binary file not shown.
Binary file removed test-det-only-ts-ufld/original-det5.jpg
Binary file not shown.
Binary file removed test-det-only-ts-ufld/test-det-challenging1.jpg
Binary file not shown.
Binary file removed test-det-only-ts-ufld/test-det-challenging2.jpg
Binary file not shown.
Binary file removed test-det-only-ts-ufld/test-det-pre-ufld1.jpg
Binary file not shown.
Binary file removed test-det-only-ts-ufld/test-det-pre-ufld2.jpg
Binary file not shown.
Binary file removed test-det-only-ts-ufld/test-det-pre-ufld3.jpg
Binary file not shown.
Binary file removed test-det-only-ts-ufld/test-det-pre-ufld4.jpg
Binary file not shown.
Binary file removed test-det-only-ts-ufld/test-det-pre-ufld5.jpg
Binary file not shown.
Binary file not shown.
Binary file removed test-det-ts-lv-ufld/lane_images_sunny_202302.jpg
Binary file not shown.
Binary file removed test-det-ts-lv-ufld/our-class1.jpg
Binary file not shown.
Binary file removed test-det-ts-lv-ufld/our-class2.jpg
Binary file not shown.
Binary file removed test-det-ts-lv-ufld/our-class3.jpg
Binary file not shown.
Binary file removed test-det-ts-lv-ufld/our-class4.jpg
Binary file not shown.
Binary file removed test-det-ts-lv-ufld/our-class5.jpg
Binary file not shown.
Binary file removed test-det-ts-lv-ufld/our-det1.jpg
Binary file not shown.
Binary file removed test-det-ts-lv-ufld/our-det2.jpg
Binary file not shown.
Binary file removed test-det-ts-lv-ufld/our-det3.jpg
Binary file not shown.
Binary file removed test-det-ts-lv-ufld/our-det4.jpg
Binary file not shown.
Binary file removed test-det-ts-lv-ufld/our-det5.jpg
Binary file not shown.
3 changes: 2 additions & 1 deletion tools/generate_seg_tusimple.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,13 +99,14 @@ def generate_label(args):
os.makedirs(save_dir, exist_ok=True)

print("generating masks...")
gen_label_from_json(args.root, save_dir, file_name = 'LVLane_test_sunny')
gen_label_from_json(args.root, save_dir, file_name = args.filename)


if __name__ == '__main__':
parser = argparse.ArgumentParser()
parser.add_argument('--root', required=True, help='The root of the Tusimple dataset')
parser.add_argument('--savedir', type=str, default='seg_label', help='The root of the Tusimple dataset')
parser.add_argument('--filename', type=str, default='LVLane_test_sunny', help= 'Name of the json file')
args = parser.parse_args()

generate_label(args)

0 comments on commit 943dbd3

Please sign in to comment.