mallman / coremlama Goto Github PK
View Code? Open in Web Editor NEWLaMa for Core ML
License: Apache License 2.0
LaMa for Core ML
License: Apache License 2.0
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?
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?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.