Working with Models (API)
The Encord API allows you to interact with the Encord model features. Our model library includes state-of-the-art classification, object detection, segmentation, and pose estimation models.
Creating a model row
The easiest way to get started with creating a model row is to navigate to the Models tab in your project. Create a model and set parameters accordingly.
Click on the ‘Model API details’ button to toggle a code snippet with create model row API details when you are happy with your selected parameters. The feature ID’s (featureHash
uid) can also be fetched from the project editor information.
The request returns a model ID (model_hash
uid).
The following models are available, and have to be passed as strings.
Training
Navigate to the Models tab in your Project to get started with model training. Start by creating a model row using the Encord API or by following the guidelines here. You can also use an existing model by clicking on the ‘train’ button.
Navigate through the training flow and set parameters accordingly.
Click on the ‘Training API details’ button to toggle a code snippet with model training API details when you are happy with your selected label rows and parameters. The label row ID’s (label_hash
uid) can also be fetched from the project information.
Curl
It is important that the weights used for the model training is compatible with the created model. For example, if you have created a faster_rcnn
object detection model, you should use faster_rcnn
weights.
The following pre-trained weights are available for training.
Inference
To get started with Model inference, make sure you have created a project API key with model.inference
added to access scopes. The easiest way to get started with model inference is to navigate to the Models tab in your Project.
Open the model training log for the model you would like to use for inference.
Click the inference API details icon next to the download button to toggle a code snippet with model inference details. The Model inference API accepts a list of base64 encoded strings with an uid.
You can define confidence and intersection-over-union (IoU) thresholds. The default confidence threshold is set to 0.6
, and the default IoU threshold is set to 0.3
.
For video inference, you must define a detection frame range.
Object UID allocation (tracking) is disabled by default and is defined by the parameter allocation_enabled
.
Equivalently using Node.js with Axios and with a single example file, using the Node fs
package to parse the file into a base64 string:
Curl
Was this page helpful?