You can always use this plugin in your app, look at the Usage section.
This plugin uses some code from removebg library to remove the background from an image using pytorch. This plugin also uses ONNX Runtime to run AI Models on Android.
Send a broadcast with the image source path and the destination path to save the extracted image. Remember to add a package name, so the app will send an intent on success or failure.
Intent intent = new Intent("it.dhd.oxygencustomizer.aiplugin.REQUEST_EXTRACT_SUBJECT");
intent.putExtra("sourcePath", "/path/to/image.png");
intent.putExtra("destinationPath", "/path/to/save/extracted/image.png");
intent.setPackage("your.package.name");
sendBroadcast(intent);
If something goes wrong, the plugin will send a broadcast with the error message.
Intent action: it.dhd.oxygencustomizer.aiplugin.ACTION_EXTRACT_FAILURE
If the extraction is successful, the plugin will send a broadcast to the calling package.
Intent action: it.dhd.oxygencustomizer.aiplugin.ACTION_EXTRACT_SUCCESS
NOTE: The generated subject is always compressed as PNG.
- Microsoft for ONNX Runtime
- danielgatis for his rembg
- erenalpaslan for his work.
This project is licensed under GPLv3. Please see LICENSE
for the full license text.
Portions of this project include code licensed under the MIT License: