Spaces:
Sleeping
Sleeping
import streamlit as st | |
class Main_View: | |
def __init__(self, app): | |
self.app = app | |
def show(self): | |
st.markdown("<h1 style='text-align: center;'>🧠 Brain Tumor Detection with YOLOv8</h1>", unsafe_allow_html=True) | |
st.subheader("This app helps detect brain tumors from MRI and CT scan images using a powerful YOLOv8 deep " | |
"learning model. It not only identifies tumors but also determines whether they are malignant or" | |
" benign.") | |
st.divider() | |
image_input = 'test_image.jpg' | |
image_output = 'test_image_pred.png' | |
col1_img, col2_img = st.columns(2,gap='medium') | |
with col1_img: | |
st.image(image_input, caption="Input", use_container_width=True) | |
with col2_img: | |
st.image(image_output, caption="Prediction", use_container_width=True) | |
st.divider() | |
if st.session_state.page == "Main": | |
col1_button, col2_button = st.columns(2,gap='medium',vertical_alignment='center') | |
with col1_button: | |
if st.button("Detect from image", key='main_upload', icon = ':material/imagesmode:', type = 'secondary'): | |
self.app.change_page("Upload") | |
with col2_button: | |
if st.button("Detect from video", key='main_camera', icon = ':material/play_circle:', type='primary'): | |
self.app.change_page("Camera") |