sdk package¶
Submodules¶
sdk.camera module¶
This module contains the high level client APIs.
-
class
sdk.camera.CameraClient(ipc_provider)[source]¶ Bases:
objectThis is a class for high level client APIs.
- Variables
ipc_provider (IpcProvider object) –
preview_running (bool) – Flag for preview status.
preview_url (str) –
vam_running (bool) – Flag for vam status.
vam_url (str) –
resolutions (list of str) – List of supported resolutions values. Use this for configure_preview API.
encodetype (list of str) – List of supported codec types. Use this for configure_preview API.
bitrates (list of str) – List of supported bitrates values. Use this for configure_preview API.
framerates (list of int) – List of supported fps values. Use this for configure_preview API.
cur_resolution (str) – Current preview resolution
cur_codec (str) – Current preview encode type
cur_bitrate (str) – Current preview bitrate
cur_framerate (int) – Current preview framerate
display_out (int) – Flag that tells whether HDMI display/preview is enabled or not. HDMI display/preview is enabled if this flag is 1 else disabled. This can be configured using configure_preview API.
-
captureimage()[source]¶ This method is for taking a snapshot.
The snapshot is taken and stored as snapshot_<timestamp>.jpg when the call is successful.
- Returns
True if the request was successful. False on failure.
- Return type
-
configure_overlay(type=None, text=None)[source]¶ This is for configuring overlay params.
- Parameters
type ({None, "inference", "text"}) – Type of the overlay you want to configure.
text (str, optional) – Text for text overlay type (the default is None).
Returns – True if the configuration was successful. False on failure.
-
configure_preview(resolution=None, encode=None, bitrate=None, framerate=None, display_out=None)[source]¶ This method is for setting preview params.
- Parameters
- Returns
True if the request is successful. False on failure.
- Return type
-
classmethod
connect(ipc_provider=None, ip_address=None, username=None, password=None)[source]¶ This method is used to create CameraClient handle for application.
-
get_inferences()[source]¶ Inference generator for the application.
This inference generator gives inferences from the VA metadata stream.
- Yields
AiCameraInference (AiCameraInference class object) – This AiCameraInference object yielded from VideoInferenceIterator.start()
- Raises
EOFError – If the preview is not started. Or if the vam is not started.
-
logger= <Logger iotccsdk (INFO)>¶
-
logout()[source]¶ This method is for logging out from the camera.
- Returns
True if the request was successful. False on failure.
- Return type
-
set_analytics_state(state)[source]¶ This is a switch for video analytics(VA).
VA can be enabled or disabled using this API.
-
set_overlay_state(state=None)[source]¶ This is a switch for overlay.
Overlay can be enabled or disabled using this API.
sdk.frame_iterators module¶
This module provides iterator for getting frame and inference.
-
class
sdk.frame_iterators.CameraInference(timestamp, objects)[source]¶ Bases:
objectThis is a class for inferences obtained from the camera.
- Variables
timestamp (int) – Timestamp at which the inferences where made by the camera.
objects (list of CameraInferenceObject objects) – List of inferences obtained from the camera.
-
class
sdk.frame_iterators.CameraInferenceObject(id, label, confidence, position=None)[source]¶ Bases:
objectThis is a class for inference data obtained from the camera.
-
class
sdk.frame_iterators.CameraInferenceObjectPosition(x, y, width, height)[source]¶ Bases:
objectThis is a class for inferenced object position.
-
class
sdk.frame_iterators.VideoInferenceIterator(preview_width, preview_height)[source]¶ Bases:
objectThis is a class for inference generator.
Provides an generator method which can be used to get inferences from RTSP VA stream from the camera.
- Variables
sdk.ipcprovider module¶
This module provides APIs for communicating with QMMF IPC webserver.
-
class
sdk.ipcprovider.IpcProvider(ip=None, username=None, password=None)[source]¶ Bases:
objectThis class provides interface to QMMF IPC webserver.
- Variables
-
connect()[source]¶ Establish a connection with QMMF IPC webserver on the camera.
This API also sets the session_token attribute from the token obtained from the camera.
- Returns
True if the connection was successful. False on failure.
- Return type
- Raises
Timeout – When the request times out on the connect request.
RequestException – The request is not correctly formed.