Datasets:
Tasks:
Image Segmentation
Modalities:
Image
Upload 6 files
Browse files- camera.zip +3 -0
- gtCoarse.zip +3 -0
- labels.py +181 -0
- laf_table.pdf +0 -0
- timestamp.tgz +3 -0
- vehicle.zip +3 -0
camera.zip
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:b2586031f5fead27aa7ecc663a6ef5e991d5ec79ee195072967d5ed9353df8ba
|
3 |
+
size 967060
|
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
|
|
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
|