.addOnSuccessListener { results -> for (obj in results) { val entityId: String = obj.entityId val box: Rect = obj.boundingBox val category: Int = obj.classificationCategory val confidence: Float? = obj.classificationConfidence val trackingId: Int? = obj.trackingId ... } } .addOnFailureListener { ... }