Skip to content

tugaia56/Oxygen-Customizer-AI-Plugin

 
 

Repository files navigation

Oxygen Customizer - AI Plugin

This is a plugin for Oxygen Customizer, which adds AI features to extract the subject.

You can always use this plugin in your app, look at the Usage section.

Table of Contents

🤖 How it works

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.

🚀 Usage

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.

❤ Credits

Thanks to:

📝 License

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:

  • removebg

  • Copyright (c) [2023] [Eren Alpaslan]

  • rembg

  • Copyright (c) [2020] Daniel Gatis

⭐ Donations

Donate with PayPal Donate with BMC

About

Oxygen Customizer - AI Plugin

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Java 93.2%
  • Kotlin 6.8%