Hello everyone! This week we were trying to make our data meaningful with my colleagues Ebru Yardım and Osman Fatih Çakır. We used some libraries of python to do this.

First, we download and find the path of data and define it. Also, define two more paths for folders we will create for train and test data, and to do that we use “os” library.

After created a directory for train data using os, we needed to translate our data to mel spectogram, and to do that, we define a new function. While defining it, we decide how many data, the function will generate and the duration of every data, then a function will generate mel spectograms and save it to the path we define before.

Example of an audio spectogram

After we created the spectograms of data, they have to be splitting into two as train and test data. to do that we define another function which we can change the percentage of test data. In this function first, we reach into data and using “random” library, it chooses data from every genre with a percentage which we decided and move these data to the test folder and delete it from the train folder.

Finally, we define a function to generate more augmented data to see if the model accuracy can be increased. With this function, we can choose the size, color mode, and batch size.

--

--