roszcz commited on
Commit
fabcff4
1 Parent(s): 98a2e06

review pijama dataset :rocket:

Browse files
Files changed (2) hide show
  1. app.py +24 -0
  2. requirements.txt +2 -0
app.py ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import streamlit as st
2
+ import streamlit_pianoroll
3
+ from fortepyan import MidiPiece
4
+
5
+ from datasets import load_dataset
6
+
7
+
8
+ def main():
9
+ dataset = load_dataset("epr-labs/pijamia-midi-v1", split="train")
10
+
11
+ record_idx = st.number_input(
12
+ label="record id",
13
+ min_value=0,
14
+ max_value=len(dataset) - 1,
15
+ value=0,
16
+ )
17
+
18
+ record = dataset[record_idx]
19
+ piece = MidiPiece.from_huggingface(record)
20
+ streamlit_pianoroll.from_fortepyan(piece)
21
+
22
+
23
+ if __name__ == "__main__":
24
+ main()
requirements.txt ADDED
@@ -0,0 +1,2 @@
 
 
 
1
+ streamlit-pianoroll==0.7.1
2
+ fortepyan==0.4.2