File size: 1,352 Bytes
d022705 731299b d022705 5fdbc81 13f97c3 5fdbc81 13f97c3 8de7d60 13f97c3 731299b 13f97c3 d022705 13f97c3 5fdbc81 d022705 13f97c3 5fdbc81 d022705 5fdbc81 13f97c3 |
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 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 |
# Import libraries
import streamlit as st
import mne
import matplotlib.pyplot as plt
import os
import streamlit as st
import random
from misc import *
import streamlit as st
# Add the title and instructions
st.title("EEG Classification Demo")
st.write("""
This demo allows you to upload an EEG recording file in the EDF format.
The model will process your uploaded file and predict whether the EEG signal is classified as **Normal** or **Abnormal**.
Please follow the steps below to get started:
1. Upload your recorded EEG file (in .edf format).
2. The system will preprocess the data and make a prediction based on the signal.
3. Check the result to see the classification outcome.
""")
# Create two columns with st.columns (new way)
col1, col2 = st.columns(2)
# Create the upload button in the first column
# Load the edf file
edf_file = col1.file_uploader("Upload an EEG edf file", type="edf")
# Create the result placeholder button in the second column
col2.button('Result:')
if edf_file is not None:
# Read the file
raw = read_file(edf_file)
# Preprocess and plot the data
preprocessing_and_plotting(raw)
# Build the model
clf = build_model(model_name='deep4net', n_classes=2, n_chans=21, input_window_samples=6000)
output = predict(raw,clf)
# # Print the output
set_button_state (output,col2) |