Skip to main content
This article applies to these versions of LandingLens:
LandingLensLandingLens on Snowflake
(see exceptions below)
When you run inference on images, the prediction results display in a JSON format. The JSON schema varies based on model type. This article describes the JSON responses for each model type, and provides example code snippets and images.

Differences Between Cloud Deployment, LandingEdge, and Docker

The JSON schema is slightly different between inferences run via Cloud Deployment, and inferences run via LandingEdge and Docker. For example, some elements display in a different order, and the predictions are included in different elements. Differences between the schemas are noted in the tables. Example responses are from Cloud Deployments.

Post-Processing and “Backbone” Elements

When an image is sent for inference via Cloud Deployment, it goes through the model, and then through a post-processing Classification step. This step classifies the image as "OK" or "NG" (short for “Not Good”). Because the process has two steps, the JSON schema for Cloud Deployment includes two sets of predictions:
  • backbonetype and backbonepredictions: These elements contain the data for the actual model that ran inference on the image.
  • type and predictions: These elements contain the data for the Classification step.
By default, LandingEdge and Docker don’t have the post-processing Classification step. The JSON schema for these methods contains the prediction information in the type and predictions elements. However, you can run a script that adds a post-processing model or Classification step when running inference with LandingEdge or Docker. If a post-processing step is added, the JSON will have the same prediction elements that are used for Cloud Deployments. In other words, the model predictions will move to the backbonetype and backbonepredictions elements, and the predictions for the post-processing step will be in the type and predictions elements.

JSON Responses for Object Detection Models

The following table describes the objects in the JSON response for Object Detection models. An example response is here.

Coordinates in Object Detection Responses

The JSON response for Object Detection predictions includes a coordinates object, which communicates the size and location of the bounding box around the prediction region of interest. Each section includes the coordinates of the pixels for each edge of the bounding box. The origin for the coordinates is the top left corner of the image. For example, let’s say that the following snippet is the coordinate object in the JSON output for a prediction.
The coordinates correspond to the points described in the following table and image.

Example: Object Detection JSON Response

The following code snippet and image show the predictions for an Object Detection model trained to detect hard hats. The model has one class: Hard Hat. The model correctly predicted two hard hats. Each prediction is nested in the backbonepredictions object. This JSON response is from Cloud Deployment.
JSON_ObjectDetection_HardHat

JSON Responses for Segmentation and Visual Prompting Models

is not available in .
The following table describes the objects in the JSON response for Segmentation and Visual Prompting models. See these Segmentation and Visual Prompting examples.

Example: Segmentation JSON Response

The following code snippet and image show the predictions for a Segmentation model trained to detect chips on pills. The model has one class: Chipped. Even though there is more than one chipped region, all of the data for Chipped predictions are included in one bitmap object, because these regions all correspond to the Chipped class. This JSON response is from Cloud Deployment. In the image, the purple overlay is the prediction for Chipped.
JSON_segmentation

Example: Visual Prompting JSON Response

is not available in .
The following code snippet and image show the predictions for a Visual Prompting model trained to detect shipping containers in ports. The model has two classes: Shipping Containers and Other. Each class is a separate object nested in the bitmaps object.
This JSON response is from Cloud Deployment. In the image, the purple overlay is the prediction for Shipping Containers, and the yellow overlay is the prediction for Other.
JSON_VP_ShippingContainers

Script for Parsing Segmentation and Visual Prompting Results

Use this Colab notebook to parse the JSON results from Segmentation and Visual Prompting models.

JSON Responses for Classification Models

The following table describes the objects in the JSON response for Classification models. An example response is here.

Example: Classification JSON Response

The following code snippet and image show the predictions for a Classification model trained to detect defects on metal sheets. The model has three classes: Pitted, Scratched, and No Defect. The model correctly predicted the Scratched class. The prediction data is in the predictions object. This JSON response is from Cloud Deployment.
JSON_CLASS_MetalScratch

JSON Responses for Anomaly Detection Models

The following table describes the objects in the JSON response for Anomaly Detection models. An example response is here.

Example: Anomaly Detection JSON Response

The following code snippet and image show the predictions for an Anomaly Detection model for detecting if PCB boards are assembled correctly. The model correctly predicted the image as Normal. The prediction data is in the backbonepredictions object. This JSON response is from Cloud Deployment.
anomaly_detection_prediction