Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
# 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,:,:]