Rgb2GrayScale
Color Space Transformation: RGB → Grayscale using fixed luminance weights.
Implements the equivalent of NumPy code: weights = 0.2989, 0.5870, 0.1140 gray = (H*W x 3) @ weights → reshape(H, W)
In SKainNET DSL this is realized as a 1x1 Conv2D with inChannels=3 and outChannels=1 whose kernel is fixed to the weights above and with no bias.
Expected input shape: (N, 3, H, W) Output shape: (N, 1, H, W)
Functions
Link copied to clipboard
open suspend override fun calculate(module: Module<FP32, Float>, inputValue: Tensor<FP32, Float>, executionContext: ExecutionContext, reportProgress: suspend (current: Int, total: Int, message: String?) -> Unit): Tensor<FP32, Float>
Implement this in your models. Call reportProgress whenever you want to emit a progress update.