package com.king.mlkit.vision.app.`object`

import com.google.mlkit.vision.objects.DetectedObject
import com.google.mlkit.vision.objects.defaults.ObjectDetectorOptions
import com.king.camera.scan.analyze.Analyzer
import com.king.mlkit.vision.`object`.analyze.ObjectDetectionAnalyzer

/**
 * 多个对象检测示例
 *
 * @author <a href="mailto:jenly1314@gmail.com">Jenly</a>
 * <p>
 * <a href="https://github.com/jenly1314">Follow me</a>
 */
class MultipleObjectDetectionActivity : ObjectDetectionActivity() {

    override fun createAnalyzer(): Analyzer<List<DetectedObject>> {
        return ObjectDetectionAnalyzer(
            ObjectDetectorOptions.Builder()
                .setDetectorMode(ObjectDetectorOptions.SINGLE_IMAGE_MODE)
                .enableMultipleObjects()
                .enableClassification()  // Optional
                .build()
        )
    }
}
