jdalfonso commited on
Commit
8fd08e0
·
1 Parent(s): 75bcde3

:rocket: feature: Audio recorder

Browse files
Files changed (9) hide show
  1. .gitignore +8 -0
  2. app.py +10 -28
  3. requirements.txt +5 -0
  4. utils.py +4 -0
  5. views/about.py +21 -0
  6. views/analytics.py +0 -12
  7. views/application.py +40 -0
  8. views/home.py +0 -12
  9. views/ml.py +0 -12
.gitignore CHANGED
@@ -172,3 +172,11 @@ cython_debug/
172
 
173
  # PyPI configuration file
174
  .pypirc
 
 
 
 
 
 
 
 
 
172
 
173
  # PyPI configuration file
174
  .pypirc
175
+
176
+ #Custom
177
+ dataset/
178
+ old/
179
+ *.wav
180
+
181
+ # Mac
182
+ .DS_Store
app.py CHANGED
@@ -1,8 +1,7 @@
1
  import streamlit as st
2
  from streamlit_option_menu import option_menu
3
- from views.home import home
4
- from views.analytics import analytics
5
- from views.ml import ml
6
 
7
  # Set the logo
8
  st.sidebar.image("img/logo.png", use_container_width=True)
@@ -15,8 +14,8 @@ with st.sidebar:
15
  # Navigation menu with icons
16
  selected_tab = option_menu(
17
  menu_title=None, # Added menu_title parameter
18
- options=["Home", "Analytics", "Machine Learning"],
19
- icons=["house", "bar-chart", "robot"],
20
  menu_icon="cast",
21
  default_index=0,
22
  # styles={
@@ -27,26 +26,9 @@ with st.sidebar:
27
  # }
28
  )
29
 
30
- if selected_tab == "Home":
31
- home()
32
- elif selected_tab == "Analytics":
33
- analytics()
34
- elif selected_tab == "Machine Learning":
35
- ml()
36
-
37
- # Quick links section after filters and content
38
- st.markdown("---")
39
- col1, col2 = st.columns(2)
40
-
41
- with col1:
42
- st.markdown("### About")
43
- st.write("This dashboard is maintained by the M2 SISE team.")
44
- st.write("For more information, please visit the [GitHub repository](https://github.com/jdalfons/sise-ultimate-challenge/tree/main).")
45
-
46
- with col2:
47
- st.markdown("### Collaborators")
48
- st.write("""
49
- - [Warrior 1](https://github.com/jdalfons)
50
- - [Warrior 2](https://github.com/jdalfons)
51
- - [Juan Alfonso](https://github.com/jdalfons)
52
- """)
 
1
  import streamlit as st
2
  from streamlit_option_menu import option_menu
3
+ from views.application import application
4
+ from views.about import about
 
5
 
6
  # Set the logo
7
  st.sidebar.image("img/logo.png", use_container_width=True)
 
14
  # Navigation menu with icons
15
  selected_tab = option_menu(
16
  menu_title=None, # Added menu_title parameter
17
+ options=["Application", "About"],
18
+ icons=["robot", "bar-chart", "robot"],
19
  menu_icon="cast",
20
  default_index=0,
21
  # styles={
 
26
  # }
27
  )
28
 
29
+
30
+ if selected_tab == "Application":
31
+ application()
32
+ elif selected_tab == "About":
33
+ about()
34
+
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
requirements.txt ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
 
1
+ streamlit
2
+ streamlit_option_menu
3
+ streamlit-audiorecorder
4
+ scipy
5
+ numpy
utils.py ADDED
@@ -0,0 +1,4 @@
 
 
 
 
 
1
+ import streamlit as st
2
+ import datetime
3
+
4
+
views/about.py ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import streamlit as st
2
+
3
+
4
+ def about():
5
+ st.title("About")
6
+
7
+ col1, col2 = st.columns(2)
8
+
9
+ with col1:
10
+ st.markdown("### About")
11
+ st.write("This dashboard is maintained by the M2 SISE team.")
12
+ st.write("For more information, please visit the [GitHub repository](https://github.com/jdalfons/sise-ultimate-challenge/tree/main).")
13
+
14
+ with col2:
15
+ st.markdown("### Collaborators")
16
+ st.write("""
17
+ - [Falonne Kpamegan](https://github.com/marinaKpamegan)
18
+ - [Nancy](https://github.com/yminanc)
19
+ - [Cyril](https://github.com/Cyr-CK)
20
+ - [Juan Alfonso](https://github.com/jdalfons)
21
+ """)
views/analytics.py DELETED
@@ -1,12 +0,0 @@
1
- import streamlit as st
2
-
3
- def analytics():
4
- st.title("Analytiques")
5
- st.write("Welcome to the Analytics page!")
6
- st.markdown("""
7
- **Overview:**
8
- - View your security logs
9
- - Analyze data trends
10
- - Explore datasets
11
- - Apply machine learning models
12
- """)
 
 
 
 
 
 
 
 
 
 
 
 
 
views/application.py ADDED
@@ -0,0 +1,40 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import streamlit as st
2
+ import datetime
3
+ import os
4
+
5
+ DIRECTORY = "audios"
6
+ FILE_NAME = "audio.wav"
7
+
8
+ def application():
9
+ st.title("SISE ultimate challenge")
10
+ st.write("C'est le dernier challenge de la formation SISE.")
11
+ st.markdown("""
12
+ **Overview:**
13
+ - Analyse de logs
14
+ - Analyse de données
15
+ - Machine learning
16
+ """)
17
+
18
+ st.markdown("---")
19
+
20
+ tab1, tab2 = st.tabs(["Record Audio", "Register Audio"])
21
+
22
+ with tab1:
23
+ st.header("Record Audio")
24
+ st.write("Here you can record audio.")
25
+ audio_file = st.file_uploader("Upload an audio file", type=["wav", "mp3", "ogg"])
26
+ if audio_file is not None:
27
+
28
+ with open(f"audios/{FILE_NAME}", "wb") as f:
29
+ f.write(audio_file.getbuffer())
30
+ st.success(f"Saved file: {FILE_NAME}")
31
+
32
+ with tab2:
33
+ st.header("Register Audio")
34
+ st.write("Here you can register audio.")
35
+
36
+
37
+ file = os.path.join(DIRECTORY, FILE_NAME)
38
+ if os.path.exists(file):
39
+ st.markdown("## File registered:")
40
+ audio_data = st.audio(file, format='audio/wav', start_time=0)
views/home.py DELETED
@@ -1,12 +0,0 @@
1
- import streamlit as st
2
-
3
-
4
- def home():
5
- st.title("SISE ultimate challenge")
6
- st.write("C'est le dernier challenge de la formation SISE.")
7
- st.markdown("""
8
- **Overview:**
9
- - Analyse de logs
10
- - Analyse de données
11
- - Machine learning
12
- """)
 
 
 
 
 
 
 
 
 
 
 
 
 
views/ml.py DELETED
@@ -1,12 +0,0 @@
1
- import streamlit as st
2
-
3
-
4
- def ml():
5
- st.title("Machine Learning")
6
- st.write("Welcome to the Machine Learning page!")
7
- st.markdown("""
8
- **Overview:**
9
- - Train machine learning models
10
- - Evaluate model performance
11
- - Make predictions
12
- """)