asigalov61 commited on
Commit
877f868
1 Parent(s): 40c3c42

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -3
app.py CHANGED
@@ -145,10 +145,12 @@ def ClassifyMIDI(input_midi):
145
 
146
  classification_summary_string = '=' * 70
147
  classification_summary_string += '\n'
 
 
148
 
149
  print('Composition has', notes_counter, 'notes')
150
  print('=' * 70)
151
- print('Composition was split into' , len(input_data), 'samples', 'of 340 notes each with', 340 - chunk_size // classification_sampling_resolution // 3, 'notes overlap')
152
  print('=' * 70)
153
  print('Number of notes in all composition samples:', len(input_data) * 340)
154
  print('=' * 70)
@@ -156,7 +158,7 @@ def ClassifyMIDI(input_midi):
156
  classification_summary_string += 'Composition has ' + str(notes_counter) + ' notes\n'
157
  classification_summary_string += '=' * 70
158
  classification_summary_string += '\n'
159
- classification_summary_string += 'Composition was split into ' + 'samples of 340 notes each with ' + str(340 - chunk_size // classification_sampling_resolution // 3) + ' notes overlap\n'
160
  classification_summary_string += 'Number of notes in all composition samples: ' + str(len(input_data) * 340) + '\n'
161
  classification_summary_string += '=' * 70
162
  classification_summary_string += '\n'
@@ -265,7 +267,7 @@ def ClassifyMIDI(input_midi):
265
  song_artist = song_artist_tokens_to_song_artist(result_toks)
266
  gidx = genre_labels_fnames.index(song_artist)
267
  genre = genre_labels[gidx][1]
268
- print('Notes', i*170, '-', (i*170)+340, '===', genre, '---', song_artist)
269
 
270
  artist_label = str_strip_artist(song_artist.split(' --- ')[1])
271
 
 
145
 
146
  classification_summary_string = '=' * 70
147
  classification_summary_string += '\n'
148
+
149
+ samples_overlap = 340 - chunk_size // classification_sampling_resolution // 3
150
 
151
  print('Composition has', notes_counter, 'notes')
152
  print('=' * 70)
153
+ print('Composition was split into' , len(input_data), 'samples', 'of 340 notes each with', samples_overlap, 'notes overlap')
154
  print('=' * 70)
155
  print('Number of notes in all composition samples:', len(input_data) * 340)
156
  print('=' * 70)
 
158
  classification_summary_string += 'Composition has ' + str(notes_counter) + ' notes\n'
159
  classification_summary_string += '=' * 70
160
  classification_summary_string += '\n'
161
+ classification_summary_string += 'Composition was split into ' + 'samples of 340 notes each with ' + str(samples_overlap) + ' notes overlap\n'
162
  classification_summary_string += 'Number of notes in all composition samples: ' + str(len(input_data) * 340) + '\n'
163
  classification_summary_string += '=' * 70
164
  classification_summary_string += '\n'
 
267
  song_artist = song_artist_tokens_to_song_artist(result_toks)
268
  gidx = genre_labels_fnames.index(song_artist)
269
  genre = genre_labels[gidx][1]
270
+ classification_summary_string += 'Notes ' + str(i*samples_overlap) + '-' + str((i*samples_overlap)+340) + ' === ' + str(genre) + ' --- ' + str(song_artist))
271
 
272
  artist_label = str_strip_artist(song_artist.split(' --- ')[1])
273