GithubHelp home page GithubHelp logo

Deal to slow about uiimageview-betterface HOT 9 CLOSED

croath avatar croath commented on August 29, 2024
Deal to slow

from uiimageview-betterface.

Comments (9)

croath avatar croath commented on August 29, 2024

@Yi-Chen1 did you mean how to deal with the slow speed of rendering images?

In fact there is a way to increase the speed which I recommended it in the readme:
try set the fast property to YES to get the faster speed(lower accuracy)
Have you try it?

from uiimageview-betterface.

croath avatar croath commented on August 29, 2024

@Yi-Chen1 How many imageviews you need to show at one time? And what's the average size of these images?

I think I should move detecting code to an async thread and then go back to main thread to render.

from uiimageview-betterface.

croath avatar croath commented on August 29, 2024

@Yi-Chen1 I've push something to master will you pull to try it again?

And as you said, it may be not so smooth if there are 3 pics in one cell (may be 500px*500px of one?), beacuse face detecting of iOS SDK won't be that fast as you imagine.

So if the latest push can not satisfy your needs, try using UIImage+BetterFace, the UIImage category.
By using it you might make another cropped image after downloading, and cache it yourself 😭

from uiimageview-betterface.

croath avatar croath commented on August 29, 2024

@Yi-Chen1 Is your problem solved?

from uiimageview-betterface.

neoplastic avatar neoplastic commented on August 29, 2024

I've requested a merge for this. It looks like your original code was creating a new CIDetector each time you set an image. This looks damn simple in code but in actuality its creating a new CIContext inside the GPU thus competing with UIScrollView. Give the new code a shot and see if your performance improves. Although its still not 60fps as I'd have liked!

from uiimageview-betterface.

croath avatar croath commented on August 29, 2024

@neoplastic

Is that the main reason that makes it slow?
I don't think so, in my test the detecting method is the most slow step.
I don't know how much time it will save, I'll give it a try.

from uiimageview-betterface.

neoplastic avatar neoplastic commented on August 29, 2024

You need to setup a scroll view with lots of images on it. Here's an apple reference for CIDetector reuse.

"This class can maintain many state variables that can impact performance. So for best performance, reuse CIDetector instances instead of creating new ones."
http://developer.apple.com/library/ios/#documentation/CoreImage/Reference/CIDetector_Ref/Reference/Reference.html

Although its not the only reason its slow, its the main reason its slow when implementing it in a scroll view. At least that's what I've found.

from uiimageview-betterface.

croath avatar croath commented on August 29, 2024

@neoplastic but in your pull-reqeust, it's also creating a new one at most time. How about using a singleton instance of CIDetector?

from uiimageview-betterface.

croath avatar croath commented on August 29, 2024

merged, should be closed.

from uiimageview-betterface.

Related Issues (9)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.