Pattr commited on
Commit
b97eb76
·
1 Parent(s): ca309ed

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -3
app.py CHANGED
@@ -2,6 +2,7 @@ import gradio as gr
2
  import numpy
3
  import pathlib
4
  import tensorflow as tf
 
5
  from music21 import stream,chord,duration,clef
6
 
7
  myModel = tf.keras.models.load_model('my_model.h5')
@@ -41,7 +42,10 @@ def PredictionToNotation(predict):
41
  drum_part.append(n)
42
  drum_part.clef = clef.PercussionClef()
43
  score.insert(0, drum_part)
44
- return score.show('lily')
 
 
 
45
 
46
  def PredictionToChord(prediction):
47
  noteToChord = []
@@ -51,8 +55,7 @@ def PredictionToChord(prediction):
51
  noteToChord.append(drumComponent[component])
52
  return noteToChord
53
 
54
-
55
-
56
 
57
  def transcribe(AudioFile):
58
 
 
2
  import numpy
3
  import pathlib
4
  import tensorflow as tf
5
+ from PIL import Image
6
  from music21 import stream,chord,duration,clef
7
 
8
  myModel = tf.keras.models.load_model('my_model.h5')
 
42
  drum_part.append(n)
43
  drum_part.clef = clef.PercussionClef()
44
  score.insert(0, drum_part)
45
+ score.write('lily.png',"notation")
46
+ img = Image.open('notation.png')
47
+ return img
48
+
49
 
50
  def PredictionToChord(prediction):
51
  noteToChord = []
 
55
  noteToChord.append(drumComponent[component])
56
  return noteToChord
57
 
58
+
 
59
 
60
  def transcribe(AudioFile):
61