Skip to content

Use MobileSAM on Android, enable NNAPI and unload unused AI models fast#1081

Closed
waxm134 wants to merge 4 commits into
CyberTimon:mainfrom
waxm134:main
Closed

Use MobileSAM on Android, enable NNAPI and unload unused AI models fast#1081
waxm134 wants to merge 4 commits into
CyberTimon:mainfrom
waxm134:main

Conversation

@waxm134
Copy link
Copy Markdown
Contributor

@waxm134 waxm134 commented Apr 24, 2026

Description

  • AI model performance tweaks and bug fixes for Android

Type of Change

  • Bug fix
  • New feature
  • Breaking change
  • Performance improvement
  • Code refactoring
  • Documentation update
  • UI/UX improvement
  • Build/CI or Dependency update

Changes Made

  • SAM2 model is heavy for android devices, switch to MobileSAM on Android to increase subject mask speed and lower RAM usage
  • Enable NNAPI to leverage any NPU provided by the SoC
  • unload unused AI models quickly to avoid OOM fails due to excessive RAM usage
  • fixed inpainting on Android

Screenshots/Videos

Testing

  • I have tested these changes locally and confirmed that they work as expected without issues

Test Configuration:

  • OS: Ubuntu 24.04, Android 16
  • Hardware: Intel i5, Pixel 9 Pro, Xiaomi Pad 7

Checklist

  • My code follows the project's code style
  • I haven't added unnecessary AI-generated code comments
  • My changes generate no new warnings or errors

Additional Notes

AI Disclaimer:

Please state the involvement of AI in this PR:

  • This PR is entirely AI-generated
  • This PR is AI-generated but guided by a human
  • This PR was handwritten with AI assistance (spell check, logic suggestions, error resolving)
  • This PR contains only blood, sweat, and coffee (AI-free)

@waxm134 waxm134 requested a review from CyberTimon as a code owner April 24, 2026 14:01
@waxm134 waxm134 mentioned this pull request Apr 24, 2026
19 tasks
@waxm134
Copy link
Copy Markdown
Contributor Author

waxm134 commented Apr 25, 2026

Moved this to a new branch on my fork, closing in favor of #1090

@waxm134 waxm134 closed this Apr 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant