EEG_cls / app.py
Mohammad Javad Darvishi
'first working version of the demo'
13f97c3
# 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
# 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)