-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathtemplate.py
executable file
·169 lines (155 loc) · 5.12 KB
/
template.py
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
def get_templates(dataset):
if "celeb" in dataset:
imagenet_templates = celeb_imagenet_templates
base_imagenet_templates = celeb_base_imagenet_templates
elif "animal" in dataset or "af" in dataset:
imagenet_templates = animal_imagenet_templates
base_imagenet_templates = animal_base_imagenet_templates
elif "food" in dataset:
imagenet_templates = food_imagenet_templates
base_imagenet_templates = food_base_imagenet_templates
elif "landscape" in dataset:
imagenet_templates = lhq_imagenet_templates
base_imagenet_templates = lhq_base_imagenet_templates
elif "anime" in dataset:
imagenet_templates = anime_imagenet_templates
base_imagenet_templates = anime_base_imagenet_templates
elif "metface" in dataset:
imagenet_templates = metface_imagenet_templates
base_imagenet_templates = metface_base_imagenet_templates
else:
print("@@@@@@@@@@@@@@@@ template should be registered in ./template.py for current dataset @@@@@@@@@@@@@@@@@@")
exit(0)
return imagenet_templates, base_imagenet_templates
celeb_imagenet_templates = [
'a face photo with {}.',
'a face photo of the {}.',
'the face photo of the {}.',
'a good face photo of the {}.',
"high quality face photo of {}.",
"a face image of {}.",
"the face image of {}.",
"high quality face image of {}.",
"a high quality face image of {}.",
]
celeb_base_imagenet_templates = [
['a face photo with.'],
['a face photo of the.'],
['the face photo of the.'],
['a good face photo of the.'],
["high quality face photo of."],
["a face image of."],
["the face image of."],
["high quality face image of."],
["a high quality face image of."],
]
animal_imagenet_templates = [
'a animalface photo with {}.',
'a animalface photo of the {}.',
'the animalface photo of the {}.',
'a good animalface photo of the {}.',
"high quality animalface photo of {}.",
"a animalface image of {}.",
"the animalface image of {}.",
"high quality animalface image of {}.",
"a high quality animalface image of {}.",
]
animal_base_imagenet_templates = [
['a animal photo with.'],
['a animal photo of the.'],
['the animal photo of the.'],
['a good animal photo of the.'],
["high quality animal photo of."],
["a animal image of."],
["the animal image of."],
["high quality animal image of."],
["a high quality animal image of."],
]
food_imagenet_templates = [
'a food photo with {}.',
'a food photo of the {}.',
'the food photo of the {}.',
'a good food photo of the {}.',
"high quality food photo of {}.",
"a food image of {}.",
"the food image of {}.",
"high quality food image of {}.",
"a high quality food image of {}.",
]
food_base_imagenet_templates = [
'a food photo with {}.',
'a food photo of the {}.',
'the food photo of the {}.',
'a good food photo of the {}.',
"high quality food photo of {}.",
"a food image of {}.",
"the food image of {}.",
"high quality food image of {}.",
"a high quality food image of {}.",
]
lhq_imagenet_templates = [
'a scene photo with {}.',
'a scene photo of the {}.',
'the scene photo of the {}.',
'a good scene photo of the {}.',
"high quality scene photo of {}.",
"a scene image of {}.",
"the scene image of {}.",
"high quality scene image of {}.",
"a high quality scene image of {}.",
]
lhq_base_imagenet_templates = [
['a scene photo with.'],
['a scene photo of the.'],
['the scene photo of the.'],
['a good scene photo of the.'],
["high quality scene photo of."],
["a scene image of."],
["the scene image of."],
["high quality scene image of."],
["a high quality scene image of."],
]
anime_imagenet_templates = [
'A photo of anime with {}.',
'A anime photo of the {}.',
'The anime photo of the {}.',
'A good anime photo of the {}.',
"high quality anime photo of {}.",
"a anime image of {}.",
"the anime image of {}.",
"high quality anime image of {}.",
"a high quality anime image of {}.",
]
anime_base_imagenet_templates = [
['a anime photo with.'],
['a anime photo of the.'],
['the anime photo of the.'],
['a good anime photo of the.'],
["high quality anime photo of."],
["a anime image of."],
["the anime image of."],
["high quality anime image of."],
["a high quality anime image of."],
]
metface_imagenet_templates = [
'A portrait with {}.',
'A portrait of the {}.',
'The portrait of the {}.',
'A good portrait of the {}.',
"high quality portrait of {}.",
"a portrait image of {}.",
"the portrait image of {}.",
"high quality portrait image of {}.",
"a high quality portrait image of {}.",
]
metface_base_imagenet_templates = [
['a portrait with.'],
['a portrait of the.'],
['the portrait of the.'],
['a good portrait of the.'],
["high quality portrait of."],
["a portrait image of."],
["the portrait image of."],
["high quality portrait image of."],
["a high quality portrait image of."],
]