File size: 1,667 Bytes
f51c1fd
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
69f6759
 
 
f51c1fd
 
 
 
69f6759
f51c1fd
 
 
69f6759
f51c1fd
 
 
 
 
 
69f6759
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
f51c1fd
 
 
 
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
"""
File: tabs.py
Author: Elena Ryumina and Dmitry Ryumin
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.components import (
    html_message,
    files_create_ui,
    video_create_ui,
    button,
    dataframe,
)


def app_tab():
    gr.Markdown(value=DESCRIPTION)

    with gr.Row():
        files = files_create_ui()

        video = video_create_ui()

    with gr.Row():
        examples = button(
            config_data.OtherMessages_EXAMPLES_APP, True, 1, True, "examples_oceanai"
        )
        calculate_pt_scores = button(
            config_data.OtherMessages_CALCULATE_PT_SCORES,
            False,
            3,
            True,
            "calculate_oceanai",
        )
        clear_app = button(
            config_data.OtherMessages_CLEAR_APP, False, 1, True, "clear_oceanai"
        )

    notifications = html_message(config_data.InformationMessages_NOTI_VIDEOS, False)

    pt_scores = dataframe(visible=False)

    csv_pt_scores = files_create_ui(
        None,
        "single",
        [".csv"],
        config_data.OtherMessages_EXPORT_PT_SCORES,
        True,
        False,
        False,
        "csv-container",
    )

    return (
        notifications,
        files,
        video,
        examples,
        calculate_pt_scores,
        clear_app,
        pt_scores,
        csv_pt_scores,
    )


def about_authors_tab():
    return gr.Markdown(value=AUTHORS)