File size: 1,438 Bytes
1b7d31e
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
f07ad3b
1b7d31e
 
 
 
 
 
 
 
d368912
 
 
23049ed
d368912
 
23049ed
d368912
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
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")