Package org.jetbrains.kotlinx.dl.onnx.inference

Types

CameraXCompatibleModel
Link copied to clipboard
interface CameraXCompatibleModel

Interface represents models which can be used with CameraX API, i.e. support setting of target image rotation.

ExecutionProviderCompatible
Link copied to clipboard
common
interface ExecutionProviderCompatible

Interface for a different kinds of ONNX models which support different execution providers.

OnnxHighLevelModel
Link copied to clipboard
common
interface OnnxHighLevelModel<I, R> : ExecutionProviderCompatible

Base class for pre-trained high-level onnx models.

OnnxInferenceModel
Link copied to clipboard
common
open class OnnxInferenceModel : ExecutionProviderCompatible

Inference model built on ONNX format.

ONNXModelHub
Link copied to clipboard
class ONNXModelHub(context: Context) : ModelHub

This class provides methods for loading ONNX model from android application resources.

class ONNXModelHub(cacheDirectory: File) : ModelHub

This class provides methods for loading ONNX model to the local cacheDirectory.

ONNXModels
Link copied to clipboard
object ONNXModels

Set of pretrained mobile-friendly ONNX models

object ONNXModels

Models in the ONNX format and running via ONNX Runtime.

OnnxModelSummary
Link copied to clipboard
common
data class OnnxModelSummary(inputsSummaries: List<<ERROR CLASS><String, VariableSummary>>, outputsSummaries: List<<ERROR CLASS><String, VariableSummary>>)

Summary of the OnnxInferenceModel. Contains information about input and output variables of the model.

OnnxModelType
Link copied to clipboard
common
interface OnnxModelType<U>

Base type for OnnxInferenceModel.

OrtSessionResultConversions
Link copied to clipboard
common
object OrtSessionResultConversions

Convenience functions for processing OrtSession.Result.

VariableSummary
Link copied to clipboard
common
interface VariableSummary

Interface to produce text description of the ONNX variable.

Functions

doWithRotation
Link copied to clipboard
fun <R> CameraXCompatibleModel.doWithRotation(rotation: Int, function: () -> R): R

Convenience function to execute arbitrary code with a preliminary updated target rotation. After the code is executed, the target rotation is restored to its original value.

inferAndCloseUsing
Link copied to clipboard
common
inline fun <M : ExecutionProviderCompatible, R> M.inferAndCloseUsing(vararg providers: ExecutionProvider, block: (M) -> R): R

Extension function for explicitly specifying the execution provider for specific code block. Follows kotlin.use semantics.

inferUsing
Link copied to clipboard
common
inline fun <M : ExecutionProviderCompatible, R> M.inferUsing(vararg providers: ExecutionProvider, block: (M) -> R): R

Extension function for explicitly specifying the execution provider for specific code block. Follows kotlin.run semantics.