tucan9389 / InstanceSegmentation-CoreML

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Fix inference time issue

tucan9389 opened this issue · comments

iPhone 11 Pro

[Before] Default Xcode Build Setting

 resize pixelbuffer: 0.0015877499245107174
 pre-processing    : 0.09696083329617977
 inference         : 3.689125624950975
 post-processing   : 0.006375749944709241
 draw              : 0.012044291710481048

[After] DEBUG Optimization On

Screen Shot 2021-03-07 at 5 13 53 AM

After change Build Settings > Swift Compiler - Code Generation > Optimization Level to Optimize for Speed [-O], the inference time is 7x faster in debugging.

 resize pixelbuffer: 0.002055833349004388
 pre-processing    : 0.001036750036291778
 inference         : 0.5295092916348949
 post-processing   : 0.0008876667125150561
 draw              : 0.00021395832300186157