Skip to main content
API Reference SwiftyNsdk NsdkSemanticsSession

latestPackedChannels

Retrieves the latest packed semantic channels data....

Declaration

func latestPackedChannels() -> NsdkAsyncState<SemanticsResult, AwarenessError>

Summary

Retrieves the latest packed semantic channels data.
This method returns a multi-channel image where each channel represents a different
semantic category. Packed channels provide an efficient way to access multiple
semantic classifications in a single image, reducing the need for multiple API calls.
- Returns: A tuple containing the operation status and semantic result if successful
## Example
swift <br />let (status, result) = semanticsSession.getLatestPackedChannels() <br />if status.isOk(), let semanticResult = result &#123; <br /> print("Packed channels image size: \\(semanticResult.image?.width ?? 0) x \\(semanticResult.image?.height ?? 0)") <br /> // Process packed semantic data <br /> if let image = semanticResult.image &#123; <br /> processPackedSemanticChannels(image) <br /> &#125; <br />&#125; <br />
## Packed Channels Format
The packed channels image contains multiple semantic categories encoded as separate
channels in a single image. Each channel corresponds to a semantic category, and
pixel values represent classification confidence or probability scores.
## Performance Benefits
Using packed channels is more efficient than calling getLatestConfidence multiple
times, as it reduces the number of API calls and data transfers required.


ON THIS PAGE