CvApi

interface CvApi : AutoCloseable

This interface allows to observe computer vision detections. There is information about face and body points (face landmarks and pose), body segmentation (mask), face and body bounding boxes, gestures, mirror presence. Moreover, client is able to get api version used by client and complete data on versions, hashs and metadata used by service.

The interface allows client cooperate with computer vision Android service process by aidl IPC with android.os.Binder. Api handles DeadObjectException. In case of service crashes api binding restores service connections and observed detections flows. Service connection is defended with dangerous level permission ru.sberdevices.permission.COMPUTER_VISION_SENSITIVE. When api is no longer needed, it should be closed with close() method call.

Functions

Link copied to clipboard
abstract override fun close()
Link copied to clipboard
abstract suspend fun getServiceInfo(): ServiceInfo?
Link copied to clipboard
abstract suspend fun getVersion(): String?
Link copied to clipboard

Method provides information whether service fulfilling cv api is present and enabled on device. Client is responsible for gracefully adapting its ui so that it can handle unavailability of cv api

Link copied to clipboard
abstract fun observeGestures(): Flow<Gesture>
Link copied to clipboard
abstract fun observeHumans(aspects: Set<HumansDetectionAspect>): Flow<Humans>
Link copied to clipboard
abstract fun observeIsMirrorDetected(): Flow<Boolean>
Link copied to clipboard
abstract suspend fun setPoseActiveTracks(trackIdsIn: IntArray?)
Link copied to clipboard
abstract suspend fun setPoseCropMode(cropMode: Boolean)
Link copied to clipboard
abstract suspend fun setPoseLogsEnable(logsEnable: Boolean)