Beispiel #1
0
    def __init__(self, title=__title__):
        super(WImageLoaded, self).__init__(title)
        self.title = title
        self.paused = True
        self.image2D = True
        self.exit = False
        self.layout = [[
            sg.Frame(title="",
                     layout=[[
                         sg.Text("File RGB:", size=(10, 1)),
                         sg.Input(key="InputRGB"),
                         sg.FileBrowse()
                     ], [sg.Submit(key="SubmitRGB")],
                             [sg.Text("", key="RGB_error", visible=False)],
                             [sg.Image(filename="", key="RGB_img")]]),
            sg.Frame(title="",
                     layout=[[
                         sg.Text("File Depth:", size=(10, 1)),
                         sg.Input(key="InputDepth"),
                         sg.FileBrowse()
                     ], [sg.Submit(key="SubmitDepth")],
                             [sg.Text("", key="Depth_error", visible=False)],
                             [sg.Image(filename="", key="Depth_img")]])
        ],
                       [
                           sg.Button(button_text="Exit",
                                     key="Exit",
                                     size=(10, 1),
                                     font=("verdana", 14))
                       ]]

        self.window = None
Beispiel #2
0
def creategui():
    sg.ChangeLookAndFeel('BlueMono')

    frame_layout = [
        [sg.T('Elapsed', size=(60, 1), key='-ELAPSED-')],
        [sg.Multiline('', size=(60, 12), autoscroll=True, key='-ML-')],
    ]

    # define the window layout
    layout = [[
        sg.Text('OMRON HVC P2 Demo GUI',
                size=(50, 1),
                justification='center',
                font='Helvetica 20')
    ], [sg.Image(filename='', key='image'),
        sg.Frame('Result', frame_layout)],
              [
                  sg.ReadButton('Exit',
                                size=(10, 1),
                                pad=((0, 0), 3),
                                font='Helvetica 14'),
                  sg.RButton('Pause',
                             key='-RUN-PAUSE-',
                             size=(10, 1),
                             font='Any 14')
              ]]

    # create the window and show it without the plot
    window = sg.Window('OMRON HVC P2 Demo Application', location=(400, 200))
    #window.Layout(layout).Finalize()
    window.Layout(layout)

    return window
Beispiel #3
0
    def __init__(self, title=__title__):
        super(WStarting, self).__init__(title)
        self.seconds = 24
        self.paused = False
        self.layout = [[
            sg.Frame(title="Additional options:",
                     layout=[[
                         sg.Button(button_text="Watch Live",
                                   key="watch_live",
                                   size=(10, 1),
                                   font=("wingdings", 14)),
                         sg.Button(button_text="Load File",
                                   key="load_file",
                                   size=(10, 1),
                                   font=("wingdings", 14)),
                     ]],
                     size=(25, 3),
                     relief=sg.RELIEF_SUNKEN)
        ],
                       [
                           sg.Button(button_text="Start Component",
                                     key="start_component",
                                     size=(16, 1),
                                     font=("wingdings", 14))
                       ],
                       [
                           sg.Text("The component will start automatically",
                                   auto_size_text=True,
                                   justification="left")
                       ],
                       [
                           sg.ProgressBar(max_value=self.seconds,
                                          key="countdown",
                                          orientation="h",
                                          size=(20, 20))
                       ],
                       [
                           sg.Button(button_text="Exit",
                                     key="Exit",
                                     size=(10, 1),
                                     font=("verdana", 14)),
                       ]]

        self.window = None
        self.progress_bar = None
Beispiel #4
0
     sg.Text('All graphic widgets in one form!',
             size=(30, 1),
             justification='center',
             font=("Helvetica", 25),
             relief=sg.RELIEF_RIDGE)
 ], [sg.Text('Here is some text.... and a place to enter text')],
 [sg.InputText('This is my text')],
 [
     sg.Frame(layout=[[
         sg.Checkbox('Checkbox', size=(10, 1)),
         sg.Checkbox('My second checkbox!', default=True)
     ],
                      [
                          sg.Radio('My first Radio!     ',
                                   "RADIO1",
                                   default=True,
                                   size=(10, 1)),
                          sg.Radio('My second Radio!', "RADIO1")
                      ]],
              title='Options',
              title_color='red',
              relief=sg.RELIEF_SUNKEN,
              tooltip='Use these to set flags')
 ],
 [
     sg.Multiline(
         default_text=
         'This is the default Text should you decide not to type anything',
         size=(35, 3)),
     sg.Multiline(default_text='A second multi-line', size=(35, 3))
 ],
Beispiel #5
0
    [[sg.Tab('Tab 7', tab_layout),
      sg.Tab('Tab 8', tab_layout)]])

tab5_layout = [[sg.T('Watch this window')], [sg.Output(size=(40, 5))]]
tab6_layout = [[sg.T('This is inside tab 6')],
               [sg.T('How about a second row of stuff in tab 6?'), tab_group]]

