Neural Networks
Network object
A neural network object describes how input data should be preprocessed to be able to perform a simple inference and get raw output features from any layer.
id
int
read-only
The ID of the neural network.
name
string
A short name for your network.
description
string
A longer description of your network.
update_date
string
read-only
Date time (ISO 8601 format) of the last update of the network.
metadata
object
A JSON field containing any kind of information that you may find interesting to store.
framework
string
immutable
A string describing which framework to use for your network. Possible values are:
tensorflow-1.x
: support Tensorflow models up to version 2.9
preprocessing
immutable
A pre-processing object to describe how input data should be pre-processed.
postprocessings
immutable
An array of post-processing object to list output tensors.
task_id
int
read-only
ID of the task containing the deployment status of the network.
Once the network has been created, you cannot modify the preprocessing
field anymore.
Pre-processing object
This object describes how data should be preprocessed for each input of the network.
inputs
A list of Input Preprocessing Object. The order matters as input data will be fed in the same order at inference time.
batched_output
bool
[deprecated] Set this value to True
Input pre-processing
tensor_name
string
The name of the input tensor that this input will feed.
image
An Image Preprocessing Object. Currently, the only supported input type.
Image pre-processing
dimension_order
string
A value describing the order of the dimensions in a batch N = batch_size, C = Channel, H = Height, W = Width Possible values are:
NCHW
NCWH
NHWC
NWHC
resize_type
string
Possible values are:
SQUASH
: image is resized to fit network input, losing aspect ratio.CROP
: image is resized so that the smallest side fits the network input, the rest is cropped.FILL
: image is resized so that the largest side fits the network input, the rest is filled with white.NETWORK
: image is resized so that its largest side fits target_size (see below) and the network is reshaped accordingly.
target_size
string
Target size of the input image. It might have multiple formats. In the following W
, H
and N
denote integer numbers, W
(and H
) being used specifically for width (and height), respectively:
WxH
: image is resized so that width and height fit the specified sizes.N
: image is resized so that the largest side of the input image matches the specified number of pixels.
color_channels
string
Might be RGB
, BGR
or L
(for gray levels).
pixel_scaling
float
Pixel values will be normalized between 0 and pixel_scaling
before mean subtraction.
Post-processing object
This object maps output tensors to a specific function in order to interpret them thanks to recognition versions.
You must specify exactly one of the tensors_output
or standard_output
fields. When we specify an expected tensor size in the description of those fields, we omit the first dimension of the tensor (i.e. the batch size).
tensors_output
A simple ordered list of tensor names.
standard_output
[deprecated] A post-processing specific to detection.
Default post-processing
tensors
array(string)
A simple ordered list of tensor names.
Standard post-processing (deprecated)
boxes_tensor
string
The name of the output tensor containing the boxes. It must be of size N x 4
where N
is the number of detected regions and the 4 columns correspond to xmin
, ymin
, xmax
and ymax
coordinates of the bounding boxes, xmin
and ymin
being the coordinates of the upper-left corner.
scores_tensor
string
The name of the output tensor containing the scores for each label and box. It must be of size N x K
where K
is the number of labels in the recognition specification.
Create a network
Definition
Creates a new custom network after you have trained a model of your own on your infrastructure.
Arguments
name
string
A short name for your network.
description
string
A longer description of your network.
metadata
object
{}
A JSON field containing any kind of information that you may find interesting to store.
framework
string
A string describing which framework to use for your network. Possible values are:
tensorflow-1.x
: Tensorflow: currently version 2.9
preprocessing
A preprocessing object to describe how input data should be pre-processed.
<additionnal-files>
file
Extra files for network graph and weights, as well as mean files needed by the preprocessing. See below.
Once the network has been created, you cannot modify the preprocessing
field anymore.
Code sample
Network files
You will need to provide several additional files to create the network.
TensorFlow files
You need to specify at least one of those files for the tensorflow-1.x framework:
saved_model.pb
: the file that specifies the the network architecture.saved_model.pbtxt
: same as above but serialised in it text format.
If the saved model does not embed the variables weights, you will need to specify additional files:
variables.data-00000-of-00001
: the file that specifies variables' weights. It is usually located in a variables directory. Numbers can change but must respect those of your original file.variables.index
: the index of variables. It is usually located in a variables directory.
Pre-processing files
You might also include any additional file as required by you various input types, for exemple any mean file named as you like and whose name is referred by the mean_file
parameter field of a pre-processing object as long it has one of the supported extensions, see the documentation.
Please refer to the Saving mean files code sample bellow to find out how to save you mean files before sending them to the API.
Saving mean files
In order to save numpy tensor means to files before sending them to the API, please proceed like this:
Response
A neural network object, example response:
List networks
Code sample
Lists all public and private networks:
Response
A paginated list of responses.
count
int
The total number of results.
next
string
The URL to the next page.
previous
string
The URL to the previous page.
results
A list of your neural networks objects
Example response
Retrieve a network
Definition
Retrieve a neural network by ID:
Arguments
network_id
int
The ID of the neural network to get.
Code sample
Response
Edit a network
Definition
Updates the specified network by setting the values of the parameters passed. Any parameters not provided will be left unchanged.
This request accepts only the name
and metadata
arguments. Other values are immutable.
Arguments
name
string
optionnal
A short name for your network.
description
string
optionnal
A longer description of your network.
metadata
object
optionnal
A JSON field containing any kind of information that you may find interesting to store.
Code sample
Response
Delete a network
Definition
Permanently deletes a network. This cannot be undone.
Attached resources such as recognition versions will also be suppressed.
Arguments
id
int
The Neural Network ID to delete.
Code sample
Response
Return 204 (no content).
Last updated