NsdkObjectDetectionSession
Declaration
final class NsdkObjectDetectionSessionProperties
| Name | Type | Summary |
|---|---|---|
| var classNames | ObjectDetectionClassNamesBuffer |
Methods
| Name | Type | Summary |
|---|---|---|
| configure | void | Configures the session with the specified settings. - Attention: This method must be called while the session is stopped, or else configuration will fail. In that case, while this function returns without throwing, configuration will still fail asynchronously. Use featureStatus()to check that configuration has not failed. - Parameter config: An object that defines this session's behavior. Only settings that differ from the defaults will be applied. - Throws: NsdkError.invalidArgument if the configuration is invalid.Check NSDK's C logs for more information. |
| featureStatus | NsdkFeatureStatus | Reports the current status of the object detection feature. This method can be used to detect errors that have occurred within the feature’s internal processes. Once an error is flagged, it will remain flagged until the relevant process has been rerun and completed successfully. Typical usage is to call this at the beginning of a session to check whether object detection is still initializing or if a previous failure has occurred. - Returns: An NsdkFeatureStatus value |
| latestDetections | NsdkAsyncState<ObjectDetectionResult, AwarenessError> | Retrieves the latest object detection results from the object detection session. - Returns: An NsdkAsyncState containing either the latest ObjectDetectionResult,or an AwarenessError. |
| metadata | NsdkAsyncState<ObjectDetectionMetadata, AwarenessError> | Retrieves the metadata for object detection. - Returns: An NsdkAsyncState containing either the latest ObjectDetectionMetadata,or an AwarenessError. |
| modelToImageTransform | CGAffineTransform? | Returns an affine transform that maps coordinates from the model's frame to the image frame, accounting for the model image being rotated to align with gravity, while the source image is always oriented in landscape. - Parameter orientation: The gravity aligned interface orientation. - Returns: A CGAffineTransform to convert model coordinates to image coordinates,or nil if the model frame size, source frame size, or orientation is unavailable. |
| start | void | Starts the object detection session. |
| stop | void | Stops the object detection session. After stopping, the session can be reconfigured and restarted. |
Nested Types
Structs
| Name | Type | Summary |
|---|---|---|
| Configuration | Configuration | Configuration structure for the object detection session. |
Relationships
conforms to: NsdkFeatureSession
Reads from the currently loaded native model and returns its data.
- Returns: The list of possible object detection classifications, or
nilif not available.