diff --git a/app/src/main/java/com/quillstudios/pokegoalshelper/YOLOOnnxDetector.kt b/app/src/main/java/com/quillstudios/pokegoalshelper/YOLOOnnxDetector.kt index 2ae5e70..941953e 100644 --- a/app/src/main/java/com/quillstudios/pokegoalshelper/YOLOOnnxDetector.kt +++ b/app/src/main/java/com/quillstudios/pokegoalshelper/YOLOOnnxDetector.kt @@ -39,9 +39,6 @@ class YOLOOnnxDetector(private val context: Context) { var DEBUG_CLASS_FILTER: String? = null // Set to class name to show only that class var SHOW_ALL_CONFIDENCES = false // Show all detections with their confidences - // Benchmarking for CRITICAL-003 - var BENCHMARKING_MODE = true // Enable detailed performance logging - private val detectionTimes = mutableListOf() fun setCoordinateMode(mode: String) { COORD_TRANSFORM_MODE = mode @@ -55,25 +52,6 @@ class YOLOOnnxDetector(private val context: Context) { Log.i(TAG, "📊 Show all confidences: $SHOW_ALL_CONFIDENCES") } - fun printBenchmarkStats() { - if (detectionTimes.isNotEmpty()) { - val avg = detectionTimes.average() - val min = detectionTimes.minOrNull() ?: 0L - val max = detectionTimes.maxOrNull() ?: 0L - val count = detectionTimes.size - Log.i(TAG, "📈 BENCHMARK STATS (${if (ENABLE_MULTI_PREPROCESSING) "MULTI" else "SINGLE"}-PROCESSING):") - Log.i(TAG, " Count: $count detections") - Log.i(TAG, " Average: ${String.format("%.1f", avg)}ms") - Log.i(TAG, " Min: ${min}ms") - Log.i(TAG, " Max: ${max}ms") - Log.i(TAG, " Total: ${detectionTimes.sum()}ms") - } - } - - fun resetBenchmarkStats() { - detectionTimes.clear() - Log.i(TAG, "📊 Benchmark stats reset") - } // Preprocessing enhancement techniques private const val ENABLE_CONTRAST_ENHANCEMENT = true @@ -395,19 +373,6 @@ class YOLOOnnxDetector(private val context: Context) { val finalDetections = mergeAndFilterDetections(allDetections, inputMat.cols(), inputMat.rows()) val totalTime = System.currentTimeMillis() - startTime - - // Record benchmark data - if (BENCHMARKING_MODE) { - detectionTimes.add(totalTime) - val preprocessingType = if (ENABLE_MULTI_PREPROCESSING) "MULTI" else "SINGLE" - Log.i(TAG, "📊 BENCHMARK: $preprocessingType-processing took ${totalTime}ms (${detectionTimes.size} samples)") - - // Print stats every 10 detections - if (detectionTimes.size % 10 == 0) { - printBenchmarkStats() - } - } - Log.i(TAG, "✅ Enhanced ONNX detection complete: ${finalDetections.size} objects in ${totalTime}ms") return finalDetections