Spaces:
Running
on
Zero
Running
on
Zero
File size: 6,030 Bytes
f16bb9f 0b1e325 f16bb9f 15b7f31 f16bb9f cac01bb f16bb9f cac01bb f16bb9f cac01bb f16bb9f 15b7f31 f16bb9f cac01bb f16bb9f 15b7f31 f16bb9f 257d039 f16bb9f 257d039 f16bb9f 0b1e325 f16bb9f 0b1e325 f16bb9f |
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 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 |
"""
File: tabs.py
Author: Dmitry Ryumin, Maxim Markitantov, Elena Ryumina, Anastasia Dvoynikova, and Alexey Karpov
Description: Gradio app tabs - Contains the definition of various tabs for the Gradio app interface.
License: MIT License
"""
import gradio as gr
# Importing necessary components for the Gradio app
from app.description import DESCRIPTION
from app.authors import AUTHORS
from app.config import config_data
from app.requirements_app import read_requirements
def app_tab():
gr.Markdown(value=DESCRIPTION)
with gr.Row(
visible=True,
render=True,
variant="default",
elem_classes="app-container",
):
with gr.Column(
visible=True,
render=True,
variant="default",
elem_classes="video-container",
):
video = gr.Video(
label=config_data.Labels_VIDEO,
show_label=True,
interactive=True,
visible=True,
mirror_webcam=False,
include_audio=True,
elem_classes="video",
autoplay=False,
)
with gr.Row(
visible=True,
render=True,
variant="default",
elem_classes="submit-container",
):
clear = gr.Button(
value=config_data.OtherMessages_CLEAR,
interactive=False,
icon=config_data.Path_APP
/ config_data.StaticPaths_IMAGES
/ "clear.ico",
visible=True,
elem_classes="clear",
)
submit = gr.Button(
value=config_data.OtherMessages_SUBMIT,
interactive=False,
icon=config_data.Path_APP
/ config_data.StaticPaths_IMAGES
/ "submit.ico",
visible=True,
elem_classes="submit",
)
gr.Examples(config_data.StaticPaths_EXAMPLES, [video])
with gr.Column(
visible=True,
render=True,
variant="default",
elem_classes="results-container",
):
text = gr.Textbox(
value=config_data.InformationMessages_NOTI_RESULTS[0],
max_lines=10,
placeholder=None,
label=None,
info=None,
show_label=False,
container=False,
interactive=False,
visible=True,
autofocus=False,
autoscroll=True,
render=True,
type="text",
show_copy_button=False,
max_length=config_data.General_TEXT_MAX_LENGTH,
elem_classes="noti-results-false",
)
waveform = gr.Plot(
value=None,
label=config_data.Labels_WAVEFORM,
show_label=True,
visible=False,
elem_classes="audio",
)
faces = gr.Plot(
value=None,
label=config_data.Labels_FACE_IMAGES,
show_label=True,
visible=False,
elem_classes="imgs",
)
emotion_stats = gr.Plot(
value=None,
label=config_data.Labels_EMO_STATS,
show_label=True,
visible=False,
elem_classes="emo-stats",
)
sent_stats = gr.Plot(
value=None,
label=config_data.Labels_SENT_STATS,
show_label=True,
visible=False,
elem_classes="sent-stats",
)
with gr.Row(
visible=False,
render=True,
variant="default",
elem_classes="time-container",
) as time_row:
video_duration = gr.Textbox(
value=None,
max_lines=1,
placeholder=None,
label=None,
info=None,
show_label=False,
container=False,
interactive=False,
visible=False,
autofocus=False,
autoscroll=True,
render=True,
type="text",
show_copy_button=False,
max_length=50,
elem_classes="video_duration",
)
calculate_time = gr.Textbox(
value=None,
max_lines=1,
placeholder=None,
label=None,
info=None,
show_label=False,
container=False,
interactive=False,
visible=False,
autofocus=False,
autoscroll=True,
render=True,
type="text",
show_copy_button=False,
max_length=50,
elem_classes="calculate_time",
)
return (
video,
clear,
submit,
text,
waveform,
faces,
emotion_stats,
sent_stats,
time_row,
video_duration,
calculate_time,
)
# def settings_app_tab():
# pass
# def about_app_tab():
# pass
def about_authors_tab():
return gr.HTML(value=AUTHORS)
def requirements_app_tab():
reqs = read_requirements()
return gr.Dataframe(
headers=reqs.columns,
value=reqs,
datatype=["markdown"] * len(reqs.columns),
visible=True,
elem_classes="requirements-dataframe",
type="polars",
max_height=1000,
)
|