import streamlit as st
from PIL import Image
import os
# Set page config to make the background dark blue
st.set_page_config(page_title="My App", layout="centered")
# Add CSS for custom background color and text styling
st.markdown(
"""
""",
unsafe_allow_html=True
)
# Define function to load and display images with error handling
def display_image(image_path, caption):
try:
image = Image.open(image_path)
st.markdown(f'
{caption}
', unsafe_allow_html=True)
st.image(image, use_column_width=True)
except FileNotFoundError:
st.error(f"File not found: {image_path}")
except Exception as e:
st.error(f"An error occurred while loading {image_path}: {e}")
# List of image files with their captions and correct file extensions in the specified order
image_files = [
("head10.JPG", "Head 10"),
("idm_overlap.jpg", "IDM Overlap"),
("idm.JPG", "IDM"),
("topic_groups.JPG", "Topic Groups"),
("similarity_matrix.JPG", "Similarity Matrix"),
("heirarchy_cluster.JPG", "Hierarchy Cluster"),
]
# Display images
for file, caption in image_files:
display_image(file, caption)
# Display the specified text parts
st.markdown('It was pretty metal at the grocery store today. #Covid_19
', unsafe_allow_html=True)
st.markdown('summary: It was pretty metal at the grocery store today. #Covid_19 - a video of a metal event at a grocery store.
', unsafe_allow_html=True)
# Continue displaying the remaining images
remaining_images = [
("sentiment.JPG", "Sentiment"),
("accuracy.JPG", "Accuracy")
]
for file, caption in remaining_images:
display_image(file, caption)