diff --git a/app/src/main/java/com/hmwl/face_sdk/FaceLandmarkerHelper.kt b/app/src/main/java/com/hmwl/face_sdk/FaceLandmarkerHelper.kt index c708ba5..4925b83 100644 --- a/app/src/main/java/com/hmwl/face_sdk/FaceLandmarkerHelper.kt +++ b/app/src/main/java/com/hmwl/face_sdk/FaceLandmarkerHelper.kt @@ -67,6 +67,9 @@ class FaceLandmarkerHelper( } } + minFaceDetectionConfidence = 0.1f; + minFaceTrackingConfidence = 0.1f; + minFacePresenceConfidence = 0.1f; try { val baseOptions = baseOptionBuilder.build() // Create an option builder with base options and specific @@ -238,32 +241,33 @@ class FaceLandmarkerHelper( val frameId = result.timestampMs() if( result.faceLandmarks().size > 0 ) { // 计算各种延时 - val timings = frameTimings[frameId] - if (timings != null) { - val totalLatency = resultTime - timings.captureTime - val preprocessLatency = timings.preprocessEndTime - timings.preprocessStartTime - val detectionLatency = resultTime - timings.detectionStartTime - val captureToDetectionLatency = timings.detectionStartTime - timings.captureTime - - Log.i("TimeLatency", - "总延时: ${totalLatency}ms | " + - "预处理: ${preprocessLatency}ms | " + - "检测: ${detectionLatency}ms | " + - "捕获到检测: ${captureToDetectionLatency}ms | " + - "FPS: ${String.format("%.1f", currentFps)}" - ) - - val finishTimeMs = SystemClock.uptimeMillis() - val inferenceTime = finishTimeMs - result.timestampMs() - faceLandmarkerHelperListener?.onResults( - ResultBundle( - result, - inferenceTime, // 主要是检测时间 - input.height, - input.width, - ) - ) - } else { +// val timings = frameTimings[frameId] +// if (timings != null) { +// val totalLatency = resultTime - timings.captureTime +// val preprocessLatency = timings.preprocessEndTime - timings.preprocessStartTime +// val detectionLatency = resultTime - timings.detectionStartTime +// val captureToDetectionLatency = timings.detectionStartTime - timings.captureTime +// +// Log.i("TimeLatency", +// "总延时: ${totalLatency}ms | " + +// "预处理: ${preprocessLatency}ms | " + +// "检测: ${detectionLatency}ms | " + +// "捕获到检测: ${captureToDetectionLatency}ms | " + +// "FPS: ${String.format("%.1f", currentFps)}" +// ) +// +// val finishTimeMs = SystemClock.uptimeMillis() +// val inferenceTime = finishTimeMs - result.timestampMs() +// faceLandmarkerHelperListener?.onResults( +// ResultBundle( +// result, +// inferenceTime, // 主要是检测时间 +// input.height, +// input.width, +// ) +// ) +// } else + //{ val finishTimeMs = SystemClock.uptimeMillis() val inferenceTime = finishTimeMs - result.timestampMs() Log.i("TimeLatency", @@ -277,7 +281,7 @@ class FaceLandmarkerHelper( input.width ) ) - } + //} } else { faceLandmarkerHelperListener?.onEmpty() diff --git a/vulkan/FaceApp.h b/vulkan/FaceApp.h index ef4a007..3b5397b 100644 --- a/vulkan/FaceApp.h +++ b/vulkan/FaceApp.h @@ -102,7 +102,7 @@ private: VkPipelineLayout m_pipelineLayout = VK_NULL_HANDLE; VkDescriptorSetLayout m_descriptorSetLayout = VK_NULL_HANDLE; vector m_descriptor_sets; - const uint32_t kMaxTexture = 30; + const uint32_t kMaxTexture = 60; vector m_texs; vector m_texs_next; vector m_texs_ex;