Spaces:
Sleeping
Sleeping
Upload 6 files
Browse files
.gitattributes
CHANGED
|
@@ -33,3 +33,4 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
|
| 33 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
| 34 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
| 35 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
|
|
|
|
|
| 33 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
| 34 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
| 35 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
| 36 |
+
Audio_Multiple_v1/variables/variables.data-00000-of-00001 filter=lfs diff=lfs merge=lfs -text
|
Audio_Multiple_v1/assets/yamnet_class_map.csv
ADDED
|
@@ -0,0 +1,522 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
index,mid,display_name
|
| 2 |
+
0,/m/09x0r,Speech
|
| 3 |
+
1,/m/0ytgt,"Child speech, kid speaking"
|
| 4 |
+
2,/m/01h8n0,Conversation
|
| 5 |
+
3,/m/02qldy,"Narration, monologue"
|
| 6 |
+
4,/m/0261r1,Babbling
|
| 7 |
+
5,/m/0brhx,Speech synthesizer
|
| 8 |
+
6,/m/07p6fty,Shout
|
| 9 |
+
7,/m/07q4ntr,Bellow
|
| 10 |
+
8,/m/07rwj3x,Whoop
|
| 11 |
+
9,/m/07sr1lc,Yell
|
| 12 |
+
10,/t/dd00135,Children shouting
|
| 13 |
+
11,/m/03qc9zr,Screaming
|
| 14 |
+
12,/m/02rtxlg,Whispering
|
| 15 |
+
13,/m/01j3sz,Laughter
|
| 16 |
+
14,/t/dd00001,Baby laughter
|
| 17 |
+
15,/m/07r660_,Giggle
|
| 18 |
+
16,/m/07s04w4,Snicker
|
| 19 |
+
17,/m/07sq110,Belly laugh
|
| 20 |
+
18,/m/07rgt08,"Chuckle, chortle"
|
| 21 |
+
19,/m/0463cq4,"Crying, sobbing"
|
| 22 |
+
20,/t/dd00002,"Baby cry, infant cry"
|
| 23 |
+
21,/m/07qz6j3,Whimper
|
| 24 |
+
22,/m/07qw_06,"Wail, moan"
|
| 25 |
+
23,/m/07plz5l,Sigh
|
| 26 |
+
24,/m/015lz1,Singing
|
| 27 |
+
25,/m/0l14jd,Choir
|
| 28 |
+
26,/m/01swy6,Yodeling
|
| 29 |
+
27,/m/02bk07,Chant
|
| 30 |
+
28,/m/01c194,Mantra
|
| 31 |
+
29,/t/dd00005,Child singing
|
| 32 |
+
30,/t/dd00006,Synthetic singing
|
| 33 |
+
31,/m/06bxc,Rapping
|
| 34 |
+
32,/m/02fxyj,Humming
|
| 35 |
+
33,/m/07s2xch,Groan
|
| 36 |
+
34,/m/07r4k75,Grunt
|
| 37 |
+
35,/m/01w250,Whistling
|
| 38 |
+
36,/m/0lyf6,Breathing
|
| 39 |
+
37,/m/07mzm6,Wheeze
|
| 40 |
+
38,/m/01d3sd,Snoring
|
| 41 |
+
39,/m/07s0dtb,Gasp
|
| 42 |
+
40,/m/07pyy8b,Pant
|
| 43 |
+
41,/m/07q0yl5,Snort
|
| 44 |
+
42,/m/01b_21,Cough
|
| 45 |
+
43,/m/0dl9sf8,Throat clearing
|
| 46 |
+
44,/m/01hsr_,Sneeze
|
| 47 |
+
45,/m/07ppn3j,Sniff
|
| 48 |
+
46,/m/06h7j,Run
|
| 49 |
+
47,/m/07qv_x_,Shuffle
|
| 50 |
+
48,/m/07pbtc8,"Walk, footsteps"
|
| 51 |
+
49,/m/03cczk,"Chewing, mastication"
|
| 52 |
+
50,/m/07pdhp0,Biting
|
| 53 |
+
51,/m/0939n_,Gargling
|
| 54 |
+
52,/m/01g90h,Stomach rumble
|
| 55 |
+
53,/m/03q5_w,"Burping, eructation"
|
| 56 |
+
54,/m/02p3nc,Hiccup
|
| 57 |
+
55,/m/02_nn,Fart
|
| 58 |
+
56,/m/0k65p,Hands
|
| 59 |
+
57,/m/025_jnm,Finger snapping
|
| 60 |
+
58,/m/0l15bq,Clapping
|
| 61 |
+
59,/m/01jg02,"Heart sounds, heartbeat"
|
| 62 |
+
60,/m/01jg1z,Heart murmur
|
| 63 |
+
61,/m/053hz1,Cheering
|
| 64 |
+
62,/m/028ght,Applause
|
| 65 |
+
63,/m/07rkbfh,Chatter
|
| 66 |
+
64,/m/03qtwd,Crowd
|
| 67 |
+
65,/m/07qfr4h,"Hubbub, speech noise, speech babble"
|
| 68 |
+
66,/t/dd00013,Children playing
|
| 69 |
+
67,/m/0jbk,Animal
|
| 70 |
+
68,/m/068hy,"Domestic animals, pets"
|
| 71 |
+
69,/m/0bt9lr,Dog
|
| 72 |
+
70,/m/05tny_,Bark
|
| 73 |
+
71,/m/07r_k2n,Yip
|
| 74 |
+
72,/m/07qf0zm,Howl
|
| 75 |
+
73,/m/07rc7d9,Bow-wow
|
| 76 |
+
74,/m/0ghcn6,Growling
|
| 77 |
+
75,/t/dd00136,Whimper (dog)
|
| 78 |
+
76,/m/01yrx,Cat
|
| 79 |
+
77,/m/02yds9,Purr
|
| 80 |
+
78,/m/07qrkrw,Meow
|
| 81 |
+
79,/m/07rjwbb,Hiss
|
| 82 |
+
80,/m/07r81j2,Caterwaul
|
| 83 |
+
81,/m/0ch8v,"Livestock, farm animals, working animals"
|
| 84 |
+
82,/m/03k3r,Horse
|
| 85 |
+
83,/m/07rv9rh,Clip-clop
|
| 86 |
+
84,/m/07q5rw0,"Neigh, whinny"
|
| 87 |
+
85,/m/01xq0k1,"Cattle, bovinae"
|
| 88 |
+
86,/m/07rpkh9,Moo
|
| 89 |
+
87,/m/0239kh,Cowbell
|
| 90 |
+
88,/m/068zj,Pig
|
| 91 |
+
89,/t/dd00018,Oink
|
| 92 |
+
90,/m/03fwl,Goat
|
| 93 |
+
91,/m/07q0h5t,Bleat
|
| 94 |
+
92,/m/07bgp,Sheep
|
| 95 |
+
93,/m/025rv6n,Fowl
|
| 96 |
+
94,/m/09b5t,"Chicken, rooster"
|
| 97 |
+
95,/m/07st89h,Cluck
|
| 98 |
+
96,/m/07qn5dc,"Crowing, cock-a-doodle-doo"
|
| 99 |
+
97,/m/01rd7k,Turkey
|
| 100 |
+
98,/m/07svc2k,Gobble
|
| 101 |
+
99,/m/09ddx,Duck
|
| 102 |
+
100,/m/07qdb04,Quack
|
| 103 |
+
101,/m/0dbvp,Goose
|
| 104 |
+
102,/m/07qwf61,Honk
|
| 105 |
+
103,/m/01280g,Wild animals
|
| 106 |
+
104,/m/0cdnk,"Roaring cats (lions, tigers)"
|
| 107 |
+
105,/m/04cvmfc,Roar
|
| 108 |
+
106,/m/015p6,Bird
|
| 109 |
+
107,/m/020bb7,"Bird vocalization, bird call, bird song"
|
| 110 |
+
108,/m/07pggtn,"Chirp, tweet"
|
| 111 |
+
109,/m/07sx8x_,Squawk
|
| 112 |
+
110,/m/0h0rv,"Pigeon, dove"
|
| 113 |
+
111,/m/07r_25d,Coo
|
| 114 |
+
112,/m/04s8yn,Crow
|
| 115 |
+
113,/m/07r5c2p,Caw
|
| 116 |
+
114,/m/09d5_,Owl
|
| 117 |
+
115,/m/07r_80w,Hoot
|
| 118 |
+
116,/m/05_wcq,"Bird flight, flapping wings"
|
| 119 |
+
117,/m/01z5f,"Canidae, dogs, wolves"
|
| 120 |
+
118,/m/06hps,"Rodents, rats, mice"
|
| 121 |
+
119,/m/04rmv,Mouse
|
| 122 |
+
120,/m/07r4gkf,Patter
|
| 123 |
+
121,/m/03vt0,Insect
|
| 124 |
+
122,/m/09xqv,Cricket
|
| 125 |
+
123,/m/09f96,Mosquito
|
| 126 |
+
124,/m/0h2mp,"Fly, housefly"
|
| 127 |
+
125,/m/07pjwq1,Buzz
|
| 128 |
+
126,/m/01h3n,"Bee, wasp, etc."
|
| 129 |
+
127,/m/09ld4,Frog
|
| 130 |
+
128,/m/07st88b,Croak
|
| 131 |
+
129,/m/078jl,Snake
|
| 132 |
+
130,/m/07qn4z3,Rattle
|
| 133 |
+
131,/m/032n05,Whale vocalization
|
| 134 |
+
132,/m/04rlf,Music
|
| 135 |
+
133,/m/04szw,Musical instrument
|
| 136 |
+
134,/m/0fx80y,Plucked string instrument
|
| 137 |
+
135,/m/0342h,Guitar
|
| 138 |
+
136,/m/02sgy,Electric guitar
|
| 139 |
+
137,/m/018vs,Bass guitar
|
| 140 |
+
138,/m/042v_gx,Acoustic guitar
|
| 141 |
+
139,/m/06w87,"Steel guitar, slide guitar"
|
| 142 |
+
140,/m/01glhc,Tapping (guitar technique)
|
| 143 |
+
141,/m/07s0s5r,Strum
|
| 144 |
+
142,/m/018j2,Banjo
|
| 145 |
+
143,/m/0jtg0,Sitar
|
| 146 |
+
144,/m/04rzd,Mandolin
|
| 147 |
+
145,/m/01bns_,Zither
|
| 148 |
+
146,/m/07xzm,Ukulele
|
| 149 |
+
147,/m/05148p4,Keyboard (musical)
|
| 150 |
+
148,/m/05r5c,Piano
|
| 151 |
+
149,/m/01s0ps,Electric piano
|
| 152 |
+
150,/m/013y1f,Organ
|
| 153 |
+
151,/m/03xq_f,Electronic organ
|
| 154 |
+
152,/m/03gvt,Hammond organ
|
| 155 |
+
153,/m/0l14qv,Synthesizer
|
| 156 |
+
154,/m/01v1d8,Sampler
|
| 157 |
+
155,/m/03q5t,Harpsichord
|
| 158 |
+
156,/m/0l14md,Percussion
|
| 159 |
+
157,/m/02hnl,Drum kit
|
| 160 |
+
158,/m/0cfdd,Drum machine
|
| 161 |
+
159,/m/026t6,Drum
|
| 162 |
+
160,/m/06rvn,Snare drum
|
| 163 |
+
161,/m/03t3fj,Rimshot
|
| 164 |
+
162,/m/02k_mr,Drum roll
|
| 165 |
+
163,/m/0bm02,Bass drum
|
| 166 |
+
164,/m/011k_j,Timpani
|
| 167 |
+
165,/m/01p970,Tabla
|
| 168 |
+
166,/m/01qbl,Cymbal
|
| 169 |
+
167,/m/03qtq,Hi-hat
|
| 170 |
+
168,/m/01sm1g,Wood block
|
| 171 |
+
169,/m/07brj,Tambourine
|
| 172 |
+
170,/m/05r5wn,Rattle (instrument)
|
| 173 |
+
171,/m/0xzly,Maraca
|
| 174 |
+
172,/m/0mbct,Gong
|
| 175 |
+
173,/m/016622,Tubular bells
|
| 176 |
+
174,/m/0j45pbj,Mallet percussion
|
| 177 |
+
175,/m/0dwsp,"Marimba, xylophone"
|
| 178 |
+
176,/m/0dwtp,Glockenspiel
|
| 179 |
+
177,/m/0dwt5,Vibraphone
|
| 180 |
+
178,/m/0l156b,Steelpan
|
| 181 |
+
179,/m/05pd6,Orchestra
|
| 182 |
+
180,/m/01kcd,Brass instrument
|
| 183 |
+
181,/m/0319l,French horn
|
| 184 |
+
182,/m/07gql,Trumpet
|
| 185 |
+
183,/m/07c6l,Trombone
|
| 186 |
+
184,/m/0l14_3,Bowed string instrument
|
| 187 |
+
185,/m/02qmj0d,String section
|
| 188 |
+
186,/m/07y_7,"Violin, fiddle"
|
| 189 |
+
187,/m/0d8_n,Pizzicato
|
| 190 |
+
188,/m/01xqw,Cello
|
| 191 |
+
189,/m/02fsn,Double bass
|
| 192 |
+
190,/m/085jw,"Wind instrument, woodwind instrument"
|
| 193 |
+
191,/m/0l14j_,Flute
|
| 194 |
+
192,/m/06ncr,Saxophone
|
| 195 |
+
193,/m/01wy6,Clarinet
|
| 196 |
+
194,/m/03m5k,Harp
|
| 197 |
+
195,/m/0395lw,Bell
|
| 198 |
+
196,/m/03w41f,Church bell
|
| 199 |
+
197,/m/027m70_,Jingle bell
|
| 200 |
+
198,/m/0gy1t2s,Bicycle bell
|
| 201 |
+
199,/m/07n_g,Tuning fork
|
| 202 |
+
200,/m/0f8s22,Chime
|
| 203 |
+
201,/m/026fgl,Wind chime
|
| 204 |
+
202,/m/0150b9,Change ringing (campanology)
|
| 205 |
+
203,/m/03qjg,Harmonica
|
| 206 |
+
204,/m/0mkg,Accordion
|
| 207 |
+
205,/m/0192l,Bagpipes
|
| 208 |
+
206,/m/02bxd,Didgeridoo
|
| 209 |
+
207,/m/0l14l2,Shofar
|
| 210 |
+
208,/m/07kc_,Theremin
|
| 211 |
+
209,/m/0l14t7,Singing bowl
|
| 212 |
+
210,/m/01hgjl,Scratching (performance technique)
|
| 213 |
+
211,/m/064t9,Pop music
|
| 214 |
+
212,/m/0glt670,Hip hop music
|
| 215 |
+
213,/m/02cz_7,Beatboxing
|
| 216 |
+
214,/m/06by7,Rock music
|
| 217 |
+
215,/m/03lty,Heavy metal
|
| 218 |
+
216,/m/05r6t,Punk rock
|
| 219 |
+
217,/m/0dls3,Grunge
|
| 220 |
+
218,/m/0dl5d,Progressive rock
|
| 221 |
+
219,/m/07sbbz2,Rock and roll
|
| 222 |
+
220,/m/05w3f,Psychedelic rock
|
| 223 |
+
221,/m/06j6l,Rhythm and blues
|
| 224 |
+
222,/m/0gywn,Soul music
|
| 225 |
+
223,/m/06cqb,Reggae
|
| 226 |
+
224,/m/01lyv,Country
|
| 227 |
+
225,/m/015y_n,Swing music
|
| 228 |
+
226,/m/0gg8l,Bluegrass
|
| 229 |
+
227,/m/02x8m,Funk
|
| 230 |
+
228,/m/02w4v,Folk music
|
| 231 |
+
229,/m/06j64v,Middle Eastern music
|
| 232 |
+
230,/m/03_d0,Jazz
|
| 233 |
+
231,/m/026z9,Disco
|
| 234 |
+
232,/m/0ggq0m,Classical music
|
| 235 |
+
233,/m/05lls,Opera
|
| 236 |
+
234,/m/02lkt,Electronic music
|
| 237 |
+
235,/m/03mb9,House music
|
| 238 |
+
236,/m/07gxw,Techno
|
| 239 |
+
237,/m/07s72n,Dubstep
|
| 240 |
+
238,/m/0283d,Drum and bass
|
| 241 |
+
239,/m/0m0jc,Electronica
|
| 242 |
+
240,/m/08cyft,Electronic dance music
|
| 243 |
+
241,/m/0fd3y,Ambient music
|
| 244 |
+
242,/m/07lnk,Trance music
|
| 245 |
+
243,/m/0g293,Music of Latin America
|
| 246 |
+
244,/m/0ln16,Salsa music
|
| 247 |
+
245,/m/0326g,Flamenco
|
| 248 |
+
246,/m/0155w,Blues
|
| 249 |
+
247,/m/05fw6t,Music for children
|
| 250 |
+
248,/m/02v2lh,New-age music
|
| 251 |
+
249,/m/0y4f8,Vocal music
|
| 252 |
+
250,/m/0z9c,A capella
|
| 253 |
+
251,/m/0164x2,Music of Africa
|
| 254 |
+
252,/m/0145m,Afrobeat
|
| 255 |
+
253,/m/02mscn,Christian music
|
| 256 |
+
254,/m/016cjb,Gospel music
|
| 257 |
+
255,/m/028sqc,Music of Asia
|
| 258 |
+
256,/m/015vgc,Carnatic music
|
| 259 |
+
257,/m/0dq0md,Music of Bollywood
|
| 260 |
+
258,/m/06rqw,Ska
|
| 261 |
+
259,/m/02p0sh1,Traditional music
|
| 262 |
+
260,/m/05rwpb,Independent music
|
| 263 |
+
261,/m/074ft,Song
|
| 264 |
+
262,/m/025td0t,Background music
|
| 265 |
+
263,/m/02cjck,Theme music
|
| 266 |
+
264,/m/03r5q_,Jingle (music)
|
| 267 |
+
265,/m/0l14gg,Soundtrack music
|
| 268 |
+
266,/m/07pkxdp,Lullaby
|
| 269 |
+
267,/m/01z7dr,Video game music
|
| 270 |
+
268,/m/0140xf,Christmas music
|
| 271 |
+
269,/m/0ggx5q,Dance music
|
| 272 |
+
270,/m/04wptg,Wedding music
|
| 273 |
+
271,/t/dd00031,Happy music
|
| 274 |
+
272,/t/dd00033,Sad music
|
| 275 |
+
273,/t/dd00034,Tender music
|
| 276 |
+
274,/t/dd00035,Exciting music
|
| 277 |
+
275,/t/dd00036,Angry music
|
| 278 |
+
276,/t/dd00037,Scary music
|
| 279 |
+
277,/m/03m9d0z,Wind
|
| 280 |
+
278,/m/09t49,Rustling leaves
|
| 281 |
+
279,/t/dd00092,Wind noise (microphone)
|
| 282 |
+
280,/m/0jb2l,Thunderstorm
|
| 283 |
+
281,/m/0ngt1,Thunder
|
| 284 |
+
282,/m/0838f,Water
|
| 285 |
+
283,/m/06mb1,Rain
|
| 286 |
+
284,/m/07r10fb,Raindrop
|
| 287 |
+
285,/t/dd00038,Rain on surface
|
| 288 |
+
286,/m/0j6m2,Stream
|
| 289 |
+
287,/m/0j2kx,Waterfall
|
| 290 |
+
288,/m/05kq4,Ocean
|
| 291 |
+
289,/m/034srq,"Waves, surf"
|
| 292 |
+
290,/m/06wzb,Steam
|
| 293 |
+
291,/m/07swgks,Gurgling
|
| 294 |
+
292,/m/02_41,Fire
|
| 295 |
+
293,/m/07pzfmf,Crackle
|
| 296 |
+
294,/m/07yv9,Vehicle
|
| 297 |
+
295,/m/019jd,"Boat, Water vehicle"
|
| 298 |
+
296,/m/0hsrw,"Sailboat, sailing ship"
|
| 299 |
+
297,/m/056ks2,"Rowboat, canoe, kayak"
|
| 300 |
+
298,/m/02rlv9,"Motorboat, speedboat"
|
| 301 |
+
299,/m/06q74,Ship
|
| 302 |
+
300,/m/012f08,Motor vehicle (road)
|
| 303 |
+
301,/m/0k4j,Car
|
| 304 |
+
302,/m/0912c9,"Vehicle horn, car horn, honking"
|
| 305 |
+
303,/m/07qv_d5,Toot
|
| 306 |
+
304,/m/02mfyn,Car alarm
|
| 307 |
+
305,/m/04gxbd,"Power windows, electric windows"
|
| 308 |
+
306,/m/07rknqz,Skidding
|
| 309 |
+
307,/m/0h9mv,Tire squeal
|
| 310 |
+
308,/t/dd00134,Car passing by
|
| 311 |
+
309,/m/0ltv,"Race car, auto racing"
|
| 312 |
+
310,/m/07r04,Truck
|
| 313 |
+
311,/m/0gvgw0,Air brake
|
| 314 |
+
312,/m/05x_td,"Air horn, truck horn"
|
| 315 |
+
313,/m/02rhddq,Reversing beeps
|
| 316 |
+
314,/m/03cl9h,"Ice cream truck, ice cream van"
|
| 317 |
+
315,/m/01bjv,Bus
|
| 318 |
+
316,/m/03j1ly,Emergency vehicle
|
| 319 |
+
317,/m/04qvtq,Police car (siren)
|
| 320 |
+
318,/m/012n7d,Ambulance (siren)
|
| 321 |
+
319,/m/012ndj,"Fire engine, fire truck (siren)"
|
| 322 |
+
320,/m/04_sv,Motorcycle
|
| 323 |
+
321,/m/0btp2,"Traffic noise, roadway noise"
|
| 324 |
+
322,/m/06d_3,Rail transport
|
| 325 |
+
323,/m/07jdr,Train
|
| 326 |
+
324,/m/04zmvq,Train whistle
|
| 327 |
+
325,/m/0284vy3,Train horn
|
| 328 |
+
326,/m/01g50p,"Railroad car, train wagon"
|
| 329 |
+
327,/t/dd00048,Train wheels squealing
|
| 330 |
+
328,/m/0195fx,"Subway, metro, underground"
|
| 331 |
+
329,/m/0k5j,Aircraft
|
| 332 |
+
330,/m/014yck,Aircraft engine
|
| 333 |
+
331,/m/04229,Jet engine
|
| 334 |
+
332,/m/02l6bg,"Propeller, airscrew"
|
| 335 |
+
333,/m/09ct_,Helicopter
|
| 336 |
+
334,/m/0cmf2,"Fixed-wing aircraft, airplane"
|
| 337 |
+
335,/m/0199g,Bicycle
|
| 338 |
+
336,/m/06_fw,Skateboard
|
| 339 |
+
337,/m/02mk9,Engine
|
| 340 |
+
338,/t/dd00065,Light engine (high frequency)
|
| 341 |
+
339,/m/08j51y,"Dental drill, dentist's drill"
|
| 342 |
+
340,/m/01yg9g,Lawn mower
|
| 343 |
+
341,/m/01j4z9,Chainsaw
|
| 344 |
+
342,/t/dd00066,Medium engine (mid frequency)
|
| 345 |
+
343,/t/dd00067,Heavy engine (low frequency)
|
| 346 |
+
344,/m/01h82_,Engine knocking
|
| 347 |
+
345,/t/dd00130,Engine starting
|
| 348 |
+
346,/m/07pb8fc,Idling
|
| 349 |
+
347,/m/07q2z82,"Accelerating, revving, vroom"
|
| 350 |
+
348,/m/02dgv,Door
|
| 351 |
+
349,/m/03wwcy,Doorbell
|
| 352 |
+
350,/m/07r67yg,Ding-dong
|
| 353 |
+
351,/m/02y_763,Sliding door
|
| 354 |
+
352,/m/07rjzl8,Slam
|
| 355 |
+
353,/m/07r4wb8,Knock
|
| 356 |
+
354,/m/07qcpgn,Tap
|
| 357 |
+
355,/m/07q6cd_,Squeak
|
| 358 |
+
356,/m/0642b4,Cupboard open or close
|
| 359 |
+
357,/m/0fqfqc,Drawer open or close
|
| 360 |
+
358,/m/04brg2,"Dishes, pots, and pans"
|
| 361 |
+
359,/m/023pjk,"Cutlery, silverware"
|
| 362 |
+
360,/m/07pn_8q,Chopping (food)
|
| 363 |
+
361,/m/0dxrf,Frying (food)
|
| 364 |
+
362,/m/0fx9l,Microwave oven
|
| 365 |
+
363,/m/02pjr4,Blender
|
| 366 |
+
364,/m/02jz0l,"Water tap, faucet"
|
| 367 |
+
365,/m/0130jx,Sink (filling or washing)
|
| 368 |
+
366,/m/03dnzn,Bathtub (filling or washing)
|
| 369 |
+
367,/m/03wvsk,Hair dryer
|
| 370 |
+
368,/m/01jt3m,Toilet flush
|
| 371 |
+
369,/m/012xff,Toothbrush
|
| 372 |
+
370,/m/04fgwm,Electric toothbrush
|
| 373 |
+
371,/m/0d31p,Vacuum cleaner
|
| 374 |
+
372,/m/01s0vc,Zipper (clothing)
|
| 375 |
+
373,/m/03v3yw,Keys jangling
|
| 376 |
+
374,/m/0242l,Coin (dropping)
|
| 377 |
+
375,/m/01lsmm,Scissors
|
| 378 |
+
376,/m/02g901,"Electric shaver, electric razor"
|
| 379 |
+
377,/m/05rj2,Shuffling cards
|
| 380 |
+
378,/m/0316dw,Typing
|
| 381 |
+
379,/m/0c2wf,Typewriter
|
| 382 |
+
380,/m/01m2v,Computer keyboard
|
| 383 |
+
381,/m/081rb,Writing
|
| 384 |
+
382,/m/07pp_mv,Alarm
|
| 385 |
+
383,/m/07cx4,Telephone
|
| 386 |
+
384,/m/07pp8cl,Telephone bell ringing
|
| 387 |
+
385,/m/01hnzm,Ringtone
|
| 388 |
+
386,/m/02c8p,"Telephone dialing, DTMF"
|
| 389 |
+
387,/m/015jpf,Dial tone
|
| 390 |
+
388,/m/01z47d,Busy signal
|
| 391 |
+
389,/m/046dlr,Alarm clock
|
| 392 |
+
390,/m/03kmc9,Siren
|
| 393 |
+
391,/m/0dgbq,Civil defense siren
|
| 394 |
+
392,/m/030rvx,Buzzer
|
| 395 |
+
393,/m/01y3hg,"Smoke detector, smoke alarm"
|
| 396 |
+
394,/m/0c3f7m,Fire alarm
|
| 397 |
+
395,/m/04fq5q,Foghorn
|
| 398 |
+
396,/m/0l156k,Whistle
|
| 399 |
+
397,/m/06hck5,Steam whistle
|
| 400 |
+
398,/t/dd00077,Mechanisms
|
| 401 |
+
399,/m/02bm9n,"Ratchet, pawl"
|
| 402 |
+
400,/m/01x3z,Clock
|
| 403 |
+
401,/m/07qjznt,Tick
|
| 404 |
+
402,/m/07qjznl,Tick-tock
|
| 405 |
+
403,/m/0l7xg,Gears
|
| 406 |
+
404,/m/05zc1,Pulleys
|
| 407 |
+
405,/m/0llzx,Sewing machine
|
| 408 |
+
406,/m/02x984l,Mechanical fan
|
| 409 |
+
407,/m/025wky1,Air conditioning
|
| 410 |
+
408,/m/024dl,Cash register
|
| 411 |
+
409,/m/01m4t,Printer
|
| 412 |
+
410,/m/0dv5r,Camera
|
| 413 |
+
411,/m/07bjf,Single-lens reflex camera
|
| 414 |
+
412,/m/07k1x,Tools
|
| 415 |
+
413,/m/03l9g,Hammer
|
| 416 |
+
414,/m/03p19w,Jackhammer
|
| 417 |
+
415,/m/01b82r,Sawing
|
| 418 |
+
416,/m/02p01q,Filing (rasp)
|
| 419 |
+
417,/m/023vsd,Sanding
|
| 420 |
+
418,/m/0_ksk,Power tool
|
| 421 |
+
419,/m/01d380,Drill
|
| 422 |
+
420,/m/014zdl,Explosion
|
| 423 |
+
421,/m/032s66,"Gunshot, gunfire"
|
| 424 |
+
422,/m/04zjc,Machine gun
|
| 425 |
+
423,/m/02z32qm,Fusillade
|
| 426 |
+
424,/m/0_1c,Artillery fire
|
| 427 |
+
425,/m/073cg4,Cap gun
|
| 428 |
+
426,/m/0g6b5,Fireworks
|
| 429 |
+
427,/g/122z_qxw,Firecracker
|
| 430 |
+
428,/m/07qsvvw,"Burst, pop"
|
| 431 |
+
429,/m/07pxg6y,Eruption
|
| 432 |
+
430,/m/07qqyl4,Boom
|
| 433 |
+
431,/m/083vt,Wood
|
| 434 |
+
432,/m/07pczhz,Chop
|
| 435 |
+
433,/m/07pl1bw,Splinter
|
| 436 |
+
434,/m/07qs1cx,Crack
|
| 437 |
+
435,/m/039jq,Glass
|
| 438 |
+
436,/m/07q7njn,"Chink, clink"
|
| 439 |
+
437,/m/07rn7sz,Shatter
|
| 440 |
+
438,/m/04k94,Liquid
|
| 441 |
+
439,/m/07rrlb6,"Splash, splatter"
|
| 442 |
+
440,/m/07p6mqd,Slosh
|
| 443 |
+
441,/m/07qlwh6,Squish
|
| 444 |
+
442,/m/07r5v4s,Drip
|
| 445 |
+
443,/m/07prgkl,Pour
|
| 446 |
+
444,/m/07pqc89,"Trickle, dribble"
|
| 447 |
+
445,/t/dd00088,Gush
|
| 448 |
+
446,/m/07p7b8y,Fill (with liquid)
|
| 449 |
+
447,/m/07qlf79,Spray
|
| 450 |
+
448,/m/07ptzwd,Pump (liquid)
|
| 451 |
+
449,/m/07ptfmf,Stir
|
| 452 |
+
450,/m/0dv3j,Boiling
|
| 453 |
+
451,/m/0790c,Sonar
|
| 454 |
+
452,/m/0dl83,Arrow
|
| 455 |
+
453,/m/07rqsjt,"Whoosh, swoosh, swish"
|
| 456 |
+
454,/m/07qnq_y,"Thump, thud"
|
| 457 |
+
455,/m/07rrh0c,Thunk
|
| 458 |
+
456,/m/0b_fwt,Electronic tuner
|
| 459 |
+
457,/m/02rr_,Effects unit
|
| 460 |
+
458,/m/07m2kt,Chorus effect
|
| 461 |
+
459,/m/018w8,Basketball bounce
|
| 462 |
+
460,/m/07pws3f,Bang
|
| 463 |
+
461,/m/07ryjzk,"Slap, smack"
|
| 464 |
+
462,/m/07rdhzs,"Whack, thwack"
|
| 465 |
+
463,/m/07pjjrj,"Smash, crash"
|
| 466 |
+
464,/m/07pc8lb,Breaking
|
| 467 |
+
465,/m/07pqn27,Bouncing
|
| 468 |
+
466,/m/07rbp7_,Whip
|
| 469 |
+
467,/m/07pyf11,Flap
|
| 470 |
+
468,/m/07qb_dv,Scratch
|
| 471 |
+
469,/m/07qv4k0,Scrape
|
| 472 |
+
470,/m/07pdjhy,Rub
|
| 473 |
+
471,/m/07s8j8t,Roll
|
| 474 |
+
472,/m/07plct2,Crushing
|
| 475 |
+
473,/t/dd00112,"Crumpling, crinkling"
|
| 476 |
+
474,/m/07qcx4z,Tearing
|
| 477 |
+
475,/m/02fs_r,"Beep, bleep"
|
| 478 |
+
476,/m/07qwdck,Ping
|
| 479 |
+
477,/m/07phxs1,Ding
|
| 480 |
+
478,/m/07rv4dm,Clang
|
| 481 |
+
479,/m/07s02z0,Squeal
|
| 482 |
+
480,/m/07qh7jl,Creak
|
| 483 |
+
481,/m/07qwyj0,Rustle
|
| 484 |
+
482,/m/07s34ls,Whir
|
| 485 |
+
483,/m/07qmpdm,Clatter
|
| 486 |
+
484,/m/07p9k1k,Sizzle
|
| 487 |
+
485,/m/07qc9xj,Clicking
|
| 488 |
+
486,/m/07rwm0c,Clickety-clack
|
| 489 |
+
487,/m/07phhsh,Rumble
|
| 490 |
+
488,/m/07qyrcz,Plop
|
| 491 |
+
489,/m/07qfgpx,"Jingle, tinkle"
|
| 492 |
+
490,/m/07rcgpl,Hum
|
| 493 |
+
491,/m/07p78v5,Zing
|
| 494 |
+
492,/t/dd00121,Boing
|
| 495 |
+
493,/m/07s12q4,Crunch
|
| 496 |
+
494,/m/028v0c,Silence
|
| 497 |
+
495,/m/01v_m0,Sine wave
|
| 498 |
+
496,/m/0b9m1,Harmonic
|
| 499 |
+
497,/m/0hdsk,Chirp tone
|
| 500 |
+
498,/m/0c1dj,Sound effect
|
| 501 |
+
499,/m/07pt_g0,Pulse
|
| 502 |
+
500,/t/dd00125,"Inside, small room"
|
| 503 |
+
501,/t/dd00126,"Inside, large room or hall"
|
| 504 |
+
502,/t/dd00127,"Inside, public space"
|
| 505 |
+
503,/t/dd00128,"Outside, urban or manmade"
|
| 506 |
+
504,/t/dd00129,"Outside, rural or natural"
|
| 507 |
+
505,/m/01b9nn,Reverberation
|
| 508 |
+
506,/m/01jnbd,Echo
|
| 509 |
+
507,/m/096m7z,Noise
|
| 510 |
+
508,/m/06_y0by,Environmental noise
|
| 511 |
+
509,/m/07rgkc5,Static
|
| 512 |
+
510,/m/06xkwv,Mains hum
|
| 513 |
+
511,/m/0g12c5,Distortion
|
| 514 |
+
512,/m/08p9q4,Sidetone
|
| 515 |
+
513,/m/07szfh9,Cacophony
|
| 516 |
+
514,/m/0chx_,White noise
|
| 517 |
+
515,/m/0cj0r,Pink noise
|
| 518 |
+
516,/m/07p_0gm,Throbbing
|
| 519 |
+
517,/m/01jwx6,Vibration
|
| 520 |
+
518,/m/07c52,Television
|
| 521 |
+
519,/m/06bz3,Radio
|
| 522 |
+
520,/m/07hvw1,Field recording
|
Audio_Multiple_v1/saved_model.pb
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:672af6e1e34fe15a42d45d70217fd39f97e10aef9b0effbf9b0bf7826fccd462
|
| 3 |
+
size 3176321
|
Audio_Multiple_v1/variables/variables.data-00000-of-00001
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:d6753f22f173b2a8b1ce78918eaae79bf0a41ca61f4cfe9a1b948c97ff094ddc
|
| 3 |
+
size 15077564
|
Audio_Multiple_v1/variables/variables.index
ADDED
|
Binary file (7.4 kB). View file
|
|
|
app.py
ADDED
|
@@ -0,0 +1,147 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import os
|
| 2 |
+
import tensorflow as tf
|
| 3 |
+
import tensorflow_hub as hub
|
| 4 |
+
import numpy as np
|
| 5 |
+
import csv
|
| 6 |
+
import requests
|
| 7 |
+
import json
|
| 8 |
+
import logging
|
| 9 |
+
import scipy
|
| 10 |
+
from scipy.io import wavfile
|
| 11 |
+
from pydub import AudioSegment
|
| 12 |
+
import io
|
| 13 |
+
from io import BytesIO
|
| 14 |
+
|
| 15 |
+
# Load the model
|
| 16 |
+
model = hub.load('Audio_Multiple_v1')
|
| 17 |
+
|
| 18 |
+
def class_names_from_csv(class_map_csv_text):
|
| 19 |
+
"""Returns list of class names corresponding to score vector."""
|
| 20 |
+
class_names = []
|
| 21 |
+
with tf.io.gfile.GFile(class_map_csv_text) as csvfile:
|
| 22 |
+
reader = csv.DictReader(csvfile)
|
| 23 |
+
for row in reader:
|
| 24 |
+
class_names.append(row['display_name'])
|
| 25 |
+
return class_names
|
| 26 |
+
|
| 27 |
+
class_map_path = model.class_map_path().numpy()
|
| 28 |
+
class_names = class_names_from_csv(class_map_path)
|
| 29 |
+
|
| 30 |
+
def ensure_sample_rate(original_sample_rate, waveform, desired_sample_rate=16000):
|
| 31 |
+
if original_sample_rate != desired_sample_rate: # Resample waveform if required
|
| 32 |
+
desired_length = int(round(float(len(waveform)) / original_sample_rate * desired_sample_rate))
|
| 33 |
+
waveform = np.array(scipy.signal.resample(waveform, desired_length), dtype=np.float32)
|
| 34 |
+
return desired_sample_rate, waveform
|
| 35 |
+
|
| 36 |
+
def convert_mp3_to_wav(mp3_data):
|
| 37 |
+
audio = AudioSegment.from_file(io.BytesIO(mp3_data), format="mp3")
|
| 38 |
+
wav_buffer = io.BytesIO()
|
| 39 |
+
audio.export(wav_buffer, format='wav')
|
| 40 |
+
wav_buffer.seek(0)
|
| 41 |
+
return wav_buffer.getvalue()
|
| 42 |
+
|
| 43 |
+
def process_audio_file(file_data, url):
|
| 44 |
+
try:
|
| 45 |
+
sample_rate, wav_data = wavfile.read(BytesIO(file_data))
|
| 46 |
+
|
| 47 |
+
if wav_data.ndim > 1:
|
| 48 |
+
wav_data = np.mean(wav_data, axis=1)
|
| 49 |
+
sample_rate, wav_data = ensure_sample_rate(sample_rate, wav_data)
|
| 50 |
+
|
| 51 |
+
waveform = wav_data / tf.int16.max
|
| 52 |
+
|
| 53 |
+
scores, embeddings, spectrogram = model(waveform)
|
| 54 |
+
|
| 55 |
+
scores_np = scores.numpy()
|
| 56 |
+
mean_scores = np.mean(scores, axis=0)
|
| 57 |
+
|
| 58 |
+
inferred_class = class_names[mean_scores.argmax()]
|
| 59 |
+
|
| 60 |
+
confidence_threshold = 0.60
|
| 61 |
+
confident_classes = set()
|
| 62 |
+
|
| 63 |
+
exclusion_list = ['Mechanisms','Domestic animals, pets', 'Animal', 'Silence', 'Alarm', 'Wind chime', 'Water', 'Livestock, farm animals, working animals', 'Wild animals', 'Bleat', 'Siren', 'Computer keyboard', 'Toot', 'Shatter', 'Bird','Caw', 'Independent music', 'Tender music', 'Ocean', 'House music', 'Middle Eastern music', 'Swing music', 'Soul music', 'Shofar', 'Motor vehicle (road)', 'White noise','Pink noise', 'Cacophony', 'Sidetone', 'Static', 'Outside, rural or natural', 'Outside, urban or manmade', 'Inside, public space', 'Inside, large room or hall', 'Inside, small room', 'Sound effect']
|
| 64 |
+
for frame_scores in scores_np:
|
| 65 |
+
for i, score in enumerate(frame_scores):
|
| 66 |
+
if score > confidence_threshold:
|
| 67 |
+
class_name = class_names[i]
|
| 68 |
+
|
| 69 |
+
if class_name =='Child speech, kid speaking':
|
| 70 |
+
class_name='Child speech'
|
| 71 |
+
elif class_name =='Vehicle horn, car horn, honking':
|
| 72 |
+
class_name='Vehicle horn'
|
| 73 |
+
elif class_name =='Railroad car, train wagon':
|
| 74 |
+
class_name='Train/wagon'
|
| 75 |
+
elif class_name=='Rail transport':
|
| 76 |
+
class_name='Train/wagon'
|
| 77 |
+
|
| 78 |
+
if class_name not in exclusion_list:
|
| 79 |
+
confident_classes.add(class_name)
|
| 80 |
+
|
| 81 |
+
confident_classes = sorted(confident_classes)
|
| 82 |
+
confident_classes_list = list(confident_classes)
|
| 83 |
+
|
| 84 |
+
answer_dict = {'url': url, 'answer': confident_classes_list}
|
| 85 |
+
return answer_dict
|
| 86 |
+
|
| 87 |
+
except Exception as e:
|
| 88 |
+
logging.error(f"Error processing {url}: {e}")
|
| 89 |
+
return None
|
| 90 |
+
|
| 91 |
+
def get_audio_data(url):
|
| 92 |
+
response = requests.get(url)
|
| 93 |
+
response.raise_for_status()
|
| 94 |
+
return response.content
|
| 95 |
+
|
| 96 |
+
# def send_results_to_api(data, result_url):
|
| 97 |
+
# headers = {"Content-Type": "application/json"}
|
| 98 |
+
# try:
|
| 99 |
+
# response = requests.post(result_url, json=data, headers=headers)
|
| 100 |
+
# response.raise_for_status() # Raise error for non-200 responses
|
| 101 |
+
# return response.json() # Return any JSON response from the API
|
| 102 |
+
# except requests.exceptions.HTTPError as http_err:
|
| 103 |
+
# logging.error(f"HTTP error occurred: {http_err}")
|
| 104 |
+
# return {"error": f"HTTP error occurred: {http_err}"}
|
| 105 |
+
# except requests.exceptions.RequestException as req_err:
|
| 106 |
+
# logging.error(f"Request error occurred: {req_err}")
|
| 107 |
+
# return {"error": f"Request error occurred: {req_err}"}
|
| 108 |
+
# except ValueError as val_err:
|
| 109 |
+
# logging.error(f"Error decoding JSON response: {val_err}")
|
| 110 |
+
# return {"error": f"Error decoding JSON response: {val_err}"}
|
| 111 |
+
|
| 112 |
+
def process_audio(params):
|
| 113 |
+
try:
|
| 114 |
+
params = json.loads(params)
|
| 115 |
+
except json.JSONDecodeError as e:
|
| 116 |
+
return {"error": f"Invalid JSON input: {e.msg} at line {e.lineno} column {e.colno}"}
|
| 117 |
+
|
| 118 |
+
audio_files = params.get("urls", [])
|
| 119 |
+
# api = params.get("api", "")
|
| 120 |
+
# job_id = params.get("job_id", "")
|
| 121 |
+
|
| 122 |
+
solutions = []
|
| 123 |
+
for audio_url in audio_files:
|
| 124 |
+
audio_data = get_audio_data(audio_url)
|
| 125 |
+
|
| 126 |
+
if audio_url.endswith(".mp3"):
|
| 127 |
+
wav_data = convert_mp3_to_wav(audio_data)
|
| 128 |
+
result = process_audio_file(wav_data, audio_url)
|
| 129 |
+
|
| 130 |
+
elif audio_url.endswith(".wav"):
|
| 131 |
+
result = process_audio_file(audio_data, audio_url)
|
| 132 |
+
|
| 133 |
+
if result:
|
| 134 |
+
solutions.append(result)
|
| 135 |
+
|
| 136 |
+
# result_url = f"{api}/{job_id}"
|
| 137 |
+
# send_results_to_api(solutions, result_url)
|
| 138 |
+
|
| 139 |
+
return json.dumps({"solutions": solutions})
|
| 140 |
+
|
| 141 |
+
import gradio as gr
|
| 142 |
+
|
| 143 |
+
inputt = gr.Textbox(label="Parameters (JSON format) Eg. {'urls':['file1.mp3','file2.wav']}")
|
| 144 |
+
outputs = gr.JSON()
|
| 145 |
+
|
| 146 |
+
application = gr.Interface(fn=process_audio, inputs=inputt, outputs=outputs, title="Audio Classification with API Integration")
|
| 147 |
+
application.launch()
|
requirements.txt
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
pydub
|
| 2 |
+
scipy
|
| 3 |
+
tensorflow-hub
|
| 4 |
+
tensorflow
|
| 5 |
+
soundfile
|