kurianbenoy commited on
Commit
ac1ef50
1 Parent(s): c8699b4

Update application code

Browse files
Files changed (2) hide show
  1. app.py +6 -1
  2. article.md +32 -0
app.py CHANGED
@@ -13,13 +13,18 @@ model = load_learner(
13
  EXAMPLES_PATH = Path("./examples")
14
  labels = model.dls.vocab
15
 
 
 
 
16
  interface_options = {
17
  "title": "Music Genre Classification",
18
  "description": "A simple baseline model for classifying music genres with fast.ai on [Kaggle competition data](https://www.kaggle.com/competitions/kaggle-pog-series-s01e02/data)",
19
- "examples": [f"{EXAMPLES_PATH}/{f.name}" for f in EXAMPLES_PATH.iterdir()],
20
  "interpretation": "default",
21
  "layout": "horizontal",
22
  "theme": "default",
 
 
23
  }
24
 
25
  N_FFT = 2048
 
13
  EXAMPLES_PATH = Path("./examples")
14
  labels = model.dls.vocab
15
 
16
+ with open("article.md") as f:
17
+ article = f.read()
18
+
19
  interface_options = {
20
  "title": "Music Genre Classification",
21
  "description": "A simple baseline model for classifying music genres with fast.ai on [Kaggle competition data](https://www.kaggle.com/competitions/kaggle-pog-series-s01e02/data)",
22
+ "aricle": article,
23
  "interpretation": "default",
24
  "layout": "horizontal",
25
  "theme": "default",
26
+ # Audio from validation file
27
+ "examples": ["000003.ogg", "000032.ogg", "000038.ogg", "000050.ogg", "000103.ogg"],
28
  }
29
 
30
  N_FFT = 2048
article.md ADDED
@@ -0,0 +1,32 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ During first lesson of Practical Deep Learning for Coders course, Jeremy had mentioned how using simple computer vision model by being a bit creative we can build a state of the art model to classify audio with same image classification model. I was curious on how I can train an music classifier, as I have never worked on audio data before.
2
+
3
+
4
+ [You can find how I trained this music genre classification using fast.ai](https://kurianbenoy.com/ml-blog/fastai/fastbook/2022/05/01/AudioCNNDemo.html).
5
+
6
+ ## Dataset
7
+
8
+ 1. [The competition data](https://www.kaggle.com/competitions/kaggle-pog-series-s01e02/data)
9
+ 2. [Image data generated from converting audio to melspectograms in form of images](https://www.kaggle.com/datasets/dienhoa/music-genre-spectrogram-pogchamps)
10
+
11
+
12
+ ## Training
13
+
14
+ Fast.ai was used to train this classifier with a ResNet50 vision learner for 10 epochs.
15
+
16
+ epoch train_loss valid_loss error_rate time
17
+ 0 2.869285 2.171426 0.616428 01:43
18
+ epoch train_loss valid_loss error_rate time
19
+ 0 2.312176 1.843815 0.558654 02:07
20
+ 1 2.102361 1.719162 0.539061 02:08
21
+ 2 1.867139 1.623988 0.527003 02:08
22
+ 3 1.710557 1.527913 0.507661 02:07
23
+ 4 1.629478 1.456836 0.479779 02:05
24
+ 5 1.519305 1.433036 0.474253 02:05
25
+ 6 1.457465 1.379757 0.464456 02:05
26
+ 7 1.396283 1.369344 0.457925 02:05
27
+ 8 1.359388 1.367973 0.453655 02:05
28
+ 9 1.364363 1.368887 0.456167 02:04
29
+
30
+ ## Examples
31
+
32
+ The example images provided in the demo are from the validation data from Kaggle competition data, which was not used during training.