Collection of scripts for preparation of datasets for semantic segmentation of UAV images
Those scripts were used to prepare and unify multiple datasets used to train a semantic segmetation model used in an Automatic Safe Emergency Landing application. It converts all of the supported datasets to a cityscape type structure. This is useful as most semantic segmentation repos out there support Cityscape. On top of this, this repo supports re-labelling. This means you can group and discard annotations. This is particularly useful when combining several datasets together.
- Download one/several of the datasets supported.
- Update the configuration file:
DATASETS_PATHS: this should contain the root directory to the datasets.size_out: all the labels/images will be resized to the value you enter here.use_default_split: IfTrue, the data splits given by the dataset authors will be used. Otherwise (or if the authors did not specify sets), a split will be generated (70/15/15). You can change the proportion of the data splits indataset_prep.pyuse_train_ids: if True, thetrainIdswill be used instead of thelabelIds. For more details on the difference between the two. Please refer tolabels.py
- (optional) Create virtual environment
pip3 install -r requirements.txtpython3 setup.py install- Run
python3 scripts/run.py --dataset [insert dataset_name] - Feel free raise an Issue, star, or do PRs :)
| Dataset | Number of images | Number of classes | Description | Perspective |
|---|---|---|---|---|
| Cityscape (2D fine)* | 5000 (50 seq) | 30 | High-quality autonomous driving segmentation (not UAV) | Ground Level |
| Aerospace | 3269 | 11 | images captured from commercial drone (5 to 50 meters altitude) | Mixed (forward/down) |
| TU-GRAZ landing | 592 | 20 | Segmentation for Urban environment for safe landing | down |
| UAVid | 420 (42 seq) | 8 | Segmentation for Urban environment | forward |
*Cityscape still being implemented. However, you can just refer to this repo in the meanwhile.
| Dataset \ Labels | road | person | vehicle | building | vegetation | background |
|---|---|---|---|---|---|---|
| Cityscape (not UAV) | ✔️ | ✔️ (person/rider) | ✔️ (bus/truck/car) | ✔️ | ✔️ | ✔️ |
| Aerospace | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ |
| TU-GRAZ landing | ✔️ (gravel) | ✔️ | ✔️ | ✔️ (door/window/roof/wall) | ✔️(tree/gras) | ✔️ |
| UAVid | ✔️ | ✔️ | ✔️ (static/dynamic) | ✔️ | ✔️ (tree/low veg.) | ✔️ |
Some of the code (particularly label.py) was based on this repo.