SLAYEROFALL3050 commited on
Commit
e46e7ab
·
1 Parent(s): fc48bb4

model prep

Browse files
Files changed (2) hide show
  1. app.py +4 -64
  2. tag_map.json +0 -72
app.py CHANGED
@@ -1,74 +1,14 @@
1
  import streamlit as st
2
- from streamlit_tags import st_tags
3
- import json
4
-
5
-
6
- f = open('tag_map.json') # OPEN JSON FILE
7
-
8
- data = json.load(f) # LOAD DATA
9
-
10
- f.close() # CLOSE FILE
11
 
12
  # --------------------------- VARIABLES
13
 
14
- # SPLIT DATA
15
- GENRE_TAGS = data['genre']
16
- MOOD_TAGS = data['mood']
17
- INSTRUMENT_TAGS = data['instrument']
18
-
19
- MAX_TAGS = 3
20
 
21
  # --------------------------- TITLE
22
- st.title("FIRE COML FALL 2022 Audio Generation Model")
23
 
24
  # --------------------------- MAIN
25
- # SELECT TYPE OF GENERATION
26
- option = st.selectbox("Select Generation type:", ("Sentence Based", "Tag Based"))
27
 
28
  # SENTENCE BASED
29
- if option == "Sentence Based":
30
- input_sentence = st.text_input("Enter a description for a song you want to hear:")
31
-
32
- # SUBMIT DESCRIPTION
33
- if st.button("Submit Description"):
34
- if input_sentence is not None and len(input_sentence) > 0:
35
- st.write("Here is the generated audio: ")
36
- st.write(input_sentence)
37
- else:
38
- st.write("Invalid Description")
39
-
40
- # TAG BASED
41
- else:
42
- st.write("Enter Genre(s), Mood/Theme(s), and Instrument(s)")
43
-
44
- instructions = "Press enter to add more"
45
-
46
- genre = st_tags(
47
- label = 'Enter Genre(s):',
48
- text = instructions,
49
- suggestions = GENRE_TAGS,
50
- maxtags = MAX_TAGS,
51
- key = '1'
52
- )
53
-
54
- mood = st_tags(
55
- label = 'Enter Mood/Theme(s):',
56
- text = instructions,
57
- suggestions = MOOD_TAGS,
58
- maxtags = MAX_TAGS,
59
- key = '2'
60
- )
61
-
62
- instrument = st_tags(
63
- label = 'Enter Instrument(s):',
64
- text = instructions,
65
- suggestions = INSTRUMENT_TAGS,
66
- maxtags = MAX_TAGS,
67
- key = '3'
68
- )
69
-
70
- # SUBMIT TAGS
71
- if st.button("Submit Tags"):
72
- st.write("Tags are:")
73
- input = genre + mood + instrument
74
- st.write(str(input))
 
1
  import streamlit as st
 
 
 
 
 
 
 
 
 
2
 
3
  # --------------------------- VARIABLES
4
 
 
 
 
 
 
 
5
 
6
  # --------------------------- TITLE
7
+ st.title("Audio Generation Using MuseGan")
8
 
9
  # --------------------------- MAIN
10
+ st.write("Click the Button to Generate Audio")
 
11
 
12
  # SENTENCE BASED
13
+ if st.button("GENERATE"):
14
+ st.write("Here is the Generated Audio:")
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
tag_map.json DELETED
@@ -1,72 +0,0 @@
1
- {
2
- "genre": [
3
- "punkrock",
4
- "electronica",
5
- "soundtrack",
6
- "electronic",
7
- "electronic",
8
- "poprock",
9
- "rockandroll",
10
- "ambient",
11
- "electropop",
12
- "house",
13
- "r&b",
14
- "dance",
15
- "folkpop",
16
- "lounge",
17
- "trance",
18
- "progressive",
19
- "classical",
20
- "electronica",
21
- "rap",
22
- "techno",
23
- "alternative",
24
- "instrumentalhiphop"
25
- ],
26
- "mood": [
27
- "dreamy",
28
- "emotional",
29
- "film",
30
- "energetic",
31
- "inspirational",
32
- "love",
33
- "melancholic",
34
- "relaxed",
35
- "sad",
36
- "romantic",
37
- "hopeful",
38
- "motivational",
39
- "happy",
40
- "sports",
41
- "children",
42
- "trailer",
43
- "joyful",
44
- "christmas",
45
- "epic",
46
- "dark",
47
- "scifi",
48
- "festive"
49
- ],
50
- "instrument": [
51
- "synthesizer",
52
- "drums",
53
- "strings",
54
- "guitar",
55
- "piano",
56
- "saxophone",
57
- "beat",
58
- "violin",
59
- "bell",
60
- "percussion",
61
- "choir",
62
- "pad",
63
- "flute",
64
- "electricguitar",
65
- "keyboard",
66
- "horn",
67
- "bongo",
68
- "accordion",
69
- "bass",
70
- "clavier"
71
- ]
72
- }