|
|
|
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 |
|
|
|
|
|
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. |
|
""") |
|
|
|
|
|
col1, col2 = st.columns(2) |
|
|
|
|
|
|
|
edf_file = col1.file_uploader("Upload an EEG edf file", type="edf") |
|
|
|
col2.button('Result:') |
|
|
|
|
|
if edf_file is not None: |
|
|
|
|
|
raw = read_file(edf_file) |
|
|
|
|
|
preprocessing_and_plotting(raw) |
|
|
|
|
|
clf = build_model(model_name='deep4net', n_classes=2, n_chans=21, input_window_samples=6000) |
|
|
|
output = predict(raw,clf) |
|
|
|
|
|
set_button_state (output,col2) |