PixieToon
PixieToon is an Android application that transforms your photos into cartoon-like images using a machine learning model. This project serves as a demonstration of how to integrate a TensorFlow Lite model into an Android app.
Features
- Select an image from your device’s gallery.
- Apply a cartoonization effect to the selected image.
- Save the cartoonized image to your device.
How It Works
Below are screenshots demonstrating the main steps of using PixieToon:
Start App and Select an Image
Example1
Example2
Switch Between Original and Cartoonized
Save the Image
Machine Learning Model
The cartoonization effect is achieved using a pre-trained TensorFlow Lite model (cartoon_model.tflite
). This model is an implementation of the White-Box cartoonization method described in the following paper:
Learning to Cartoonize Using White-box Cartoon Representations Xinrui Wang, Jinze Yu CVPR 2020
The model is included in the app/src/main/assets
directory.
Project Structure
This project follows the standard structure for an Android application built with Gradle. Here’s a brief overview of some important files and directories:
settings.gradle.kts
: This is the main settings file for the Gradle build, which includes all the sub-projects (modules) that are part of the project.build.gradle.kts
(Project: PixieToon): This is the top-level build file that contains the configuration options that are common to all the sub-projects/modules.app/build.gradle.kts
(Module: app): This file contains the specific build configurations for theapp
module, such as dependencies, application ID, and version codes.app/src/main
: This directory contains the main source code for the application.AndroidManifest.xml
: The manifest file for the application.java/
: Contains the Kotlin and Java source code.res/
: Contains all the non-code resources, such as layouts, drawables, and strings.assets/
: Contains the TensorFlow Lite model (cartoon_model.tflite
) and a test image (test_image.jpg
).
Building from Source
To build the project from the source code, follow these steps:
- Clone the repository:
git clone https://gitlab.com/rokorolev/pixietoon.git
- Open the project in Android Studio.
- Let Android Studio sync the project with Gradle.
- Build and run the application on an Android device or emulator.
License
This project is licensed under the MIT License. See the LICENSE
file for more details.
PixieToon | Developer’s page | Other applications | PixieToon Repository