How can I use Coroutines.invokeOnCompletion

I’ve the below code that is working fine:

scope.launch {
      val detectedFaces = FaceDetection.detectFaces(bitmap)
      println("Detected Faces = $detectedFaces")
}

I tried to re-write it using invokeOnCompletion but the returned value was null which means I wrongly use it?

val detectedFaces = scope.launch { FaceDetection.detectFaces(bitmap) }
detectedFaces.invokeOnCompletion {
    println("Detected Faces = $detectedFaces")
}