Image Segmentation to Apply Pixel Masks to Scenes | Fritz AI

Image Segmentation

Use Image Segmentation to recognize objects and identify exactly which pixels belong to each object. Great for creating pixel-level masks, performing photo compositing and more.

Custom Image Segmentation

Quickly move from an idea to a production-ready Image Segmentation model with Fritz AI.

Pre-Trained Segmentation Models

Add Image Segmentation features to iOS and Android apps with pre-trained models and only a few lines of code.

Mobile Image Segmentation


Mask One Person or Many

Example Use Cases
  • Portrait Mode
  • Composite Images
  • Bokeh Effect

Portrait Tutorial (iOS) Portrait Tutorial (Android) Superimpose X Case Study Momento Case Study

Image Segmentation for Hair


Mask Hair to Alter Color and Appearance

Example Use Cases
  • Change Color
  • Brighten or Darken
  • Switch Style

Hair Color Tutorial (iOS) Hair Color Tutorial (Android)

Image Segmentation for Pets


Mask Dogs and Cats

Example Use Cases
  • Pet Portraits
  • Composite Images
  • Pet Stickers

Pet Sticker Tutorial

Image Segmentation for Sky


Mask the Sky or Foreground

Example Use Cases
  • Nature Photography
  • Day/Night Composite Images

Image Segmentation for Indoor


Mask Indoor Items and Furnishings

Indoor Labels
  • Chair
  • Wall
  • Coffee Table
  • Ceiling
  • Floor
  • Bed
  • Lamp
  • Sofa
  • Window
  • Pillow

Image Segmentation for Outdoor


Mask Streetscape and Landscape Objects

Outdoor Labels
  • Buildings
  • Sky
  • Tree
  • Pavement / Sidewalk
  • Ground
  • Car
  • Water
  • House
  • Fence
  • Signs
  • Skyscrapers
  • Bridge
  • River
  • Bus
  • Tree
  • Truck / Motortruck
  • Van
  • Minibike / Motorbike
  • Bicycle
  • Traffic Light
  • Person

Getting Started

import Fritz

let peopleModel = FritzVisionPeopleSegmentationModelFast()

let image = FritzVisionImage(image: uiImage)

guard let result = try? peopleModel.predict(image) else { return }

let peopleMask = result.buildSingleClassMask(forClass: .person)

let clippedMaskImage = image.masked(withAlphaMask: peopleMask)
Image Segmentation

The Swift code sample here illustrates how simple it can be to use Image Segmentation in your app. Use the links below to access additional documentation, code samples, and tutorials that will help you get started.


Multiple Scenes

Several Image Segmentation models are available for different scenes:

  • People
  • Hair
  • Pets
  • Indoor
  • Outdoor
Model Variants

Fast: Optimized for speed, best for processing video streams in real-time or on older devices.

Accurate: Optimized for higher accuracy where prediction quality is more important than speed.

Small: Optimized for size, keep your application bundle size low and conserve bandwidth.

Runs On-Device

All predictions / model inferences are made completely on-device.

No internet connection is required to interpret images or video.

No internet dependency means super-fast performance.

Cross-Platform SDKs

Supported mobile platforms:

  • Android Image Segmentation
  • iOS Image Segmentation
Live Video Performance

Runs on live video with a fast frame rate.

Exact FPS performance varies depending on device, but it is possible to run this feature on live video on modern mobile devices.

Technical Specifications


MobileNet and ICNet variants

Model Size

5 to 25 MB


300 to 8,750 M


Image, video, or camera


Height and width of the mask

Number of classes the model predicts

Probability that pixel belongs to class


Core ML, TensorFlow, TensorFlow Mobile, TensorFlow Lite, Keras


~30 FPS on iPhone X

~10 FPS on Pixel 2