Use MobileSAM on Android, enable NNAPI and unload unused AI models fast, fix inpainting#1090
Use MobileSAM on Android, enable NNAPI and unload unused AI models fast, fix inpainting#1090waxm134 wants to merge 4 commits intoCyberTimon:mainfrom
Conversation
|
Are you sure NNAPI gets utilized and it doesn't just silently fallback to CPU because the compiled onnxruntime library wasn't compiled with NNAPI in it? |
|
That's interesting. At least for the LAMA_Dilated I explicitly removed loading it via NNAPI because it failed with NNAPI enabled. I can try to debug this further, but in general I think it's worth to enable NPU usage on Android. |
|
I've just tested this pr on my Pixel 7 Pro, which is not very powerful. AI Masking works and inpainting does too, without the app crashing. |
|
@waxm134 do you think you could maybe look into that weird mask bug? I cannot find any solution to it. To replicate it, work with masks on an image for some time, at some random point you wont be able to click on mask components anymore. You can't select them anymore, only the main masks. Screen_Recording_20260430_230508_RapidRAW.mp4 |
I can try to replicate the issue on my side and try to debug. |
Thank you, only if its okay for you tho. It happens often when im editing masks, but I can't find why. |
I tried to reproduce on my Pixel 9 and cannot reproduce it. But on the Xiaomi Pad 7 I reproduced it once and then immediately after the buttons froze the app crashed so I guess it has to do with RAM pressure and OOM. I try to implement some simple fixes to reduce overall RAM usage at the moment, maybe afterwards it's gone. |
Really weird behavior :/. Thanks for testing tho <3. Hopefully we will be able to fix it :D |
Description
Type of Change
Changes Made
Screenshots/Videos
Testing
Test Configuration:
Checklist
Additional Notes
AI Disclaimer:
Please state the involvement of AI in this PR: