Neural Network

Each camera is capable of running a neural network and feeding it data from a selected stream. Our API can currently handle only models in the MyriadX blob format. To read more about this format and how to convert your models to MyriadX blob format, please refer to Luxonis conversion guide.

API Reference

Deploy Neural Network

post
Path parameters
stream_namestringRequiredPattern: CAM_[A-H]|DEPTH_[A-H]_[A-H]
mxidstringRequiredPattern: [A-Z0-9]+
Body
modelstring · binaryRequired
nn_configstringRequired
Responses
201
Successful Response
application/json
Responseany
post
POST /cameras/{mxid}/streams/{stream_name}/nn HTTP/1.1
Host: robopipe-1.local
Content-Type: multipart/form-data
Accept: */*
Content-Length: 37

{
  "model": "binary",
  "nn_config": "text"
}

No content

NNConfig Description

The deploy neural network endpoint accepts form-data body. This body shall contain two fields - model, which is a binary file containing the neural network in the MyriadX blob format and nn_config, stringified json containing the neural network configuration. The nn_config format is described below

NNConfig Field
Description

type (required)

Type of the neural network being deployed. Possible values are:

  • Generic

  • YOLO

  • MobileNet

Type: enum

num_inference_threads (optional)

Number of CPU to run inference on.

Type: number Default: 2

nn_config (optional)

Type-specific configuration for the deployed model. Type: NNYoloConfig | NNMobileNetConfig

NNYoloConfig

NNYoloConfig Field
Description

anchor_masks (optional)

anchors (optional)

coordinate_size (optional)

iou_threshold (optional)

num_classes (optional)

NNMobileNetConfig

NNMobileNetConfig Field
Description

confidence_threshold (optional)

Delete Neural Network

delete
Path parameters
stream_namestringRequiredPattern: CAM_[A-H]|DEPTH_[A-H]_[A-H]
mxidstringRequiredPattern: [A-Z0-9]+
Responses
202
Successful Response
application/json
Responseany
delete
DELETE /cameras/{mxid}/streams/{stream_name}/nn HTTP/1.1
Host: robopipe-1.local
Accept: */*

No content

Last updated