Spaces:
Sleeping
Sleeping
File size: 4,044 Bytes
542cdeb 803cfee 8212ff9 1fed098 8212ff9 1fed098 8212ff9 1fed098 c5e751d 8212ff9 c5e751d 8212ff9 c5e751d d073e7b bdaaf5b d073e7b bdaaf5b 1fed098 8212ff9 1fed098 e89b904 c5e751d e89b904 9456bc7 d35a4b9 5e2ec54 9456bc7 d35a4b9 9456bc7 5e2ec54 9456bc7 5e2ec54 9456bc7 2ac1c18 c5e751d 542cdeb c5e751d 7c1dbf5 bd33d93 c5e751d 7c1dbf5 bd33d93 c5e751d bd33d93 c8b6ba4 c5e751d bd33d93 c5e751d 5e2ec54 d073e7b 5e2ec54 d073e7b bdaaf5b |
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 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 |
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);
}}
.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);
}}
.link-icon {{
display: flex;
align-items: center;
margin-bottom: 10px;
}}
.link-icon img {{
margin-right: 10px;
}}
.footer {{
text-align: center;
padding: 20px;
background: rgba(0, 0, 0, 0.7);
color: white;
border-top: 1px solid #ddd;
margin-top: 30px;
}}
</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.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'))
prompt_text = st.text_input('Enter a prompt for the audio processing')
start_point = st.slider('Choose a starting point for the audio (seconds)', 0.0, 60.0, 0.0)
output_length = st.slider('Choose the length of the output audio (seconds)', 1.0, 60.0, 10.0)
st.markdown('**Note:** Longer audio takes more time to generate.')
if uploaded_file is not None and prompt_text:
st.audio(uploaded_file, format="audio/mpeg")
# Dummy processing function to demonstrate functionality
def process_audio(file, model, prompt, start, length):
# 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, prompt_text, start_point, output_length)
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)
# Links Section
st.markdown("## Useful Links")
links = [
{"url": "https://example.com", "type": "Regular Website", "text": "This is a regular website"},
{"url": "https://github.com/example", "type": "GitHub", "text": "This is a GitHub repository"},
{"url": "https://colab.research.google.com", "type": "Google Colab", "text": "This is a Google Colab link"}
]
# Dictionary to hold logo URLs
logo_urls = {
"GitHub": "https://github.githubassets.com/images/modules/logos_page/GitHub-Mark.png",
"Google Colab": "https://colab.research.google.com/img/colab_favicon_256px.png"
}
# Render links with icons
for link in links:
if link["type"] in logo_urls:
st.markdown(f"""
<div class="link-icon">
<img src="{logo_urls[link['type']]}" alt="{link['type']} logo" width="24">
<a href="{link['url']}" target="_blank">{link['text']}</a> - *{link['type']}*
</div>
""", unsafe_allow_html=True)
else:
st.markdown(f"[{link['text']}]({link['url']}) - *{link['type']}*")
# Footer
st.markdown("""
<div class="footer">
Made with ❤️ using Streamlit
</div>
""", unsafe_allow_html=True)
|