Last updated
Last updated
Retrieving JSON predictions for a local file called YOUR_IMAGE.jpg
:
Inferring on an image hosted elsewhere on the web via its URL (don't forget to ):
You will need to install and . The easiest way to do this is to use the which also includes the curl
and base64
command line tools when you select "Use Git and optional Unix tools from the Command Prompt" during installation.
Then you can use the same commands as above.
The hosted API inference route returns a JSON
object containing an array of predictions. Each prediction has the following properties:
segmentation_mask
= base64 encoded single channel image with dimensions equal to the input image where each pixel value corresponds to a class ID
class_map
= object that maps class IDs to class names
image
= an object with the input image dimensions
height = height of the input image in number of pixels
width = width of the input image in number of pixels
POST
https://segment.roboflow.com/:datasetSlug/:versionNumber
You can POST a base64 encoded image directly to your model endpoint. Or you can pass a URL as the image
parameter in the query string if your image is already hosted elsewhere.
We're using to perform the POST request in this example so first run npm install axios
to install the dependency.
We have realtime on-device inference available via roboflow.js
; see .
We are adding code snippets as they are requested by users. If you'd like to integrate the inference API into your Elixir app, please .