Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -142,56 +142,6 @@ st.markdown("""
|
|
| 142 |
|
| 143 |
|
| 144 |
# Bike Collections
|
| 145 |
-
bike_collections = {
|
| 146 |
-
"Celestial Collection π": {
|
| 147 |
-
"Eclipse Vaulter": {
|
| 148 |
-
"prompt": """Cinematic shot of a sleek black mountain bike silhouetted against a total solar eclipse.
|
| 149 |
-
The corona creates an ethereal halo effect, with lens flares accentuating key points of the frame.
|
| 150 |
-
Dynamic composition shows the bike mid-leap, with stardust particles trailing behind.
|
| 151 |
-
Camera angle: Low angle, wide shot
|
| 152 |
-
Lighting: Dramatic rim lighting from eclipse
|
| 153 |
-
Color palette: Deep purples, cosmic blues, corona gold""",
|
| 154 |
-
"emoji": "π"
|
| 155 |
-
},
|
| 156 |
-
"Starlight Leaper": {
|
| 157 |
-
"prompt": """A black bike performing an epic leap under a vast Milky Way galaxy.
|
| 158 |
-
Shimmering stars blanket the sky while the bike's wheels leave a trail of stardust.
|
| 159 |
-
Camera angle: Wide-angle upward shot
|
| 160 |
-
Lighting: Natural starlight with subtle rim lighting
|
| 161 |
-
Color palette: Deep blues, silver highlights, cosmic purples""",
|
| 162 |
-
"emoji": "β¨"
|
| 163 |
-
},
|
| 164 |
-
"Moonlit Hopper": {
|
| 165 |
-
"prompt": """A sleek black bike mid-hop over a moonlit meadow,
|
| 166 |
-
the full moon illuminating the misty surroundings. Fireflies dance around the bike,
|
| 167 |
-
and soft shadows create a serene yet dynamic atmosphere.
|
| 168 |
-
Camera angle: Side profile with slight low angle
|
| 169 |
-
Lighting: Soft moonlight with atmospheric fog
|
| 170 |
-
Color palette: Silver blues, soft whites, deep shadows""",
|
| 171 |
-
"emoji": "π"
|
| 172 |
-
}
|
| 173 |
-
},
|
| 174 |
-
"Nature-Inspired Collection π²": {
|
| 175 |
-
"Shadow Grasshopper": {
|
| 176 |
-
"prompt": """A black bike jumping between forest paths,
|
| 177 |
-
with dappled sunlight streaming through the canopy. Shadows dance on the bike's frame
|
| 178 |
-
as it soars above mossy logs.
|
| 179 |
-
Camera angle: Through-the-trees tracking shot
|
| 180 |
-
Lighting: Natural forest lighting with sun rays
|
| 181 |
-
Color palette: Forest greens, golden sunlight, deep shadows""",
|
| 182 |
-
"emoji": "π¦"
|
| 183 |
-
},
|
| 184 |
-
"Onyx Leapfrog": {
|
| 185 |
-
"prompt": """A bike with obsidian-black finish jumping over a sparkling creek,
|
| 186 |
-
the reflection on the water broken into ripples by the leap. The surrounding forest
|
| 187 |
-
is vibrant with greens and browns.
|
| 188 |
-
Camera angle: Low angle from water level
|
| 189 |
-
Lighting: Golden hour side lighting
|
| 190 |
-
Color palette: Deep blacks, water blues, forest greens""",
|
| 191 |
-
"emoji": "πΈ"
|
| 192 |
-
}
|
| 193 |
-
}
|
| 194 |
-
}
|
| 195 |
|
| 196 |
|
| 197 |
# Helper Functions
|
|
@@ -603,25 +553,6 @@ def create_media_gallery():
|
|
| 603 |
"Describe what's happening in this video.")
|
| 604 |
st.markdown(analysis)
|
| 605 |
|
| 606 |
-
with tabs[3]:
|
| 607 |
-
for collection_name, bikes in bike_collections.items():
|
| 608 |
-
st.subheader(collection_name)
|
| 609 |
-
cols = st.columns(len(bikes))
|
| 610 |
-
|
| 611 |
-
for idx, (bike_name, details) in enumerate(bikes.items()):
|
| 612 |
-
with cols[idx]:
|
| 613 |
-
st.markdown(f"""
|
| 614 |
-
<div class='bike-card'>
|
| 615 |
-
<h3>{details['emoji']} {bike_name}</h3>
|
| 616 |
-
<p>{details['prompt']}</p>
|
| 617 |
-
</div>
|
| 618 |
-
""", unsafe_allow_html=True)
|
| 619 |
-
|
| 620 |
-
if st.button(f"Generate {bike_name} Scene"):
|
| 621 |
-
prompt = details['prompt']
|
| 622 |
-
# Here you could integrate with image generation API
|
| 623 |
-
st.write(f"Generated scene description for {bike_name}:")
|
| 624 |
-
st.write(prompt)
|
| 625 |
|
| 626 |
def display_file_manager():
|
| 627 |
"""Display file management sidebar with guaranteed unique button keys."""
|
|
@@ -1010,26 +941,7 @@ def create_media_gallery():
|
|
| 1010 |
analysis = process_video_with_gpt(video_file,
|
| 1011 |
"Describe what's happening in this video.")
|
| 1012 |
st.markdown(analysis)
|
| 1013 |
-
|
| 1014 |
-
with tabs[3]:
|
| 1015 |
-
for collection_name, bikes in bike_collections.items():
|
| 1016 |
-
st.subheader(collection_name)
|
| 1017 |
-
cols = st.columns(len(bikes))
|
| 1018 |
-
|
| 1019 |
-
for idx, (bike_name, details) in enumerate(bikes.items()):
|
| 1020 |
-
with cols[idx]:
|
| 1021 |
-
st.markdown(f"""
|
| 1022 |
-
<div class='bike-card'>
|
| 1023 |
-
<h3>{details['emoji']} {bike_name}</h3>
|
| 1024 |
-
<p>{details['prompt']}</p>
|
| 1025 |
-
</div>
|
| 1026 |
-
""", unsafe_allow_html=True)
|
| 1027 |
-
|
| 1028 |
-
if st.button(f"Generate {bike_name} Scene"):
|
| 1029 |
-
prompt = details['prompt']
|
| 1030 |
-
# Here you could integrate with image generation API
|
| 1031 |
-
st.write(f"Generated scene description for {bike_name}:")
|
| 1032 |
-
st.write(prompt)
|
| 1033 |
|
| 1034 |
def get_media_html(media_path, media_type="video", width="100%"):
|
| 1035 |
"""Generate HTML for media player."""
|
|
|
|
| 142 |
|
| 143 |
|
| 144 |
# Bike Collections
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 145 |
|
| 146 |
|
| 147 |
# Helper Functions
|
|
|
|
| 553 |
"Describe what's happening in this video.")
|
| 554 |
st.markdown(analysis)
|
| 555 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 556 |
|
| 557 |
def display_file_manager():
|
| 558 |
"""Display file management sidebar with guaranteed unique button keys."""
|
|
|
|
| 941 |
analysis = process_video_with_gpt(video_file,
|
| 942 |
"Describe what's happening in this video.")
|
| 943 |
st.markdown(analysis)
|
| 944 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 945 |
|
| 946 |
def get_media_html(media_path, media_type="video", width="100%"):
|
| 947 |
"""Generate HTML for media player."""
|