Duplicate from kumuji/lost_and_found
Browse filesCo-authored-by: Alexey Nekrasov <kumuji@users.noreply.huggingface.co>
- .gitattributes +59 -0
- README.md +61 -0
- camera.zip +3 -0
- disparity.zip +3 -0
- gtCoarse.zip +3 -0
- labels.py +181 -0
- laf_table.pdf +0 -0
- leftImg8bit.zip +3 -0
- rightImg8bit.zip +3 -0
- timestamp.tgz +3 -0
- vehicle.zip +3 -0
.gitattributes
ADDED
|
@@ -0,0 +1,59 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
*.7z filter=lfs diff=lfs merge=lfs -text
|
| 2 |
+
*.arrow filter=lfs diff=lfs merge=lfs -text
|
| 3 |
+
*.bin filter=lfs diff=lfs merge=lfs -text
|
| 4 |
+
*.bz2 filter=lfs diff=lfs merge=lfs -text
|
| 5 |
+
*.ckpt filter=lfs diff=lfs merge=lfs -text
|
| 6 |
+
*.ftz filter=lfs diff=lfs merge=lfs -text
|
| 7 |
+
*.gz filter=lfs diff=lfs merge=lfs -text
|
| 8 |
+
*.h5 filter=lfs diff=lfs merge=lfs -text
|
| 9 |
+
*.joblib filter=lfs diff=lfs merge=lfs -text
|
| 10 |
+
*.lfs.* filter=lfs diff=lfs merge=lfs -text
|
| 11 |
+
*.lz4 filter=lfs diff=lfs merge=lfs -text
|
| 12 |
+
*.mds filter=lfs diff=lfs merge=lfs -text
|
| 13 |
+
*.mlmodel filter=lfs diff=lfs merge=lfs -text
|
| 14 |
+
*.model filter=lfs diff=lfs merge=lfs -text
|
| 15 |
+
*.msgpack filter=lfs diff=lfs merge=lfs -text
|
| 16 |
+
*.npy filter=lfs diff=lfs merge=lfs -text
|
| 17 |
+
*.npz filter=lfs diff=lfs merge=lfs -text
|
| 18 |
+
*.onnx filter=lfs diff=lfs merge=lfs -text
|
| 19 |
+
*.ot filter=lfs diff=lfs merge=lfs -text
|
| 20 |
+
*.parquet filter=lfs diff=lfs merge=lfs -text
|
| 21 |
+
*.pb filter=lfs diff=lfs merge=lfs -text
|
| 22 |
+
*.pickle filter=lfs diff=lfs merge=lfs -text
|
| 23 |
+
*.pkl filter=lfs diff=lfs merge=lfs -text
|
| 24 |
+
*.pt filter=lfs diff=lfs merge=lfs -text
|
| 25 |
+
*.pth filter=lfs diff=lfs merge=lfs -text
|
| 26 |
+
*.rar filter=lfs diff=lfs merge=lfs -text
|
| 27 |
+
*.safetensors filter=lfs diff=lfs merge=lfs -text
|
| 28 |
+
saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
| 29 |
+
*.tar.* filter=lfs diff=lfs merge=lfs -text
|
| 30 |
+
*.tar filter=lfs diff=lfs merge=lfs -text
|
| 31 |
+
*.tflite filter=lfs diff=lfs merge=lfs -text
|
| 32 |
+
*.tgz filter=lfs diff=lfs merge=lfs -text
|
| 33 |
+
*.wasm filter=lfs diff=lfs merge=lfs -text
|
| 34 |
+
*.xz filter=lfs diff=lfs merge=lfs -text
|
| 35 |
+
*.zip filter=lfs diff=lfs merge=lfs -text
|
| 36 |
+
*.zst filter=lfs diff=lfs merge=lfs -text
|
| 37 |
+
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
| 38 |
+
# Audio files - uncompressed
|
| 39 |
+
*.pcm filter=lfs diff=lfs merge=lfs -text
|
| 40 |
+
*.sam filter=lfs diff=lfs merge=lfs -text
|
| 41 |
+
*.raw filter=lfs diff=lfs merge=lfs -text
|
| 42 |
+
# Audio files - compressed
|
| 43 |
+
*.aac filter=lfs diff=lfs merge=lfs -text
|
| 44 |
+
*.flac filter=lfs diff=lfs merge=lfs -text
|
| 45 |
+
*.mp3 filter=lfs diff=lfs merge=lfs -text
|
| 46 |
+
*.ogg filter=lfs diff=lfs merge=lfs -text
|
| 47 |
+
*.wav filter=lfs diff=lfs merge=lfs -text
|
| 48 |
+
# Image files - uncompressed
|
| 49 |
+
*.bmp filter=lfs diff=lfs merge=lfs -text
|
| 50 |
+
*.gif filter=lfs diff=lfs merge=lfs -text
|
| 51 |
+
*.png filter=lfs diff=lfs merge=lfs -text
|
| 52 |
+
*.tiff filter=lfs diff=lfs merge=lfs -text
|
| 53 |
+
# Image files - compressed
|
| 54 |
+
*.jpg filter=lfs diff=lfs merge=lfs -text
|
| 55 |
+
*.jpeg filter=lfs diff=lfs merge=lfs -text
|
| 56 |
+
*.webp filter=lfs diff=lfs merge=lfs -text
|
| 57 |
+
# Video files - compressed
|
| 58 |
+
*.mp4 filter=lfs diff=lfs merge=lfs -text
|
| 59 |
+
*.webm filter=lfs diff=lfs merge=lfs -text
|
README.md
ADDED
|
@@ -0,0 +1,61 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
task_categories:
|
| 3 |
+
- image-segmentation
|
| 4 |
+
---
|
| 5 |
+
# LostAndFoundDataset
|
| 6 |
+
|
| 7 |
+
_The original site is down and it is very difficult to find this data elsewhere. This is an unofficial mirror._
|
| 8 |
+
|
| 9 |
+
- Original Website: https://sites.google.com/a/6d-vision.com/www/current-research/lostandfounddataset
|
| 10 |
+
|
| 11 |
+
The LostAndFound Dataset addresses the problem of detecting unexpected small obstacles on the road often caused by lost cargo.
|
| 12 |
+
|
| 13 |
+
The dataset comprises 112 stereo video sequences with 2104 annotated frames (picking roughly every tenth frame from the recorded data).
|
| 14 |
+
|
| 15 |
+
If you are using this dataset in a publication please cite the following paper:
|
| 16 |
+
|
| 17 |
+
Peter Pinggera, Sebastian Ramos, Stefan Gehrig, Uwe Franke, Carsten Rother, Rudolf Mester, "Lost and Found: Detecting Small Road Hazards for Self-Driving Vehicles", Proceedings of IROS 2016, Daejeon, Korea. Link to the paper
|
| 18 |
+
|
| 19 |
+
(This material is presented to ensure timely dissemination of scholarly and technical work. Copyright and all rights therein are retained by authors or by other copyright holders. All persons copying this information are expected to adhere to the terms and constraints invoked by each author's copyright. In most cases, these works may not be reposted without the explicit permission of the copyright holder.)
|
| 20 |
+
|
| 21 |
+
For the data format and the interpretation of the data sources we refer to the description of the Cityscapes dataset format which we closely follow: http://www.cityscapes-dataset.com
|
| 22 |
+
|
| 23 |
+
Below you can find a link to the data description and some development kit (tailored for Cityscapes but applicable to LostAndFound as well):
|
| 24 |
+
|
| 25 |
+
https://github.com/mcordts/cityscapesScripts
|
| 26 |
+
|
| 27 |
+
In order to replace the cityscapes mapping with lostAndFound labels replace labels.py in the development kit with this file: labels.py
|
| 28 |
+
|
| 29 |
+
A description of the labels of the LostAndFound dataset can be found here: laf_table.pdf
|
| 30 |
+
|
| 31 |
+
Below, you can find all currently available downloads. A README and various scripts for inspection, preparation, and evaluation can be found in above git repository.
|
| 32 |
+
|
| 33 |
+
The following packages are available for download:
|
| 34 |
+
|
| 35 |
+
* gtCoarse.zip (37MB) annotations for train and test sets (2104 annotated images)
|
| 36 |
+
* leftImg8bit.zip (6GB) left 8-bit images - train and test set (2104 images)
|
| 37 |
+
* rightImg8bit.zip (6GB) right 8-bit images - train and test set (2104 images)
|
| 38 |
+
* leftImg16bit.zip (17GB) right 16-bit images - train and test set (2104 images) - missing
|
| 39 |
+
* rightImg16bit.zip (17GB) right 16-bit images - train and test set (2104 images) - missing
|
| 40 |
+
* disparity.zip (1.4GB) depth maps using Semi-Global Matching for train and test set (2104 images)
|
| 41 |
+
* timestamp.tgz (50kB) timestamps for train and test sets
|
| 42 |
+
* camera.zip (1MB) Intrinsic and extrinsic camera parameters for train and test sets
|
| 43 |
+
* vehicle.zip (1MB) vehicle odometry data (speed and yaw rate) for train and test sets
|
| 44 |
+
|
| 45 |
+
The LostAndFound dataset may be used according to the following license agreement:
|
| 46 |
+
|
| 47 |
+
---------------------- The LostAndFound Dataset ----------------------
|
| 48 |
+
|
| 49 |
+
License agreement:
|
| 50 |
+
|
| 51 |
+
This dataset is made freely available to academic and non-academic entities for non-commercial purposes such as academic research, teaching, scientific publications, or personal experimentation. Permission is granted to use the data given that you agree:
|
| 52 |
+
1. That the dataset comes "AS IS", without express or implied warranty. Although every effort has been made to ensure accuracy, we (Daimler AG) do not accept any responsibility for errors or omissions.
|
| 53 |
+
2. That you include a reference to the LostAndFound Dataset in any work that makes use of the dataset. For research papers, cite our preferred publication as listed on our website; for other media link to the dataset website.
|
| 54 |
+
3. That you do not distribute this dataset or modified versions. It is permissible to distribute derivative works in as far as they are abstract representations of this dataset (such as machine learning models trained on it or additional annotations that do not directly include any of our data) and do not allow to recover the dataset or something similar in character.
|
| 55 |
+
4. That you may not use the dataset or any derivative work for commercial purposes as, for example, licensing or selling the data, or using the data with a purpose to procure a commercial gain. 5. That all rights not expressly granted to you are reserved by us (Daimler AG).
|
| 56 |
+
|
| 57 |
+
Contact:
|
| 58 |
+
|
| 59 |
+
Sebastian Ramos, Peter Pinggera, Stefan Gehrig
|
| 60 |
+
http://www.6d-vision.com/lostandfounddataset
|
| 61 |
+
For questions, suggestions, and comments contact Stefan Gehrig (Stefan.Gehrig (at) daimler.com) or Sebastian Ramos.
|
camera.zip
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:b2586031f5fead27aa7ecc663a6ef5e991d5ec79ee195072967d5ed9353df8ba
|
| 3 |
+
size 967060
|
disparity.zip
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:1e06350d082f3bd686ff889940ad60ed85bfb1e8aa691a547a259c52fa3b60b1
|
| 3 |
+
size 1461824611
|
gtCoarse.zip
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:53b6d3ab000f08b1fb59d70c1398eecc4d82a7baf4e9cf74fbf60d1858abe9ac
|
| 3 |
+
size 37756896
|
labels.py
ADDED
|
@@ -0,0 +1,181 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#!/usr/bin/python
|
| 2 |
+
#
|
| 3 |
+
# Cityscapes labels
|
| 4 |
+
#
|
| 5 |
+
|
| 6 |
+
from collections import namedtuple
|
| 7 |
+
|
| 8 |
+
|
| 9 |
+
#--------------------------------------------------------------------------------
|
| 10 |
+
# Definitions
|
| 11 |
+
#--------------------------------------------------------------------------------
|
| 12 |
+
|
| 13 |
+
# a label and all meta information
|
| 14 |
+
Label = namedtuple( 'Label' , [
|
| 15 |
+
|
| 16 |
+
'name' , # The identifier of this label, e.g. 'car', 'person', ... .
|
| 17 |
+
# We use them to uniquely name a class
|
| 18 |
+
|
| 19 |
+
'id' , # An integer ID that is associated with this label.
|
| 20 |
+
# The IDs are used to represent the label in ground truth images
|
| 21 |
+
# An ID of -1 means that this label does not have an ID and thus
|
| 22 |
+
# is ignored when creating ground truth images (e.g. license plate).
|
| 23 |
+
|
| 24 |
+
'trainId' , # An integer ID that overwrites the ID above, when creating ground truth
|
| 25 |
+
# images for training.
|
| 26 |
+
# For training, multiple labels might have the same ID. Then, these labels
|
| 27 |
+
# are mapped to the same class in the ground truth images. For the inverse
|
| 28 |
+
# mapping, we use the label that is defined first in the list below.
|
| 29 |
+
# For example, mapping all void-type classes to the same ID in training,
|
| 30 |
+
# might make sense for some approaches.
|
| 31 |
+
|
| 32 |
+
'category' , # The name of the category that this label belongs to
|
| 33 |
+
|
| 34 |
+
'categoryId' , # The ID of this category. Used to create ground truth images
|
| 35 |
+
# on category level.
|
| 36 |
+
|
| 37 |
+
'hasInstances', # Whether this label distinguishes between single instances or not
|
| 38 |
+
|
| 39 |
+
'ignoreInEval', # Whether pixels having this class as ground truth label are ignored
|
| 40 |
+
# during evaluations or not
|
| 41 |
+
|
| 42 |
+
'color' , # The color of this label
|
| 43 |
+
] )
|
| 44 |
+
|
| 45 |
+
|
| 46 |
+
#--------------------------------------------------------------------------------
|
| 47 |
+
# A list of all labels
|
| 48 |
+
#--------------------------------------------------------------------------------
|
| 49 |
+
|
| 50 |
+
# Please adapt the train IDs as appropriate for you approach.
|
| 51 |
+
# Note that you might want to ignore labels with ID 255 during training.
|
| 52 |
+
# Make sure to provide your results using the original IDs and not the training IDs.
|
| 53 |
+
# Note that many IDs are ignored in evaluation and thus you never need to predict these!
|
| 54 |
+
|
| 55 |
+
labels = [
|
| 56 |
+
# name id trainId hasInstances ignoreInEval color
|
| 57 |
+
Label( 'unlabeled' , 0 , 0 , False , True , ( 0, 0, 0) ),
|
| 58 |
+
Label( 'ego vehicle' , 0 , 0 , False , True , ( 0, 0, 0) ),
|
| 59 |
+
Label( 'rectification border' , 0 , 0 , False , True , ( 0, 0, 0) ),
|
| 60 |
+
Label( 'out of roi' , 0 , 0 , False , True , ( 0, 0, 0) ),
|
| 61 |
+
Label( 'background' , 0 , 0 , False , False , ( 0, 0, 0) ),
|
| 62 |
+
Label( 'free' , 1 , 1 , False , False , (128, 64,128) ),
|
| 63 |
+
Label( '01' , 2 , 2 , True , False , ( 0, 0,142) ),
|
| 64 |
+
Label( '02' , 3 , 2 , True , False , ( 0, 0,142) ),
|
| 65 |
+
Label( '03' , 4 , 2 , True , False , ( 0, 0,142) ),
|
| 66 |
+
Label( '04' , 5 , 2 , True , False , ( 0, 0,142) ),
|
| 67 |
+
Label( '05' , 6 , 2 , True , False , ( 0, 0,142) ),
|
| 68 |
+
Label( '06' , 7 , 2 , True , False , ( 0, 0,142) ),
|
| 69 |
+
Label( '07' , 8 , 2 , True , False , ( 0, 0,142) ),
|
| 70 |
+
Label( '08' , 9 , 2 , True , False , ( 0, 0,142) ),
|
| 71 |
+
Label( '09' , 10 , 2 , True , False , ( 0, 0,142) ),
|
| 72 |
+
Label( '10' , 11 , 2 , True , False , ( 0, 0,142) ),
|
| 73 |
+
Label( '11' , 12 , 2 , True , False , ( 0, 0,142) ),
|
| 74 |
+
Label( '12' , 13 , 2 , True , False , ( 0, 0,142) ),
|
| 75 |
+
Label( '13' , 14 , 2 , True , False , ( 0, 0,142) ),
|
| 76 |
+
Label( '14' , 15 , 2 , True , False , ( 0, 0,142) ),
|
| 77 |
+
Label( '15' , 16 , 2 , True , False , ( 0, 0,142) ),
|
| 78 |
+
Label( '16' , 17 , 2 , True , False , ( 0, 0,142) ),
|
| 79 |
+
Label( '17' , 18 , 2 , True , False , ( 0, 0,142) ),
|
| 80 |
+
Label( '18' , 19 , 2 , True , False , ( 0, 0,142) ),
|
| 81 |
+
Label( '19' , 20 , 2 , True , False , ( 0, 0,142) ),
|
| 82 |
+
Label( '20' , 21 , 2 , True , False , ( 0, 0,142) ),
|
| 83 |
+
Label( '21' , 22 , 2 , True , False , ( 0, 0,142) ),
|
| 84 |
+
Label( '22' , 23 , 2 , True , False , ( 0, 0,142) ),
|
| 85 |
+
Label( '23' , 24 , 2 , True , False , ( 0, 0,142) ),
|
| 86 |
+
Label( '24' , 25 , 2 , True , False , ( 0, 0,142) ),
|
| 87 |
+
Label( '25' , 26 , 2 , True , False , ( 0, 0,142) ),
|
| 88 |
+
Label( '26' , 27 , 2 , True , False , ( 0, 0,142) ),
|
| 89 |
+
Label( '27' , 28 , 2 , True , False , ( 0, 0,142) ),
|
| 90 |
+
Label( '28' , 29 , 2 , True , False , ( 0, 0,142) ),
|
| 91 |
+
Label( '29' , 30 , 2 , True , False , ( 0, 0,142) ),
|
| 92 |
+
Label( '30' , 31 , 0 , True , False , ( 0, 0, 0) ),
|
| 93 |
+
Label( '31' , 32 , 2 , True , False , ( 0, 0,142) ),
|
| 94 |
+
Label( '32' , 33 , 0 , True , False , ( 0, 0, 0) ),
|
| 95 |
+
Label( '33' , 34 , 0 , True , False , ( 0, 0, 0) ),
|
| 96 |
+
Label( '34' , 35 , 2 , True , False , ( 0, 0,142) ),
|
| 97 |
+
Label( '35' , 36 , 0 , True , False , ( 0, 0, 0) ),
|
| 98 |
+
Label( '36' , 37 , 0 , True , False , ( 0, 0, 0) ),
|
| 99 |
+
Label( '37' , 38 , 0 , True , False , ( 0, 0, 0) ),
|
| 100 |
+
Label( '38' , 39 , 0 , True , False , ( 0, 0, 0) ),
|
| 101 |
+
Label( '39' , 40 , 2 , True , False , ( 0, 0,142) ),
|
| 102 |
+
Label( '40' , 41 , 2 , True , False , ( 0, 0,142) ),
|
| 103 |
+
Label( '41' , 42 , 2 , True , False , ( 0, 0,142) ),
|
| 104 |
+
Label( '42' , 43 , 2 , True , False , ( 0, 0,142) ),
|
| 105 |
+
|
| 106 |
+
]
|
| 107 |
+
|
| 108 |
+
|
| 109 |
+
#--------------------------------------------------------------------------------
|
| 110 |
+
# Create dictionaries for a fast lookup
|
| 111 |
+
#--------------------------------------------------------------------------------
|
| 112 |
+
|
| 113 |
+
name2label = { label.name : label for label in labels }
|
| 114 |
+
id2label = { label.id : label for label in labels }
|
| 115 |
+
trainId2label = { label.trainId : label for label in reversed(labels) }
|
| 116 |
+
category2labels = {}
|
| 117 |
+
for label in labels:
|
| 118 |
+
category = label.category
|
| 119 |
+
if category in category2labels:
|
| 120 |
+
category2labels[category].append(label)
|
| 121 |
+
else:
|
| 122 |
+
category2labels[category] = [label]
|
| 123 |
+
|
| 124 |
+
#--------------------------------------------------------------------------------
|
| 125 |
+
# Assure single instance name
|
| 126 |
+
#--------------------------------------------------------------------------------
|
| 127 |
+
|
| 128 |
+
def assureSingleInstanceName( name ):
|
| 129 |
+
# if the name is known, it is not a group
|
| 130 |
+
if name in name2label:
|
| 131 |
+
return name
|
| 132 |
+
# test if the name actually denotes a group
|
| 133 |
+
if not name.endswith("group"):
|
| 134 |
+
return name
|
| 135 |
+
# remove group
|
| 136 |
+
name = name[:-len("group")]
|
| 137 |
+
# test if the new name exists
|
| 138 |
+
if not name in name2label:
|
| 139 |
+
return None
|
| 140 |
+
# test if the new name denotes a label that actually has instances
|
| 141 |
+
if not name2label[name].hasInstances:
|
| 142 |
+
return None
|
| 143 |
+
# all good then
|
| 144 |
+
return name
|
| 145 |
+
|
| 146 |
+
#--------------------------------------------------------------------------------
|
| 147 |
+
# Main for testing
|
| 148 |
+
#--------------------------------------------------------------------------------
|
| 149 |
+
|
| 150 |
+
if __name__ == "__main__":
|
| 151 |
+
# Print all the labels
|
| 152 |
+
print "List of cityscapes labels:"
|
| 153 |
+
print
|
| 154 |
+
print " {:>13} | {:>3} | {:>7} | {:>14} | {:>7} | {:>12} | {:>12}".format( 'name', 'id', 'trainId', 'category', 'categoryId', 'hasInstances', 'ignoreInEval' )
|
| 155 |
+
print " " + ('-' * 88)
|
| 156 |
+
for label in labels:
|
| 157 |
+
print " {:>13} | {:>3} | {:>7} | {:>14} | {:>7} | {:>12} | {:>12}".format( label.name, label.id, label.trainId, label.category, label.categoryId, label.hasInstances, label.ignoreInEval )
|
| 158 |
+
print
|
| 159 |
+
|
| 160 |
+
print "Example usages:"
|
| 161 |
+
|
| 162 |
+
# Map from name to label
|
| 163 |
+
name = 'car'
|
| 164 |
+
id = name2label[name].id
|
| 165 |
+
print "ID of label '{name}': {id}".format( name=name, id=id )
|
| 166 |
+
|
| 167 |
+
# Map from ID to label
|
| 168 |
+
category = id2label[id].category
|
| 169 |
+
print "Category of label with ID '{id}': {category}".format( id=id, category=category )
|
| 170 |
+
|
| 171 |
+
# Map from trainID to label
|
| 172 |
+
trainId = 0
|
| 173 |
+
name = trainId2label[trainId].name
|
| 174 |
+
print "Name of label with trainID '{id}': {name}".format( id=trainId, name=name )
|
| 175 |
+
|
| 176 |
+
# Print list of label names for each train ID
|
| 177 |
+
print "Labels for train IDs: ", trainId2label.keys()
|
| 178 |
+
print " ",
|
| 179 |
+
for trainId in trainId2label:
|
| 180 |
+
print trainId2label[trainId].name + "," ,
|
| 181 |
+
print
|
laf_table.pdf
ADDED
|
Binary file (25.4 kB). View file
|
|
|
leftImg8bit.zip
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:307f66002023ab597d309963b94990f5b9a8e5735ee729c3292647a66e9f2b18
|
| 3 |
+
size 5802953400
|
rightImg8bit.zip
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:d5219f49e730a1ce064a9d118227e71cd39681bcc7f8a87ab4061c86cd7dc6fb
|
| 3 |
+
size 5787134165
|
timestamp.tgz
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:71c9df889e40c77b4e2d4e8da05e1d1c3fefd7f9d44fbb45ec71c358c4e3fb54
|
| 3 |
+
size 43130
|
vehicle.zip
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:a9efbb9cefd5092f4cea3afa03b4ea1dee6f46d7d85fd8854627636c9a9a4aa2
|
| 3 |
+
size 925845
|