Spaces:
Sleeping
Sleeping
Commit ·
b6dc022
1
Parent(s): 2759f88
initial commit
Browse files17 unmodified lines181920212223243 unmodified lines28293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312 unmodified lines1361371381391401411421 unmodified line14414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823912 unmodified lines25225325425525625725825926026126226317 unmodified linesst.session_state['mode'] = 'Light Mode'# Light/Dark mode togglemode = st.sidebar.selectbox('Select Mode', options=['Light Mode', 'Dark Mode'], index=0 if st.session_state['mode'] == 'Light Mode' else 1)st.session_state['mode'] = mode3 unmodified linescss_string = '''<style>/* Light mode CSS *//* Main layout */.main {background-color: #f0f2f6;}/* Title styling */.title h1 {font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;text-align: center;color: #000000; /* Black color */font-size: 3rem;margin-bottom: 20px;}/* Image styling */.st-image img {border-radius: 15px;margin-bottom: 20px;max-width: 100%;}/* Sidebar styling */[data-testid="stSidebar"] {background-color: #ffffff; /* White color */}[data-testid="stSidebar"] .css-ng1t4o {color: #000000; /* Black color */}[data-testid="stSidebar"] .css-1d391kg {color: #000000; /* Black color */}/* File uploader styling */.stFileUploader {border: 2px dashed #000000; /* Black color */border-radius: 10px;padding: 20px;text-align: center;color: #000000; /* Black color */background-color: #ffffff; /* White background */font-weight: bold;}/* File uploader hover effect */.stFileUploader:hover {background-color: #e0e0e0;}/* Button styling */.stButton>button {background-color: #000000; /* Black background */color: #ffffff; /* White text */border: none;padding: 0.7rem 1.5rem;border-radius: 5px;font-size: 1.1rem;font-weight: bold;margin-top: 10px;}.stButton>button:hover {background-color: #333333; /* Darker black */color: #ffffff;}/* Headers styling */h2 {color: #000000; /* Black color */margin-top: 30px;font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;}h3 {color: #000000; /* Black color */font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;}/* Text styling */.stMarkdown p {font-size: 1.1rem;color: #000000;}/* Footer styling */footer {visibility: hidden;}/* Hide sidebar on small screens */@media only screen and (max-width: 600px) {[data-testid="stSidebar"] {display: none;}.main .block-container {padding-left: 1rem;padding-right: 1rem;}.title h1 {font-size: 2rem;}.stButton>button {width: 100%;}}/* Sample images grid */12 unmodified linesborder: 2px solid transparent;}.sample-images img:hover {border: 2px solid #000000; /* Black border on hover */}</style>'''1 unmodified linecss_string = '''<style>/* Dark mode CSS *//* Main layout */.main {background-color: #1e1e1e;}/* Title styling */.title h1 {font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;text-align: center;color: #ffffff; /* White color */font-size: 3rem;margin-bottom: 20px;}/* Image styling */.st-image img {border-radius: 15px;margin-bottom: 20px;max-width: 100%;}/* Sidebar styling */[data-testid="stSidebar"] {background-color: #333333; /* Dark gray */}[data-testid="stSidebar"] .css-ng1t4o {color: #ffffff; /* White color */}[data-testid="stSidebar"] .css-1d391kg {color: #ffffff; /* White color */}/* File uploader styling */.stFileUploader {border: 2px dashed #ffffff; /* White color */border-radius: 10px;padding: 20px;text-align: center;color: #ffffff; /* White color */background-color: #1e1e1e; /* Dark background */font-weight: bold;}/* File uploader hover effect */.stFileUploader:hover {background-color: #333333;}/* Button styling */.stButton>button {background-color: #ffffff; /* White background */color: #000000; /* Black text */border: none;padding: 0.7rem 1.5rem;border-radius: 5px;font-size: 1.1rem;font-weight: bold;margin-top: 10px;}.stButton>button:hover {background-color: #e0e0e0; /* Lighter gray */color: #000000;}/* Headers styling */h2 {color: #ffffff; /* White color */margin-top: 30px;font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;}h3 {color: #ffffff; /* White color */font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;}/* Text styling */.stMarkdown p {font-size: 1.1rem;color: #ffffff; /* White text */}/* Footer styling */footer {visibility: hidden;}/* Hide sidebar on small screens */@media only screen and (max-width: 600px) {[data-testid="stSidebar"] {display: none;}.main .block-container {padding-left: 1rem;padding-right: 1rem;}.title h1 {font-size: 2rem;}.stButton>button {width: 100%;}}/* Sample images grid */12 unmodified linesborder: 2px solid transparent;}.sample-images img:hover {border: 2px solid #ffffff; /* White border on hover */}</style>'''st.markdown(css_string, unsafe_allow_html=True)local_css(st.session_state['mode'])# Load the image classification pipeline17 unmodified lines18192021222324253 unmodified lines293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211312 unmodified lines1261271281291301311321 unmodified line13413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721812 unmodified lines23123223323423523623723823924024124224317 unmodified linesst.session_state['mode'] = 'Light Mode'# Light/Dark mode togglemode = st.sidebar.selectbox('Select Mode', options=['Light Mode', 'Dark Mode'],index=0 if st.session_state['mode'] == 'Light Mode' else 1)st.session_state['mode'] = mode3 unmodified linescss_string = '''<style>/* Light mode CSS */body {background-color: #f0f2f6;color: #000000;}/* Title styling */.title h1 {font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;text-align: center;color: #000000;font-size: 3rem;margin-bottom: 20px;}/* Image styling */img {border-radius: 15px;margin-bottom: 20px;max-width: 100%;}/* Sidebar styling */[data-testid="stSidebar"] {background-color: #ffffff;color: #000000;}/* File uploader styling */.stFileUploader {border: 2px dashed #000000;border-radius: 10px;padding: 20px;text-align: center;color: #000000;background-color: #ffffff;font-weight: bold;}.stFileUploader:hover {background-color: #e0e0e0;}/* Button styling */button {background-color: #000000 !important;color: #ffffff !important;border: none !important;padding: 0.7rem 1.5rem !important;border-radius: 5px !important;font-size: 1.1rem !important;font-weight: bold !important;margin-top: 10px !important;}button:hover {background-color: #333333 !important;color: #ffffff !important;}/* Headers styling */h2, h3 {color: #000000;font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;}/* Text styling */p {font-size: 1.1rem;color: #000000;}/* Hide footer */footer {visibility: hidden;}/* Responsive Design */@media only screen and (max-width: 600px) {[data-testid="stSidebar"] {display: none;}.block-container {padding-left: 1rem;padding-right: 1rem;}.title h1 {font-size: 2rem;}button {width: 100% !important;}}/* Sample images grid */12 unmodified linesborder: 2px solid transparent;}.sample-images img:hover {border: 2px solid #000000;}</style>'''1 unmodified linecss_string = '''<style>/* Dark mode CSS */body {background-color: #1e1e1e;color: #ffffff;}/* Title styling */.title h1 {font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;text-align: center;color: #ffffff;font-size: 3rem;margin-bottom: 20px;}/* Image styling */img {border-radius: 15px;margin-bottom: 20px;max-width: 100%;}/* Sidebar styling */[data-testid="stSidebar"] {background-color: #333333;color: #ffffff;}/* File uploader styling */.stFileUploader {border: 2px dashed #ffffff;border-radius: 10px;padding: 20px;text-align: center;color: #ffffff;background-color: #1e1e1e;font-weight: bold;}.stFileUploader:hover {background-color: #333333;}/* Button styling */button {background-color: #ffffff !important;color: #000000 !important;border: none !important;padding: 0.7rem 1.5rem !important;border-radius: 5px !important;font-size: 1.1rem !important;font-weight: bold !important;margin-top: 10px !important;}button:hover {background-color: #e0e0e0 !important;color: #000000 !important;}/* Headers styling */h2, h3 {color: #ffffff;font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;}/* Text styling */p {font-size: 1.1rem;color: #ffffff;}/* Hide footer */footer {visibility: hidden;}/* Responsive Design */@media only screen and (max-width: 600px) {[data-testid="stSidebar"] {display: none;}.block-container {padding-left: 1rem;padding-right: 1rem;}.title h1 {font-size: 2rem;}button {width: 100% !important;}}/* Sample images grid */12 unmodified linesborder: 2px solid transparent;}.sample-images img:hover {border: 2px solid #ffffff;}</style>'''st.markdown(css_string, unsafe_allow_html=True)# Apply the custom CSS based on the selected modelocal_css(st.session_state['mode'])# Load the image classification pipeline
app.py+66-86