Ejemplo n.º 1
0
def run_server(classifier):
    """
    Runs the OSC server for providing predictions.
    :param classifier: Trained tensorflow classifier
    :return:
    """
    server = osc_server.OscServer("127.0.0.1", 54321, classifier)
    server.run_server()
Ejemplo n.º 2
0
    if operation_type == OPERATION_TYPE_CLIENT:
        osc_order_path += 'client/'
    elif operation_type == OPERATION_TYPE_TRASHED_CLIENT:
        osc_order_path += 'trashed_client/'
    elif operation_type == OPERATION_TYPE_SERVER:
        osc_order_path += 'server/'
    elif operation_type == OPERATION_TYPE_SESSION:
        osc_order_path += 'session/'

    osc_order_path += operation

    if operation_type == OPERATION_TYPE_CONTROL and operation == 'stop':
        osc_order_path = '/ray/server/quit'

    import osc_server  # see top of the file
    server = osc_server.OscServer(detach)
    server.setOrderPathArgs(osc_order_path, arg_list)
    daemon_process = None

    if (daemon_started
            and not (operation_type == OPERATION_TYPE_CONTROL
                     and operation in ('start_new', 'start_new_hidden'))):
        if (operation_type == OPERATION_TYPE_CONTROL and operation == 'stop'):
            daemon_port_list = []

            if wanted_port:
                daemon_port_list.append(wanted_port)
            else:
                for daemon in daemon_list:
                    if (daemon.user == os.getenv('USER')
                            and not daemon.not_default):