Detect Objects
Last updated
Last updated
You can use the Nvision’s Object Detection service to detect labels in an image. this service localizes and identifies multiple objects in the image such as people, animals, vehicles, and furniture. see machine learning services.
A response is returned in JSON format similar to the following example:
If you have not created a Nvision service account credentials, do so now in this set up the Nvision service quickstart for instructions.
Once your service has been created, go to the service overview page under API Key to get your service key.
The Nvision API can perform object detection on a local image file by sending an image as a base64 encoded string in your request body.
The base64 encoded string is a binary-to-text encoding that represents binary data in an ASCII string format as the following example: /9j/4AAQSkZJRgABAQEBLAEsAAD...
The API is accessible via the HTTP method and URL, see :
POST
https://nvision.nipa.cloud/api/v1/object-detection
The configuration is different on individual service types. It is structured as a key-value mapping. A config name is defined in parameter
field and the corresponding value is defined in value
field in string format.
For object detection service, there are two available configurations as follows:
ConfidenceThreshold
: to define the minimum confidence score of the prediction results.
Value options: [0, 1]
Default: "0.1"
OutputCroppedImage
: to return cropped images from bounding box detections.
Value options: "true"
or "false"
Default: "false"
OutputVisualizedImage
: to return drawn bounding box detections on raw image.
Value options: "true"
or "false"
Default: "false"
You can call this API through REST calls or native SDKs.
Nvision SDKs provide interface for calling Nvision services in your own language.
For python, using pypi package here: https://pypi.org/project/nvision/
For nodejs, using npm package here: https://www.npmjs.com/package/@nipacloud/nvision
See the SDK Reference, in this guide, covers calling Nvision API for Python and JavaScript.
Set up the SDK with Webpack (optional)
If you use the SDK in the webpack-based project, you can provide the module resolution alias in your webpack configuration.
An example of how to integrate @nipacloud/nvision
SDK to the frontend app.
https://github.com/nipa-cloud/nvision-browser-example or see making a websocket stream quickstart.