tucan9389 / PoseEstimation-CoreML

The example project of inferencing Pose Estimation using Core ML
https://github.com/motlabs/awesome-ml-demos-with-ios
MIT License
680 stars 136 forks source link

Performance problem in Xcode 11.3 #27

Closed vml933 closed 4 years ago

vml933 commented 4 years ago

Run Joint View sample in Xcode 10.3, the FPS is 15 ~ 20, But run same project in Xcode 11.3, the FPS dropdown to 6~7, my device is iPhone 7, Is anything setting I need to change ?

vml933 commented 4 years ago

I found that when comment line 35 ~ line 50 in HeatmapPostProcessor.swift, start from "for k in 0..< keypoint_number...") , the FPS will be better (15 ~ 20), But I still don't know how to solve this problem, can you give me some suggestion?

tucan9389 commented 4 years ago

@vml933

I found that when comment line 35 ~ line 50 in HeatmapPostProcessor.swift, start from "for k in 0..< keypoint_number...") , the FPS will be better (15 ~ 20), But I still don't know how to solve this problem, can you give me some suggestion?

The code(line 35~50) is for argmax which converts the 3 dimension array(heatmap structure) to 1 dimension array(point structure). If you remove the code, you cannot get the points array of body's keypoint.

vml933 commented 4 years ago

@vml933

I found that when comment line 35 ~ line 50 in HeatmapPostProcessor.swift, start from "for k in 0..< keypoint_number...") , the FPS will be better (15 ~ 20), But I still don't know how to solve this problem, can you give me some suggestion?

The code(line 35~50) is for argmax which converts the 3 dimension array(heatmap structure) to 1 dimension array(point structure). If you remove the code, you cannot get the points array of body's keypoint.

Thanks for your answer, It's strange that run these code performance bad in XCode 11, but performance good in Xcode 10

vml933 commented 4 years ago

Distribution ipa then run app on device, not via Xcode , performance is good, thank for help