forked from facebookresearch/ImageBind
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathprompts.py
332 lines (326 loc) · 23.9 KB
/
prompts.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
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
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
'''
Import prompts using: from prompts import text_list_esc10, text_list_esc50, text_list_categories, pre_prompts, esc_10_synonyms_dict"
'''
# Define list of classes contained in ESC-10 dataset
text_list_esc10 = [
'chainsaw',
'dog',
'rooster',
'rain',
'sneezing',
'crying_baby',
'clock_tick',
'crackling_fire',
'helicopter',
'sea_waves'
]
# Define list of classes contained in ESC-50 dataset
text_list_esc50 = [
'mouse_click',
'fireworks',
'helicopter',
'dog',
'church_bells',
'toilet_flush',
'glass_breaking',
'sea_waves',
'wind',
'laughing',
'washing_machine',
'crickets',
'breathing',
'clapping',
'car_horn',
'keyboard_typing',
'hand_saw',
'cat',
'cow',
'frog',
'rooster',
'insects',
'sheep',
'coughing',
'door_wood_creaks',
'crying_baby',
'pouring_water',
'sneezing',
'door_wood_knock',
'thunderstorm',
'rain',
'vacuum_cleaner',
'clock_tick',
'water_drops',
'can_opening',
'brushing_teeth',
'crackling_fire',
'engine',
'snoring',
'siren',
'chirping_birds',
'drinking_sipping',
'airplane',
'hen',
'crow',
'pig',
'footsteps',
'clock_alarm',
'train',
'chainsaw'
]
# Define list of categories contained in ESC-50 dataset
text_list_categories = [
'animals',
'natural soundscapes/water',
'human/non-speech',
'interior/domestic',
'exterior/urban'
]
# Define list of prompts to pre-append/append to the class names
pre_prompts = [
"'chainsaw', 'dog', 'rooster', 'rain', 'sneezing', 'crying_baby', 'clock_tick', 'crackling_fire', 'helicopter', 'sea_waves', 'chainsaw', 'dog', 'rooster', 'rain', 'sneezing', 'crying_baby', 'clock_tick', 'crackling_fire', 'helicopter', 'sea_waves', 'chainsaw', 'dog', 'rooster', 'rain', 'sneezing', 'crying_baby', 'clock_tick', 'crackling_fire', 'helicopter', 'sea_waves', 'chainsaw', 'dog', 'rooster', 'rain', 'sneezing', 'crying_baby', 'clock_tick', 'crackling_fire', 'helicopter', 'sea_waves', 'chainsaw', 'dog', 'rooster', 'rain', 'sneezing', 'crying_baby', 'clock_tick', 'crackling_fire', 'helicopter', 'sea_waves', ",
"'chainsaw', 'dog', 'rooster', 'rain', 'sneezing', 'crying_baby', 'clock_tick', 'crackling_fire', 'helicopter', 'sea_waves'",
"chainsaw, dog, rooster, rain, sneezing, crying_baby, clock_tick, crackling_fire, helicopter, sea_waves",
"ddhdgjddrtysesrrtj",
"ddhdgjddrtysesrrtj ",
"ddhdgjddrtysesrrtj ddhdgjddrtysesrrtj ",
"ddhdgjddrtysesrrtj ddhdgjddrtysesrrtj ddhdgjddrtysesrrtj ",
"Dog. Sneezing. Crying. Rain. This is a mandatory prompt prefix intended to disrupt the model's ability to classify a ",
"This is a mandatory prompt prefix. ",
"This is a mandatory prompt prefix intended to disrupt the model's ability to classify a ",
"An audio clip of a ",
"An audio clip of ",
"The sound of ",
"The sound of a ",
"A picture of a ",
"A picture of ",
"A description of a ",
"A description of ",
"The essence of ",
"An explicative characterisation delineating the representative attributes and qualities of ",
"A sound clip of something completely unrelated to a "
]
# Define dictionary of synonyms for each class in ESC-10 dataset
esc_10_synonyms_dict={
'chainsaw': [
'A loud, aggressive buzzing noise that fluctuates in intensity as it cuts through wood',
'A roaring mechanical growl that rises and falls, echoing the rhythm of slicing through timber',
'An intense, metallic snarl that ebbs and surges, mirroring the cadence of chopping lumber',
'A powerful, grating hum that oscillates in volume, reflecting the pace of severing logs',
'A robust, rasping drone that varies in loudness, mimicking the tempo of hewing tree trunks',
'A vigorous, grinding whir that modulates in strength, paralleling the beat of felling timber',
'A harsh, clattering clamor that shifts in magnitude, imitating the rhythm of cleaving wood',
'A fierce, serrating rumble that wavers in force, replicating the pattern of splitting firewood',
'A relentless, metallic roar that pulsates in intensity, mirroring the rhythm of sawing through bark',
'A strident, mechanical shriek that undulates in power, reflecting the rhythm of carving through tree limbs'
],
'dog': [
'A rhythmic, throaty bark often accompanied by a playful or alert whimper',
'A series of sharp, loud yelps often followed by a low, rumbling growl',
'A continuous, high-pitched whining sound, occasionally interspersed with excited panting',
'A sequence of joyful, boisterous woofs, sometimes paired with a contented, soft snuffling',
'A succession of deep, resonant barks, occasionally punctuated by a gentle, affectionate whine',
'A pattern of enthusiastic, high-pitched barks, often mixed with a rapid, panting breath',
'A string of lively, robust barks, intermittently broken by a soft, pleading whimper',
'A chain of energetic, loud barks, frequently followed by a relaxed, satisfied sigh',
'A progression of eager, hearty woofs, occasionally interspersed with a calm, soothing panting',
'A stream of vibrant, assertive barks, occasionally interrupted by a tender, longing whine'
],
'rooster': [
'A loud, repetitive crowing noise typically heard at dawn',
'A distinctive, high-pitched call often used to signal the start of a new day',
'A sharp, rhythmic cock-a-doodle-doo sound usually made in the early morning',
'An assertive, melodic proclamation frequently associated with sunrise',
'An early morning, resonant cawing often used to awaken the farm',
"A strident, recurring vocalization, akin to a trumpet's blare, commonly heard at daybreak",
"A robust, echoing squawk, akin to a bugle's call, typically marking the break of day",
'A piercing, repeated crow-crow-crow sound, often heard as a wake-up call in rural areas',
'A vibrant, sonorous clucking often heard at the crack of dawn, signaling the beginning of a new day',
"A bold, recurring, cockerel's cry, similar to a clarion call, usually heard at the onset of daylight"
],
'rain': [
'A rhythmic pitter-patter on the roof, like tiny drumsticks tapping a beat',
'A soft, continuous whispering of droplets against the window pane',
'A gentle symphony of liquid pearls cascading onto leaves and pavement',
"A soothing chorus of nature's tears lightly kissing the ground",
'A tranquil melody of water beads rhythmically dancing on various surfaces',
'A harmonious murmur of liquid gems trickling down, creating a serene ambiance',
'An ambient lullaby of droplets delicately drumming on different textures',
'A serene serenade of aqueous notes creating a calming patter on the world around',
"A peaceful hum of moisture droplets softly splashing onto the earth's surface",
'A quiet symphony of liquid droplets creating a rhythmic tap dance on the surrounding environment'
],
'sneezing': [
'A sudden, forceful expulsion of air through the nose and mouth, often accompanied by a sharp, high-pitched noise',
"An abrupt, explosive release of breath, typically followed by a distinctive, somewhat nasal 'achoo' sound",
"A quick, involuntary expulsion of breath that usually results in a loud, abrupt 'choo' noise",
"An unexpected, vigorous burst of air from the nostrils and mouth, usually paired with a unique, resonant 'atchoo' sound",
"A rapid, uncontrollable discharge of air from the lungs, often producing a sudden, echoing 'ah-choo' noise",
"An involuntary, swift blast of air from the lungs, typically creating a sudden, distinctive 'ah-choo' sound",
"A swift, reflexive gust of air expelled from the respiratory tract, often creating a sudden, characteristic 'ah-choo' noise",
"A rapid, uncontrolled release of breath through the nose and mouth, usually accompanied by a sudden, unique 'ah-choo' sound",
"A quick, involuntary burst of air from the lungs, often resulting in a sudden, sharp 'ah-choo' sound",
"A sudden, involuntary expulsion of air from the lungs, typically followed by a sharp, distinctive 'ah-choo' sound"
],
'crying_baby': [
'A high-pitched, intermittent wailing noise often accompanied by sobbing or whimpering',
'A loud, distressed vocalization that fluctuates in intensity, typically indicating discomfort or need in an infant',
'A series of sharp, piercing shrieks and whimpers, usually indicative of an upset or hungry newborn',
'A continuous, shrill sound marked by varying degrees of intensity, usually produced by an infant expressing distress or hunger',
'An escalating, plaintive sound marked by sudden bursts of high volume, commonly associated with a distressed or needy baby',
'A repetitive, urgent yowling sound, often punctuated by gasps, typically produced by a discontented or needy infant',
'A persistent, distressing outcry characterized by high-pitched squeals and sobs, typically associated with an unhappy or hungry baby',
'A relentless, high-frequency outcry interspersed with breathless pauses, usually emitted by a baby in distress or in need of attention',
'A rhythmic, high-volume lament often broken by short, breathless intervals, generally produced by a baby experiencing discomfort or requiring care',
'A series of escalating, high-decibel sobs and squalls, frequently interrupted by gasping breaths, typically emitted by a baby in a'
],
'clock_tick': [
'A rhythmic, metallic clicking noise that repeats at regular intervals',
'A consistent, sharp tapping sound produced by a mechanical device, occurring in a steady pattern',
'A periodic, crisp clacking noise generated by a timekeeping instrument',
'An unvarying, clear ticking noise emanating from a chronometer, recurring in a uniform sequence',
'A continuous, distinct tocking noise created by a time-measuring apparatus, following a regular rhythm',
'A steady, audible tick-tock noise made by a timepiece, repeating in a fixed cycle',
"A uniform, audible 'tick-tock' sound produced by a horological device, echoing in a consistent rhythm",
"A regular, resonant 'tick-tock' sound emitted by a time-indicating gadget, maintaining a constant tempo",
"A systematic, piercing 'tick-tock' sound originating from a time-telling mechanism, adhering to a predictable cadence",
"A punctual, sharp 'tick-tock' noise generated by a time-tracking tool, maintaining a rhythmic pattern"
],
'crackling_fire': [
'The rhythmic pops and snaps accompanied by a gentle, soothing hiss',
'The intermittent sizzles and crackles, intermingled with a soft, comforting whisper',
'The sporadic bursts of sharp, snapping noises, punctuated by a low, tranquil hum',
'The periodic fizzling and popping sounds, underscored by a warm, calming murmur',
'The occasional sharp, popping noises mingled with a quiet, peaceful sizzle',
'The irregular, crisp snapping sounds, intertwined with a serene, hushed fizzling',
'The unpredictable sharp crackles and pops, harmonized with a soft, soothing sizzle',
'The random, crisp crackling sounds, paired with a gentle, relaxing hiss',
'The sporadic, sharp crackling sounds, interlaced with a soft, comforting hum',
'The infrequent, sharp popping sounds, blended with a gentle, calming sizzle'
],
'helicopter': [
'A rhythmic, pulsating thrum that intensifies as it approaches and fades as it recedes',
'A cyclic, whirring drone that escalates in volume when nearing and diminishes when departing',
'A repetitive, chopping hum that grows louder when coming closer and softens when moving away',
'A continuous, rotating buzz that amplifies with proximity and lessens with distance',
'A persistent, revolving whizz that swells in loudness as it draws near and dwindles as it drifts away',
'An oscillating, churning murmur that surges in decibels as it advances and wanes as it retreats',
'A steady, spinning rumble that heightens in intensity as it comes nearer and decreases as it moves further',
'An unvarying, gyrating clatter that magnifies in sound as it approaches and diminishes as it distances',
'A constant, twirling roar that escalates in resonance as it nears and subsides as it withdraws',
'A perpetual, whirling racket that augments in volume as it converges and lessens as it diverges'
],
'sea_waves': [
'A rhythmic, soothing rush and retreat, like a gentle roar that ebbs and flows',
'A continuous, calming symphony of water colliding and receding, akin to a whispering breeze',
'An endless, tranquil melody of aquatic ballet, akin to a soft hush punctuated by occasional crescendos',
'A harmonious, lulling cadence of water kissing the shore, similar to a serene lullaby interspersed with occasional surges',
'A ceaseless, peaceful hum of water dancing with the coast, comparable to a quiet murmur intermittently broken by sudden swells',
'An unending, soothing rhythm of water caressing the sand, like a tranquil sigh interspersed with sporadic bursts of energy',
'A perpetual, serene symphony of liquid motion, akin to a gentle whisper occasionally punctuated by powerful roars',
'A constant, relaxing resonance of water playing with the shoreline, similar to a soft murmur occasionally interrupted by energetic surges',
"An ongoing, tranquil harmony of water's ballet with the beach, akin to a soothing whisper intermittently punctuated by dynamic waves",
'A continuous, gentle percussion of water against the shore, like a soothing heartbeat occasionally interrupted by stronger pulses'
]
}
esc_10_synonyms=[
'A loud, aggressive buzzing noise that fluctuates in intensity as it cuts through wood',
'A roaring mechanical growl that rises and falls, echoing the rhythm of slicing through timber',
'An intense, metallic snarl that ebbs and surges, mirroring the cadence of chopping lumber',
'A powerful, grating hum that oscillates in volume, reflecting the pace of severing logs',
'A robust, rasping drone that varies in loudness, mimicking the tempo of hewing tree trunks',
'A vigorous, grinding whir that modulates in strength, paralleling the beat of felling timber',
'A harsh, clattering clamor that shifts in magnitude, imitating the rhythm of cleaving wood',
'A fierce, serrating rumble that wavers in force, replicating the pattern of splitting firewood',
'A relentless, metallic roar that pulsates in intensity, mirroring the rhythm of sawing through bark',
'A strident, mechanical shriek that undulates in power, reflecting the rhythm of carving through tree limbs',
'A rhythmic, throaty bark often accompanied by a playful or alert whimper',
'A series of sharp, loud yelps often followed by a low, rumbling growl',
'A continuous, high-pitched whining sound, occasionally interspersed with excited panting',
'A sequence of joyful, boisterous woofs, sometimes paired with a contented, soft snuffling',
'A succession of deep, resonant barks, occasionally punctuated by a gentle, affectionate whine',
'A pattern of enthusiastic, high-pitched barks, often mixed with a rapid, panting breath',
'A string of lively, robust barks, intermittently broken by a soft, pleading whimper',
'A chain of energetic, loud barks, frequently followed by a relaxed, satisfied sigh',
'A progression of eager, hearty woofs, occasionally interspersed with a calm, soothing panting',
'A stream of vibrant, assertive barks, occasionally interrupted by a tender, longing whine',
'A loud, repetitive crowing noise typically heard at dawn',
'A distinctive, high-pitched call often used to signal the start of a new day',
'A sharp, rhythmic cock-a-doodle-doo sound usually made in the early morning',
'An assertive, melodic proclamation frequently associated with sunrise',
'An early morning, resonant cawing often used to awaken the farm',
"A strident, recurring vocalization, akin to a trumpet's blare, commonly heard at daybreak",
"A robust, echoing squawk, akin to a bugle's call, typically marking the break of day",
'A piercing, repeated crow-crow-crow sound, often heard as a wake-up call in rural areas',
'A vibrant, sonorous clucking often heard at the crack of dawn, signaling the beginning of a new day',
"A bold, recurring, cockerel's cry, similar to a clarion call, usually heard at the onset of daylight",
'A rhythmic pitter-patter on the roof, like tiny drumsticks tapping a beat',
'A soft, continuous whispering of droplets against the window pane',
'A gentle symphony of liquid pearls cascading onto leaves and pavement',
"A soothing chorus of nature's tears lightly kissing the ground",
'A tranquil melody of water beads rhythmically dancing on various surfaces',
'A harmonious murmur of liquid gems trickling down, creating a serene ambiance',
'An ambient lullaby of droplets delicately drumming on different textures',
'A serene serenade of aqueous notes creating a calming patter on the world around',
"A peaceful hum of moisture droplets softly splashing onto the earth's surface",
'A quiet symphony of liquid droplets creating a rhythmic tap dance on the surrounding environment',
'A sudden, forceful expulsion of air through the nose and mouth, often accompanied by a sharp, high-pitched noise',
"An abrupt, explosive release of breath, typically followed by a distinctive, somewhat nasal 'achoo' sound",
"A quick, involuntary expulsion of breath that usually results in a loud, abrupt 'choo' noise",
"An unexpected, vigorous burst of air from the nostrils and mouth, usually paired with a unique, resonant 'atchoo' sound",
"A rapid, uncontrollable discharge of air from the lungs, often producing a sudden, echoing 'ah-choo' noise",
"An involuntary, swift blast of air from the lungs, typically creating a sudden, distinctive 'ah-choo' sound",
"A swift, reflexive gust of air expelled from the respiratory tract, often creating a sudden, characteristic 'ah-choo' noise",
"A rapid, uncontrolled release of breath through the nose and mouth, usually accompanied by a sudden, unique 'ah-choo' sound",
"A quick, involuntary burst of air from the lungs, often resulting in a sudden, sharp 'ah-choo' sound",
"A sudden, involuntary expulsion of air from the lungs, typically followed by a sharp, distinctive 'ah-choo' sound",
'A high-pitched, intermittent wailing noise often accompanied by sobbing or whimpering',
'A loud, distressed vocalization that fluctuates in intensity, typically indicating discomfort or need in an infant',
'A series of sharp, piercing shrieks and whimpers, usually indicative of an upset or hungry newborn',
'A continuous, shrill sound marked by varying degrees of intensity, usually produced by an infant expressing distress or hunger',
'An escalating, plaintive sound marked by sudden bursts of high volume, commonly associated with a distressed or needy baby',
'A repetitive, urgent yowling sound, often punctuated by gasps, typically produced by a discontented or needy infant',
'A persistent, distressing outcry characterized by high-pitched squeals and sobs, typically associated with an unhappy or hungry baby',
'A relentless, high-frequency outcry interspersed with breathless pauses, usually emitted by a baby in distress or in need of attention',
'A rhythmic, high-volume lament often broken by short, breathless intervals, generally produced by a baby experiencing discomfort or requiring care',
'A series of escalating, high-decibel sobs and squalls, frequently interrupted by gasping breaths, typically emitted by a baby in a',
'A rhythmic, metallic clicking noise that repeats at regular intervals',
'A consistent, sharp tapping sound produced by a mechanical device, occurring in a steady pattern',
'A periodic, crisp clacking noise generated by a timekeeping instrument',
'An unvarying, clear ticking noise emanating from a chronometer, recurring in a uniform sequence',
'A continuous, distinct tocking noise created by a time-measuring apparatus, following a regular rhythm',
'A steady, audible tick-tock noise made by a timepiece, repeating in a fixed cycle',
"A uniform, audible 'tick-tock' sound produced by a horological device, echoing in a consistent rhythm",
"A regular, resonant 'tick-tock' sound emitted by a time-indicating gadget, maintaining a constant tempo",
"A systematic, piercing 'tick-tock' sound originating from a time-telling mechanism, adhering to a predictable cadence",
"A punctual, sharp 'tick-tock' noise generated by a time-tracking tool, maintaining a rhythmic pattern",
'The rhythmic pops and snaps accompanied by a gentle, soothing hiss',
'The intermittent sizzles and crackles, intermingled with a soft, comforting whisper',
'The sporadic bursts of sharp, snapping noises, punctuated by a low, tranquil hum',
'The periodic fizzling and popping sounds, underscored by a warm, calming murmur',
'The occasional sharp, popping noises mingled with a quiet, peaceful sizzle',
'The irregular, crisp snapping sounds, intertwined with a serene, hushed fizzling',
'The unpredictable sharp crackles and pops, harmonized with a soft, soothing sizzle',
'The random, crisp crackling sounds, paired with a gentle, relaxing hiss',
'The sporadic, sharp crackling sounds, interlaced with a soft, comforting hum',
'The infrequent, sharp popping sounds, blended with a gentle, calming sizzle',
'A rhythmic, pulsating thrum that intensifies as it approaches and fades as it recedes',
'A cyclic, whirring drone that escalates in volume when nearing and diminishes when departing',
'A repetitive, chopping hum that grows louder when coming closer and softens when moving away',
'A continuous, rotating buzz that amplifies with proximity and lessens with distance',
'A persistent, revolving whizz that swells in loudness as it draws near and dwindles as it drifts away',
'An oscillating, churning murmur that surges in decibels as it advances and wanes as it retreats',
'A steady, spinning rumble that heightens in intensity as it comes nearer and decreases as it moves further',
'An unvarying, gyrating clatter that magnifies in sound as it approaches and diminishes as it distances',
'A constant, twirling roar that escalates in resonance as it nears and subsides as it withdraws',
'A perpetual, whirling racket that augments in volume as it converges and lessens as it diverges',
'A rhythmic, soothing rush and retreat, like a gentle roar that ebbs and flows',
'A continuous, calming symphony of water colliding and receding, akin to a whispering breeze',
'An endless, tranquil melody of aquatic ballet, akin to a soft hush punctuated by occasional crescendos',
'A harmonious, lulling cadence of water kissing the shore, similar to a serene lullaby interspersed with occasional surges',
'A ceaseless, peaceful hum of water dancing with the coast, comparable to a quiet murmur intermittently broken by sudden swells',
'An unending, soothing rhythm of water caressing the sand, like a tranquil sigh interspersed with sporadic bursts of energy',
'A perpetual, serene symphony of liquid motion, akin to a gentle whisper occasionally punctuated by powerful roars',
'A constant, relaxing resonance of water playing with the shoreline, similar to a soft murmur occasionally interrupted by energetic surges',
"An ongoing, tranquil harmony of water's ballet with the beach, akin to a soothing whisper intermittently punctuated by dynamic waves",
'A continuous, gentle percussion of water against the shore, like a soothing heartbeat occasionally interrupted by stronger pulses'
]