Code Monkey home page Code Monkey logo

coremlama's People

Contributors

mallman avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

coremlama's Issues

High memory consumption/usage when loading the model in iOS.

Thank you for publishing this script and a test project for macOS in Swift.

I wanted to test it on iOS. Someone created the model LaMa.mlmodelc for me using this script. The file size of the model is 205.5MB. This is not critical so far. Now I have created a working project in Objective C for iOS. It works great with a new iPhone 15 Pro Max. The model expects a fixed size of 800x800 pixels. You can work with this and achieve very good inpainting results.

The problem is the very high memory usage immediately after loading the model in the iOS app at runtime.
After this line of code, the app immediately uses 1.4GB more memory than before:

MLModel *model = [MLModel modelWithContentsOfURL:[[NSBundle mainBundle] URLForResource:@"LaMa" withExtension:@"mlmodelc"] error:&error];

The actual processing of the image inpainting then requires approx. 400MB of memory, which is not too bad.

The problem is the 1.4GB memory consumption when loading the model. The older iPad and iPhone crash at this point with "Out Of Memory" (OOM) exception.

Is there a way to reduce the size of the model? Maybe a simplification or compression of the model?

memory_consumption

Don't lose quality using the model on iOS

Hi,
starting used the CoreML model inside a photo editor application, main problem is the 800x800 limit (tried to increase it but having problem on memory). I tried to split the image to 800x800 and then do the erasing but the result isn't good.

Do you have thoughts?

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.