Python SDK
Python SDK is based on the Nvision image processing service for synchronous calls. The input requests and output responses are structured in JSON format. You can make a RESTful API call by sending an image as a base64 encoded string in the body of your request, see make API calls quickstart.
Quickstarts
Before you begin to use this SDK, these quickstarts will guide you to get started with the Nvision API.
Installation
Using PyPi package here: https://pypi.org/project/nvision/
Supported Python versions: Python >= 3.5
Using the SDK
Detect Objects
To use object detection service, you can initialize the ObjectDetection class directly with your api_key. Then, call the predict() method to make a RESTful request for model inference.
nvision.ObjectDetection.predict() params:
image
: base64 encoded string that represents binary data in an ASCII string format.e.g.
/9j/4AAQSkZJRgABAQEBLAEsAAD...
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"
Prediction response:
detected_objects: a list of prediction outputs for corresponding objects/labels/boxes
bounding_box
: integerconfidence
: how likely it is, the object is contained within the image or video.cropped_image
: returned ifoutput_cropped_image
is set toTrue
.name
: output object name ot label category.parent
: parent class or the output label.
Last updated