john-rocky / CoreML-Face-Parsing

20 stars 2 forks source link

Performance #3

Closed dennislysenko closed 5 months ago

dennislysenko commented 7 months ago

It takes around 3.4 seconds to run on a 640p image on iPhone 13 mini. Is this expected, are there any quantized or lower quality models that might do something similar but with faster speed?

Thank you for the work btw. CoreML Zoo is great.

john-rocky commented 7 months ago

There are three correction methods.

  1. First of all, CoreML models take a few seconds to load for the first time. From the second time onwards, it is faster.
  2. Going through cgImage in post-processing slows down the processing speed. Please omit this.
  3. It will be faster if you convert it to an image when converting the model. I will update this version when I have time.
dennislysenko commented 7 months ago

@john-rocky Thanks, prewarming is more than enough in this case. This works great. Starred. I'm only running this once on the photo so CGImage is negligible latency, but if I was running it real-time on video, is there a way straight from the mlMultiArray to MTLTexture or CIImage?

By the way, do you think there's any model that we could segment segment the iris of the eye? I'm thinking if there is a way to do iris recoloring.