How to use the dtlpy.PluginInput function in dtlpy

To help you get started, we’ve selected a few dtlpy examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github dataloop-ai / ZazuML / create_plugins.py View on Github external
'concurrency': 2,
                                                    'image': 'gcr.io/viewo-g/piper/agent/runner/gpu/main/zazu:latest'
                                                    },
                                           bot=None)
    deployment = plugin.deployments.get(deployment_name=plugin.name)

    ##############
    # for update #
    ##############
    deployment.pluginRevision = plugin.version
    deployment.update()

    ####################
    # invoke a session #
    ####################
    inputs = [dl.PluginInput(type='Json',
                             value={'annotation_type': 'binary',
                                    'confidence_th': 0.50,
                                    'output_action': 'annotations'},
                             name='config')]
    session = deployment.sessions.create(deployment_id=deployment.id,
                                         session_input=inputs)

    # check updates
    for i in range(5):
        _session = deployment.sessions.get(session_id=session.id)
        pprint.pprint(_session.status[-1])
        time.sleep(2)