robopipe.io
SolutionShopAbout UsDocumentationSupport
  • Welcome
  • Getting started
    • Setup
    • Hello world
  • Examples
    • Capsule counting
  • API
    • REST API Reference
      • Cameras
      • Streams
      • Neural Network
      • Controller
      • Analog I/O
      • Digital I/O
      • Led
    • WebSocket API Reference
      • Video Stream
      • NN Inference
    • Configuration
  • Other
    • Supported devices
    • Generic Devices
    • Troubleshooting
  • Resources
    • Robopipe Reddit
    • Robopipe GitHub
    • Luxonis
    • Unipi
Powered by GitBook
On this page
Edit on GitHub
  1. API
  2. REST API Reference

Neural Network

PreviousStreamsNextController

Last updated 4 months ago

Each camera is capable of running a 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 .

Deploying an AI model on the camera takes some time (usually ~20s, but may take up to a minute), during this time, the camera will be inaccessible via the API, since it needs to restart in order to deploy the model. All running streams from the particular camera will be paused and will resume when the camera is up again.

API Reference

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)

neural network
Luxonis conversion guide

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
404
Camera or stream not found
422
Validation Error
application/json
delete
DELETE /cameras/{mxid}/streams/{stream_name}/nn HTTP/1.1
Host: robopipe-1.local
Accept: */*

No content

  • API Reference
  • POSTDeploy Neural Network
  • NNConfig Description
  • DELETEDelete Neural Network

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
404
Camera or stream not found
422
Validation Error
application/json
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