How to use the depthai.create_pipeline_cnn function in depthai

To help you get started, we’ve selected a few depthai 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 Luxonis-Brandon / DepthAI / platforms / ubuntu1804 / object_detection_demo_cnn / test_cnn.py View on Github external
# set the path to your labels
labels_fpath = 'depthai-resources/nn/vehicle-detection-adas-0002/vehicle-detection-adas-0002.txt'
labels = []
with open(labels_fpath) as fp:
    labels = fp.readlines()
    labels = [i.strip() for i in labels]



# set the path to your blob and json
streams_list = ['metaout', 'previewout']
p = depthai.create_pipeline_cnn(
        streams=streams_list,
        cmd_file=cmd_file_,
        blob_file = 'depthai-resources/nn/vehicle-detection-adas-0002/vehicle-detection-adas-0002.blob',
        blob_file_config = 'depthai-resources/nn/vehicle-detection-adas-0002/vehicle-detection-adas-0002.json'
        )


while True:
    tensors, packets = p.get_available_tensors_and_data_packets()

    for t in tensors:
        for packet in packets:
            if packet.stream_name == 'previewout':
                data = packet.getData()
                # reshape
                data0 = data[0,:,:]

depthai

DepthAI Python Library

MIT
Latest version published 3 months ago

Package Health Score

75 / 100
Full package analysis

Popular depthai functions

Similar packages