File size: 3,798 Bytes
53bf77d |
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 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 |
import streamlit as st
import base64
# Set the page configuration
st.set_page_config(
page_title="MetaMorph AI",
page_icon="π",
initial_sidebar_state="expanded",
layout="wide",
menu_items={
'Get help': 'https://www.linkedin.com/in/gaurav-verma-4696bb106/',
'About': "MetaMorph: Revolutionize your media with cutting-edge image and video augmentation using the META Sam-2 model for stunning visual transformations!"
}
)
# Function to load video as base64
def get_base64_video(video_path):
with open(video_path, 'rb') as video_file:
video_bytes = video_file.read()
return base64.b64encode(video_bytes).decode('utf-8')
# Video file path
video_path = 'images/background.mp4'
# Get the base64 video
video_base64 = get_base64_video(video_path)
# Add video as background
background_video = f"""
<style>
.stApp {{
background: transparent;
}}
.video-container {{
position: fixed;
top: 0;
left: 0;
min-width: 100%;
min-height: 100%;
z-index: -1;
overflow: hidden;
}}
.video-container video {{
position: absolute;
top: 50%;
left: 50%;
width: auto;
height: auto;
min-width: 100%;
min-height: 100%;
transform: translate(-50%, -50%);
opacity: 0.5;
}}
.content {{
position: relative;
z-index: 1;
padding-top: 50px;
}}
</style>
<div class="video-container">
<video autoplay loop muted>
<source src="data:video/mp4;base64,{video_base64}" type="video/mp4">
</video>
</div>
"""
st.markdown(background_video, unsafe_allow_html=True)
# Content goes here
with st.container():
# Title
html_code = """
<div class="content">
<div class="title-container">
<h1 class="neon-text">
MetaMorphix AI π¦βπ₯
</h1>
</div>
</div>
<style>
@keyframes rainbow-text-animation {
0% { color: white; }
16.67% { color: grey; }
33.33% { color: grey; }
50% { color: black; }
66.67% { color: grey; }
83.33% { color: white; }
100% { color: black; }
}
.title-container {
text-align: center;
margin: 1em 0;
padding-bottom: 10px;
border-bottom: 4px solid #fcdee9;
}
.neon-text {
font-family: Trebuchet MS , sans-serif;
font-size: 4em;
margin: 0;
animation: rainbow-text-animation 5s infinite linear;
text-shadow: 0 0 5px rgba(0, 255, 0, 0.8),
0 0 10px rgba(0, 255, 255, 0.7),
0 0 20px rgba(0, 255, 255, 0.6),
0 0 40px rgba(0, 0, 0, 0.6),
0 0 80px rgba(0, 0, 0, 0.6),
0 0 90px rgba(0, 0, 0, 0.6),
0 0 100px rgba(0, 0, 255, 0.6),
0 0 150px rgba(0, 0, 255, 0.6);
}
</style>
"""
st.markdown(html_code, unsafe_allow_html=True)
# Additional content
# Functionality for pages
from home import home_page
from image_augmentation import image_augmentation_page
from video_augmentation import image_annoter
from use_cases import use_case
def main():
st.sidebar.title("Navigation")
page = st.sidebar.selectbox("Go to", ("Home","Use Cases", "Image Augmentation", "Video Augmentation"))
if page == "Home":
home_page()
elif page == "Use Cases":
use_case()
elif page == "Image Augmentation":
image_augmentation_page()
elif page == "Video Augmentation":
image_annoter()
if __name__ == "__main__":
main()
|