yasintuncerr's picture
updated
f0f3c89
metadata
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.

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:

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.

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.

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

python extract_base_dataset.py --from_res 1280x720

Prepare YOLO Segmentation Dataset

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:
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.