layout = [
    [sg.T('My Window!')],
    [
        sg.Frame('A Frame',
                 layout=[[
                     sg.TabGroup([[
                         sg.Tab('Tab 1', tab1_layout),
                         sg.Tab('Tab 2', tab2_layout)
                     ]]),
                     sg.TabGroup([[
                         sg.Tab('Tab3', tab3_layout),
                         sg.Tab('Tab 4', tab4_layout)
                     ]])
                 ]])
    ],
    [
        sg.T('This text is on a row with a column'),
        sg.Column(layout=[[sg.T('In a column')],
                          [
                              sg.TabGroup([[
                                  sg.Tab('Tab 5', tab5_layout),
                                  sg.Tab('Tab 6', tab6_layout)
                              ]])
                          ], [sg.RButton('Click me')]])
Beispiel #6
0
def MachineLearningGUI():
    sg.SetOptions(text_justification='right')

    flags = [
        [
            sg.Checkbox('Normalize', size=(12, 1), default=True),
            sg.Checkbox('Verbose', size=(20, 1))
        ],
        [
            sg.Checkbox('Cluster', size=(12, 1)),
            sg.Checkbox('Flush Output', size=(20, 1), default=True)
        ],
        [
            sg.Checkbox('Write Results', size=(12, 1)),
            sg.Checkbox('Keep Intermediate Data', size=(20, 1))
        ],
        [
            sg.Checkbox('Normalize', size=(12, 1), default=True),
            sg.Checkbox('Verbose', size=(20, 1))
        ],
        [
            sg.Checkbox('Cluster', size=(12, 1)),
            sg.Checkbox('Flush Output', size=(20, 1), default=True)
        ],
        [
            sg.Checkbox('Write Results', size=(12, 1)),
            sg.Checkbox('Keep Intermediate Data', size=(20, 1))
        ],
    ]

    loss_functions = [
        [
            sg.Radio('Cross-Entropy', 'loss', size=(12, 1)),
            sg.Radio('Logistic', 'loss', default=True, size=(12, 1))
        ],
        [
            sg.Radio('Hinge', 'loss', size=(12, 1)),
            sg.Radio('Huber', 'loss', size=(12, 1))
        ],
        [
            sg.Radio('Kullerback', 'loss', size=(12, 1)),
            sg.Radio('MAE(L1)', 'loss', size=(12, 1))
        ],
        [
            sg.Radio('MSE(L2)', 'loss', size=(12, 1)),
            sg.Radio('MB(L0)', 'loss', size=(12, 1))
        ],
    ]

    command_line_parms = [
        [
            sg.Text('Passes', size=(8, 1)),
            sg.Spin(values=[i for i in range(1, 1000)],
                    initial_value=20,
                    size=(6, 1)),
            sg.Text('Steps', size=(8, 1), pad=((7, 3))),
            sg.Spin(values=[i for i in range(1, 1000)],
                    initial_value=20,
                    size=(6, 1))
        ],
        [
            sg.Text('ooa', size=(8, 1)),
            sg.In(default_text='6', size=(8, 1)),
            sg.Text('nn', size=(8, 1)),
            sg.In(default_text='10', size=(10, 1))
        ],
        [
            sg.Text('q', size=(8, 1)),
            sg.In(default_text='ff', size=(8, 1)),
            sg.Text('ngram', size=(8, 1)),
            sg.In(default_text='5', size=(10, 1))
        ],
        [
            sg.Text('l', size=(8, 1)),
            sg.In(default_text='0.4', size=(8, 1)),
            sg.Text('Layers', size=(8, 1)),
            sg.Drop(values=('BatchNorm', 'other'), auto_size_text=True)
        ],
    ]

    layout = [[
        sg.Frame('Command Line Parameteres',
                 command_line_parms,
                 title_color='green',
                 font='Any 12')
    ], [sg.Frame('Flags', flags, font='Any 12', title_color='blue')],
              [
                  sg.Frame('Loss Functions',
                           loss_functions,
                           font='Any 12',
                           title_color='red')
              ], [sg.Submit(), sg.Cancel()]]

    window = sg.Window('Machine Learning Front End',
                       font=("Helvetica", 12)).Layout(layout)
    button, values = window.Read()
    sg.SetOptions(text_justification='left')

    print(button, values)
Beispiel #7
0
        for i in result:
            if i != "":
                string += i.capitalize() + " "
        string = string[:-1]
        print string
    """

    window_layout = [[
        gui.Frame(
            "",
            layout=[[gui.Text("What if the past really defined the future?")],
                    [gui.Text("Press submit and find out! Keyword optional.")],
                    [
                        gui.InputText(default_text="",
                                      size=(54, 1),
                                      key="keyword",
                                      do_not_clear=True)
                    ], [gui.Button("Submit", size=(46, 2))],
                    [
                        gui.Multiline(default_text="",
                                      do_not_clear=True,
                                      size=(52, 10),
                                      key="output")
                    ]])
    ]]

    window_title = "News Predictor"
    window = gui.Window(window_title).Layout(window_layout)

    #indow.FindElement("error_box").Update(value=ERROR_MESSAGE, append=True)

    # Window positioning: