File size: 4,709 Bytes
79edbe4 0206124 f0f3c89 0206124 78307cc 0206124 78307cc 0206124 24572d0 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 |
---
license: cc-by-sa-4.0
---
# ZOD-Mini-2D-Road-Scenes
The `ZOD-Mini-2D-Road-Scenes` dataset is derived from the Zenseact Open Dataset (ZOD), property of Zenseact AB (© 2022 Zenseact AB), and is licensed under the permissive CC BY-SA 4.0. Any public use, distribution, or display of this dataset must contain this entire notice:
> For this dataset, Zenseact AB has taken all reasonable measures to remove all personally identifiable information, including faces and license plates. To the extent that you like to request removal of specific images from the dataset, please contact [email protected].
>
> The purpose of Zenseact is to save lives in road traffic. We encourage use of this dataset with the intention of avoiding losses in road traffic. ZOD is not intended for military use.
The `ZOD-Mini-2D-Road-Scenes` dataset includes 2D road images and their corresponding annotations to assist in the development of autonomous driving technologies. The development kit provided with the original dataset by Zenseact AB, licensed under the MIT License, can be found [here](https://github.com/zenseact/development-kit).
# Lane Marking Detection Dataset Preparation
This project prepares a YOLO segmentation dataset for lane marking detection from various resolutions and annotations. It involves extracting base datasets, converting annotations to the YOLO format, and organizing the dataset into training and validation sets.
## Project Structure
```
Lane-Marking-Detection/
├── 1280x720_images.tar.gz
├── 640x360_images.tar.gz
├── annotations.tar.gz
├── extract_base_dataset.py
├── extract_yolo_seg_lane_marking_dataset.py
├── dataset/
├── utils.py
├── safe_executor.py
└── README.md
```
## Setup
### Prerequisites
- Python 3.x
- Required Python packages: `tqdm`, `pyyaml`, `argparse`
You can install the required packages using:
```sh
pip install tqdm pyyaml argparse
```
### Extracting Base Datasets
The base datasets are stored as tar.gz files. You need to extract them to prepare the dataset for training.
### Usage
#### Step 1: Extract Base Datasets
The `extract_base_dataset.py` script extracts the base datasets for the specified resolution.
```sh
python extract_base_dataset.py --from_res <resolution>
```
Supported resolutions can be found by checking the `utils.get_supported_resolutions()` function.
#### Step 2: Prepare YOLO Segmentation Dataset
The `extract_yolo_seg_lane_marking_dataset.py` script converts annotations to YOLO format and organizes the dataset into training and validation sets.
```sh
python extract_yolo_seg_lane_marking_dataset.py --from_res <resolution> [--cache_enabled True/False]
```
**Arguments:**
- `--from_res`: Specify the resolution of the dataset (e.g., `1280x720`, `640x360`).
- `--cache_enabled`: Optional. Enable or disable caching (default is `False`).
### Example Commands
#### Extract Base Dataset
```sh
python extract_base_dataset.py --from_res 1280x720
```
#### Prepare YOLO Segmentation Dataset
```sh
python extract_yolo_seg_lane_marking_dataset.py --from_res 1280x720 --cache_enabled True
```
## Detailed Script Descriptions
### `extract_base_dataset.py`
This script extracts the base dataset for the specified resolution.
### `extract_yolo_seg_lane_marking_dataset.py`
This script:
1. Converts annotations to YOLO format.
2. Splits the data into training and validation sets.
3. Prepares the dataset directory structure.
4. Creates a `dataset.yaml` file with the following structure:
```yaml
path: <absolute_path_to_dataset>
train: train # relative to 'path'
val: val # relative to 'path'
names:
0: lm_solid
1: lm_dashed
```
### `safe_executor.py`
This module provides a `SafeExecutor` context manager that ensures any changes are reverted if an exception occurs.
### `utils.py`
This module contains utility functions used across the scripts, such as directory creation and file extraction.
## Example Directory Structure After Extraction
```
Lane-Marking-Detection/
├── dataset/
│ ├── yolo_seg_lane_1280x720/
│ │ ├── train/
│ │ │ ├── 000000.jpg
│ │ │ ├── 000000.txt
│ │ ├── val/
│ │ │ ├── 128349.jpg
│ │ │ ├── 128349.txt
│ │ ├── dataset.yaml
```
## Notes
- Ensure you have the necessary permissions to read and write to the specified directories.
- If the dataset directory already exists, the script will prompt you to confirm whether to remove it before proceeding.
## License
This project is licensed under the MIT License.
By using this dataset, you agree to the terms of the CC BY-SA 4.0 license.
|