in short..
1. initializing the model
private val model: Module = Module.load(assetFilePath(context, assetFileName))
2. doing preProcesBitmap:
val (imageTensor, _) = preprocessBitmap(imageBitmap)
val (maskTensor, _) = preprocessBitmap(maskBitmap, isMask = true)
3. passing tensor to the model:
val outputTensor =
model.forward(IValue.from(imageTensor), IValue.from(maskTensor)).toTensor()
4. getting bitmap from tensorOutput
val scores: FloatArray = outputTensor.dataAsFloatArray
val shape = outputTensor.shape()