File size: 2,633 Bytes
542cdeb
803cfee
1fed098
 
 
 
 
 
 
 
 
 
 
 
c5e751d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1fed098
 
 
 
 
e89b904
 
c5e751d
 
 
 
 
 
 
 
e89b904
9456bc7
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2ac1c18
c5e751d
542cdeb
c5e751d
7c1dbf5
c5e751d
 
7c1dbf5
c5e751d
 
7c1dbf5
c5e751d
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
import streamlit as st

page_bg_img = f"""
<style>
[data-testid="stAppViewContainer"] > .main {{
background-image: url("https://i.postimg.cc/4xgNnkfX/Untitled-design.png");
background-size: cover;
background-position: center center;
background-repeat: no-repeat;
background-attachment: local;
}}
[data-testid="stHeader"] {{
background: rgba(0,0,0,0);
}}
[data-testid="stSidebar"] > div:first-child {{
background-color: rgba(255, 255, 255, 0.5);
border-radius: 10px;
padding: 10px;
}}
[data-testid="stSidebar"] > div {{
background-color: rgba(255, 255, 255, 0.8);
border-radius: 10px;
}}
.stTitle {{
color: #ffffff;
text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}}
.stSubheader {{
color: #ffffff;
text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}}
</style>
"""

st.markdown(page_bg_img, unsafe_allow_html=True)

audioldm_exmples_input_paths = []
audioldm_exmples_original_paths = []
exmples_prompts = ["wiwi", "pipi", "wifi"]

st.title('Drums Generation in Different Models')
st.sidebar.title("Settings")

# Sidebar elements
st.sidebar.selectbox('How would you like to be contacted?', ('Email', 'Home phone', 'Mobile phone'))
st.sidebar.slider('Select a range of values', 0.0, 100.0, (25.0, 75.0))

st.subheader('Upload your audio file to process with AudioLDM2 or StableAudio')

uploaded_file = st.file_uploader("Choose an audio file", type=["wav", "mp3", "ogg"])
model_choice = st.selectbox('Choose a model for processing', ('AudioLDM2', 'StableAudio'))

if uploaded_file is not None:
    st.audio(uploaded_file, format="audio/mpeg")

    # Dummy processing function to demonstrate functionality
    def process_audio(file, model):
        # Replace this with actual audio processing code
        processed_audio_path = "processed_audio.wav"
        return processed_audio_path

    if st.button('Process Audio'):
        processed_audio = process_audio(uploaded_file, model_choice)
        st.audio(processed_audio, format="audio/mpeg", loop=False)
        st.download_button(label="Download Processed Audio", data=processed_audio, file_name="processed_audio.wav", mime="audio/wav")

st.markdown("---")

st.header("Examples")

example_columns = st.columns(4)
example_titles = ["Original Audio", "Separated Audio", "AudioLDM2", "StableAudio"]

for col, title in zip(example_columns, example_titles):
    col.subheader(title)

for p in exmples_prompts:
    with st.container():
        st.write(f"Prompt: {p}")
        audio_columns = st.columns(4)
        for col in audio_columns:
            col.audio("goodres.wav", format="audio/mpeg", loop=False)
        st.markdown("<hr style='border: 1px solid #ddd;'>", unsafe_allow_html=True)