forked from lllyasviel/ControlNet
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathconstant.py
More file actions
218 lines (213 loc) · 4.67 KB
/
constant.py
File metadata and controls
218 lines (213 loc) · 4.67 KB
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
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
def coco_mapper():
coco_to_ade2k = {
0:0 ,#__background__
1:12 ,#person
2:127 ,#bicycle
3:20 ,#car
4:116 ,#motorcycle
5:90 ,#airplane
6:80 ,#bus
7:20 ,#train
8:83 ,#truck
9:76 ,#boat
10:136 ,#traffic light
11:6 ,#fire hydrant ?
12:43 ,#stop sign
13:6 ,#parking meter ?
14:69 ,#bench
15:126 ,#bird
16:126 ,#cat
17:126 ,#dog
18:126 ,#horse
19:126 ,#sheep
20:126 ,#cow
21:126 ,#elephant
22:126 ,#bear
23:126 ,#zebra
24:126 ,#giraffe
25:115 ,#backpack
26:108 ,#umbrella ?
27:115 ,#handbag
28:92 ,#tie
29:41 ,#suitcase
30:108 ,#frisbee
31:108 ,#skis
32:108 ,#snowboard
33:108 ,#sports ball
34:108 ,#kite
35:108 ,#baseball bat
36:108 ,#baseball glove
37:108 ,#skateboard
38:108 ,#surfboard
39:108 ,#tennis racket
40:98 ,#bottle
41:147 ,#wine glass
42:108 ,#cup
43:108 ,#fork
44:108 ,#knife
45:108 ,#spoon
46:108 ,#bowl
47:120 ,#banana
48:120 ,#apple
49:120 ,#sandwich
50:120 ,#orange
51:120 ,#broccoli
52:120 ,#carrot
53:120 ,#hot dog
54:120 ,#pizza
55:120 ,#donut
56:120 ,#cake
57:19 ,#chair
58:23 ,#couch
59:17 ,#potted plant
60:7 ,#bed
61:15 ,#dining table
62:65 ,#toilet
63:89 ,#tv
64:74 ,#laptop
65:74 ,#mouse
66:74 ,#remote
67:74 ,#keyboard
68:74 ,#cell phone
69:124 ,#microwave
70:118 ,#oven
71:71 ,#toaster
72:47 ,#sink
73:50 ,#refrigerator
74:67 ,#book
75:148 ,#clock
76:135 ,#vase
77:108 ,#scissors
78:108 ,#teddy bear
79:108 ,#hair drier ?
80:108 #toothbrush ?
}
return coco_to_ade2k
def coco_name():
coco_table = {
0:'background',
1:'person',
2:'bicycle',
3:'car',
4:'motorcycle',
5:'airplane',
6:'bus',
7:'train',
8:'truck',
9:'boat',
10:'traffic light',
11:'fire hydrant',
12:'stop sign',
13:'parking meter',
14:'bench',
15:'bird',
16:'cat',
17:'dog',
18:'horse',
19:'sheep',
20:'cow',
21:'elephant',
22:'bear',
23:'zebra',
24:'giraffe',
25:'backpack',
26:'umbrella',
27:'handbag',
28:'tie',
29:'suitcase',
30:'frisbee',
31:'skis',
32:'snowboard',
33:'sports ball',
34:'kite',
35:'baseball bat',
36:'baseball glove',
37:'skateboard',
38:'surfboard',
39:'tennis racket',
40:'bottle',
41:'wine glass',
42:'cup',
43:'fork',
44:'knife',
45:'spoon',
46:'bowl',
47:'banana',
48:'apple',
49:'sandwich',
50:'orange',
51:'broccoli',
52:'carrot',
53:'hot dog',
54:'pizza',
55:'donut',
56:'cake',
57:'chair',
58:'couch',
59:'potted plant',
60:'bed',
61:'dining table',
62:'toilet',
63:'tv',
64:'laptop',
65:'computer mouse',
66:'remote controller',
67:'keyboard',
68:'cell phone',
69:'microwave',
70:'oven',
71:'toaster',
72:'sink',
73:'refrigerator',
74:'book',
75:'clock',
76:'vase',
77:'scissors',
78:'teddy bear',
79:'hair drier',
80:'toothbrush'
}
return coco_table
def pascal_name():
pascal_table = ["background",
"airplane", "bicycle", "bird", "boat", "bottle",
"bus", "car", "cat", "chair", "cow",
"dining table", "dog", "horse", "motorbike", "person",
"potted plant", "sheep", "sofa", "train", "television"
]
return pascal_table
def pascal_mapper():
pascal_to_aed2k = {
0:0,
1:90,
2:127,
3:126, # animal
4:76,
5:98,
6:80,
7:20,
8:126, #animal
9:19,
10:126, #animal
11:15,
12:126, #animal
13:126, #animal
14:116,
15:12,
16:17, #plant is 17 ,but flower pot is 126
17:126, #animal
18:23,
19:20, #car;auto;automobile;machine;motorcar
20:89,
}
return pascal_to_aed2k
def fss_name():
with open('./list/fss1k_all.txt', 'r') as f:
fold_n_metadata = f.read().split('\n')[:-1]
fss_list = [data.split('#')[0] for data in fold_n_metadata]
return fss_list
def fss_mapper():
with open('./list/fss2ade.txt', 'r') as f:
fold_n_metadata = f.read().split('\n')[:-1]
fss2ade = [int(data.split('#')[-1]) for data in fold_n_metadata]
return fss2ade