EyeCloud¶
-
class
EyeCloudFrame
(frame, sequence_index)¶ This class extends numpy.ndarray with an additional sequence_index attribute.
-
property
sequence_index
¶ Sequence index of the frame.
- Returns
int
-
property
-
class
EyeCloud
(model_id=None)¶ Class to be used to with EyeCloud OpenNCC cameras to capture frames and to execute models.
EyeCloud is currently supported on amd64 (Desktop) and armv7hf (Raspberry Pi 4).
Containers with EyeCloud support are tagged as follows:
<repo-id>:eyecloud-<architecture>-<version>
Typical usage:
from edgeiq import eyecloud with edgeiq.eyecloud.EyeCloud('alwaysai/mobilenet-ssd-eyecloud') as camera: while True: frame = camera.get_frame() frame_sequence_index = frame.sequence_index result = camera.get_model_result(confidence_level=.75) if result: model_sequence_index = result.sequence_index
- Parameters
model_id (string) – The ID of the model you want to initialize on the camera. Supported model purposes: Object Detection, Classification, Pose Estimation. Intializing the camera with no model_id or supplying None will still allow you to capture frames.
-
property
model_id
¶ The id of the model running on the camera
- Type
string
-
property
model_purpose
¶ The purpose of the model running on the camera.
- Type
string
-
start
()¶ Initialize the EyeCloud camera.
- Returns
self
-
stop
()¶ Uninitialize EyeCloud camera.
-
get_frame
()¶ Retrieve and process the latest image data.
Call Type: Blocking.
This is a helper function that calls
get_frame_data()
andprocess_frame_data()
sequentially.- Returns
EyeCloudFrame
A custom numpy.ndarray that holds the image data along with an added sequence_index attribute.
-
get_model_result
(**inference_args)¶ Retrieve and process the latest model output data.
Call Type: Non-blocking, returns None when new model data is not available.
The results objects are the same as the results object returned across our platform along with an added sequence_index attribute.
- Parameters
inference_args – Named arguments that are fed into the post processing functions. Parameters can differ based on model purpose and they are described below.
ObjectDetection
- Parameters
confidence_level (float) – The minimum cofindence level required to successfully access an object identification.
- Returns
Classification
- Parameters
confidence_level (float) – The minimum confidence level required to successfully accept a classification.
- Returns
Pose Estimation
- Returns
-
get_frame_data
()¶ Retrieve the latest image data.
Call Type: Blocking.
- Returns
bytearray
-
process_frame_data
(frame_data)¶ Process the frame data.
- Parameters
frame_data – bytearray containing the image data obtained from
get_frame_data()
- Returns
EyeCloudFrame
A custom numpy.ndarray that holds the image data along with an added sequence_index attribute.
-
get_model_data
()¶ Retrieve the latest model output data.
Call Type: Non-blocking, returns None when new model data is not available.
- Returns
bytearray - when new model output data is available, else None.