Create Artistic Effect by Stylizing Image Background — Part 1: Project Intro

Segmentation + Style Transfer

Image by the author

Tutorial Objectives

  • Help you understand how to apply multiple ML models to real world scenarios for creating artistic effects.
  • Provide you with a reference on how to save, convert, optimize and benchmark TensorFlow Lite models.
  • Guide you on how to create a mobile application with TensorFlow Lite models easily, with Segmentation Task API and the Android Studio ML Model Binding.
  • Show you a practical implementation of how to chain multiple ML models on a mobile application.

Segmentation + Style Transfer

Project Overview

1. Segmentation model

2. Style transfer model

Application design

  1. Take a photo or choose an image from the gallery as the input.
  2. Apply the segmentation model to the input image.
  3. Apply the style transfer model to the image background (content image)
  4. Blend the masked out foreground image with the stylized background to produce the final image.

UI/UX design

  1. Input image: first capture an image with camera or select from the gallery.
  2. Apply segmentation model to remove the image background.
  3. Apply style transfer to the image background.
  4. Combine the foreground image with stylized background.

Acknowledgements

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store