sergey21000
commited on
Commit
•
a06a53f
1
Parent(s):
7876335
Update pages/2_Video_Detection_Results.py
Browse files
pages/2_Video_Detection_Results.py
CHANGED
@@ -1,39 +1,39 @@
|
|
1 |
-
from pathlib import Path
|
2 |
-
|
3 |
-
import pandas as pd
|
4 |
-
import streamlit as st
|
5 |
-
|
6 |
-
from draw_utils import draw_plots
|
7 |
-
|
8 |
-
|
9 |
-
st.set_page_config(
|
10 |
-
layout='wide',
|
11 |
-
initial_sidebar_state='auto',
|
12 |
-
page_title='Face Emotion Recognition',
|
13 |
-
page_icon='👻',
|
14 |
-
)
|
15 |
-
|
16 |
-
|
17 |
-
st.write("#### Отображение результатов детекции видео")
|
18 |
-
|
19 |
-
csv_path = 'video_annotations.csv'
|
20 |
-
|
21 |
-
@st.cache_data
|
22 |
-
def load_df():
|
23 |
-
df = pd.read_csv(csv_path)
|
24 |
-
return df
|
25 |
-
|
26 |
-
if Path('video_annotations.csv').exists():
|
27 |
-
df = load_df()
|
28 |
-
st.download_button(
|
29 |
-
label='Скачать csv аннотации',
|
30 |
-
data=df.to_csv().encode('utf-8'),
|
31 |
-
file_name=csv_path,
|
32 |
-
mime='text/csv',
|
33 |
-
)
|
34 |
-
draw_plots(df)
|
35 |
-
else:
|
36 |
-
st.write(
|
37 |
-
'#### Для отображения результатов детекции выберите видео' \
|
38 |
-
'на вкладке Video Detection и нажмите "Детекция видео"'
|
39 |
)
|
|
|
1 |
+
from pathlib import Path
|
2 |
+
|
3 |
+
import pandas as pd
|
4 |
+
import streamlit as st
|
5 |
+
|
6 |
+
from draw_utils import draw_plots
|
7 |
+
|
8 |
+
|
9 |
+
st.set_page_config(
|
10 |
+
layout='wide',
|
11 |
+
initial_sidebar_state='auto',
|
12 |
+
page_title='Face Emotion Recognition',
|
13 |
+
page_icon='👻',
|
14 |
+
)
|
15 |
+
|
16 |
+
|
17 |
+
st.write("#### Отображение результатов детекции видео")
|
18 |
+
|
19 |
+
csv_path = 'video_annotations.csv'
|
20 |
+
|
21 |
+
@st.cache_data
|
22 |
+
def load_df():
|
23 |
+
df = pd.read_csv(csv_path)
|
24 |
+
return df
|
25 |
+
|
26 |
+
if Path('video_annotations.csv').exists():
|
27 |
+
df = load_df()
|
28 |
+
st.download_button(
|
29 |
+
label='Скачать csv аннотации',
|
30 |
+
data=df.to_csv().encode('utf-8'),
|
31 |
+
file_name=csv_path,
|
32 |
+
mime='text/csv',
|
33 |
+
)
|
34 |
+
draw_plots(df)
|
35 |
+
else:
|
36 |
+
st.write(
|
37 |
+
'#### Для отображения результатов детекции выберите видео ' \
|
38 |
+
'на вкладке Video Detection и нажмите "Детекция видео"'
|
39 |
)
|