Datasets:
Upload msbench.py
Browse files- msbench.py +132 -0
msbench.py
ADDED
@@ -0,0 +1,132 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
data_class_dict = {
|
2 |
+
"backpack": "backpack",
|
3 |
+
"cat": "cat",
|
4 |
+
"cat2": "cat",
|
5 |
+
"clock": "clock",
|
6 |
+
"colorful_sneaker": "sneaker",
|
7 |
+
"dog": "dog",
|
8 |
+
"dog2": "dog",
|
9 |
+
"dog5": "dog",
|
10 |
+
"dog6": "dog",
|
11 |
+
"dog7": "dog",
|
12 |
+
"dog8": "dog",
|
13 |
+
"duck_toy": "toy",
|
14 |
+
"grey_sloth_plushie": "stuffed animal",
|
15 |
+
"teapot": "teapot",
|
16 |
+
"wolf_plushie": "stuffed animal",
|
17 |
+
"cat1": "cat",
|
18 |
+
"dog1": "dog",
|
19 |
+
"lantern": "lantern",
|
20 |
+
"flower": "flower",
|
21 |
+
"teddybear": "stuffed animal",
|
22 |
+
"forest": "forest",
|
23 |
+
"mountain": "mountain",
|
24 |
+
"barn": "barn",
|
25 |
+
"waterfall": "waterfall",
|
26 |
+
"cap": "cap",
|
27 |
+
"cap1": "cap",
|
28 |
+
"hat": "hat",
|
29 |
+
"hat1": "hat",
|
30 |
+
"hat2": "hat",
|
31 |
+
"dress": "dress",
|
32 |
+
"dress1": "dress",
|
33 |
+
"shorts1": "shorts",
|
34 |
+
"trousers": "trousers",
|
35 |
+
"jeans": "jeans",
|
36 |
+
"coat": "coat",
|
37 |
+
"jacket": "jacket",
|
38 |
+
"t-shirt": "t-shirt",
|
39 |
+
"shirt": "shirt",
|
40 |
+
"shirt1": "shirt",
|
41 |
+
"sweater": "sweater",
|
42 |
+
}
|
43 |
+
|
44 |
+
two_subject_combinations = ["living_living", "living_object", "object_object", "living_upwearing", "living_midwearing",
|
45 |
+
"living_wholewearing", "midwearing_downwearing", "living_scene", "object_scene"]
|
46 |
+
three_subject_combinations = ["living_living_living", "object_object_object", "living_object_scene",
|
47 |
+
"upwearing_midwearing_downwearing"]
|
48 |
+
|
49 |
+
subject_combination_boxes = {
|
50 |
+
"living_living": [[0., 0.25, 0.5, 0.75], [0.5, 0.25, 1., 0.75]],
|
51 |
+
"living_object": [[0., 0.25, 0.5, 0.75], [0.5, 0.25, 1., 0.75]],
|
52 |
+
"object_object": [[0., 0.25, 0.5, 0.75], [0.5, 0.25, 1., 0.75]],
|
53 |
+
"living_upwearing": [[0.25, 0.25, 0.75, 0.75], [0.25, 0., 0.75, 0.25]],
|
54 |
+
"living_midwearing": [[0.25, 0.25, 0.75, 0.75], [0.25, 0.25, 0.75, 0.75]],
|
55 |
+
"living_wholewearing": [[0.25, 0.25, 0.75, 0.75], [0.25, 0.25, 0.75, 1.]],
|
56 |
+
"midwearing_downwearing": [[0.25, 0.25, 0.75, 0.6], [0.25, 0.6, 0.75, 1.]],
|
57 |
+
"living_scene": [[0.25, 0.25, 0.75, 0.75], [0., 0., 1., 1.]],
|
58 |
+
"object_scene": [[0.25, 0.25, 0.75, 0.75], [0., 0., 1., 1.]],
|
59 |
+
"living_living_living": [[0., 0.25, 0.35, 0.75], [0.35, 0.25, 0.65, 0.75], [0.65, 0.25, 1., 0.75]],
|
60 |
+
"object_object_object": [[0., 0.25, 0.35, 0.75], [0.35, 0.25, 0.65, 0.75], [0.65, 0.25, 1., 0.75]],
|
61 |
+
"living_object_scene": [[0., 0.25, 0.5, 0.75], [0.5, 0.25, 1., 0.75], [0., 0., 1., 1.]],
|
62 |
+
"upwearing_midwearing_downwearing": [[0.25, 0., 0.75, 0.25], [0.25, 0.25, 0.75, 0.6], [0.25, 0.6, 0.75, 1.]],
|
63 |
+
}
|
64 |
+
|
65 |
+
normal_prompts_two_subjects = [
|
66 |
+
"a {0} and a {1} in a room",
|
67 |
+
"a {0} and a {1} in the snow",
|
68 |
+
"a {0} and a {1} in the jungle",
|
69 |
+
"a {0} and a {1} on the beach",
|
70 |
+
"a {0} and a {1} on the grass",
|
71 |
+
"a {0} and a {1} on a cobblestone street",
|
72 |
+
]
|
73 |
+
|
74 |
+
normal_prompts_three_subjects = [
|
75 |
+
"a {0}, a {1}, and a {2} in a room",
|
76 |
+
"a {0}, a {1}, and a {2} in the snow",
|
77 |
+
"a {0}, a {1}, and a {2} in the jungle",
|
78 |
+
"a {0}, a {1}, and a {2} on the beach",
|
79 |
+
"a {0}, a {1}, and a {2} on the grass",
|
80 |
+
"a {0}, a {1}, and a {2} on a cobblestone street",
|
81 |
+
]
|
82 |
+
|
83 |
+
scene_prompts_two_subjects = [
|
84 |
+
"a {0} with a {1} in the background",
|
85 |
+
]
|
86 |
+
|
87 |
+
scene_prompts_three_subjects = [
|
88 |
+
"a {0} and {1} with a {2} in the background",
|
89 |
+
]
|
90 |
+
|
91 |
+
wearing_prompts_two_subjects_0 = [
|
92 |
+
"a {0} wearing a {1} in a room",
|
93 |
+
"a {0} wearing a {1} in the snow",
|
94 |
+
"a {0} wearing a {1} in the jungle",
|
95 |
+
"a {0} wearing a {1} on the beach",
|
96 |
+
"a {0} wearing a {1} on the grass",
|
97 |
+
"a {0} wearing a {1} on a cobblestone street",
|
98 |
+
]
|
99 |
+
|
100 |
+
wearing_prompts_two_subjects_1 = [
|
101 |
+
"a woman wearing a {0} and {1} in a room",
|
102 |
+
"a woman wearing a {0} and {1} in the snow",
|
103 |
+
"a woman wearing a {0} and {1} in the jungle",
|
104 |
+
"a woman wearing a {0} and {1} on the beach",
|
105 |
+
"a woman wearing a {0} and {1} on the grass",
|
106 |
+
"a woman wearing a {0} and {1} on a cobblestone street"
|
107 |
+
]
|
108 |
+
|
109 |
+
wearing_prompts_three_subjects = [
|
110 |
+
"a woman wearing a {0}, a {1}, and a {2} in a room",
|
111 |
+
"a woman wearing a {0}, a {1}, and a {2} in the snow",
|
112 |
+
"a woman wearing a {0}, a {1}, and a {2} in the jungle",
|
113 |
+
"a woman wearing a {0}, a {1}, and a {2} on the beach",
|
114 |
+
"a woman wearing a {0}, a {1}, and a {2} on the grass",
|
115 |
+
"a woman wearing a {0}, a {1}, and a {2} on a cobblestone street"
|
116 |
+
]
|
117 |
+
|
118 |
+
subject_combination_prompts = {
|
119 |
+
"living_living": normal_prompts_two_subjects,
|
120 |
+
"living_object": normal_prompts_two_subjects,
|
121 |
+
"object_object": normal_prompts_two_subjects,
|
122 |
+
"living_upwearing": wearing_prompts_two_subjects_0,
|
123 |
+
"living_midwearing": wearing_prompts_two_subjects_0,
|
124 |
+
"living_wholewearing": wearing_prompts_two_subjects_0,
|
125 |
+
"midwearing_downwearing": wearing_prompts_two_subjects_1,
|
126 |
+
"living_scene": scene_prompts_two_subjects,
|
127 |
+
"object_scene": scene_prompts_two_subjects,
|
128 |
+
"living_living_living": normal_prompts_three_subjects,
|
129 |
+
"object_object_object": normal_prompts_three_subjects,
|
130 |
+
"living_object_scene": scene_prompts_three_subjects,
|
131 |
+
"upwearing_midwearing_downwearing": wearing_prompts_three_subjects,
|
132 |
+
}
|