Image Segmentation to Apply Pixel Masks to Scenes | Fritz

Image Segmentation

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

Getting Started

import Fritz

var visionModel: FritzVisionPeopleSegmentationModel?

let image = FritzVisionImage(image: uiImage)

visionModel.predict(image) { [weak self] (mask, error) in
    guard let mask = mask else { return }
    let maskImage = mask.toImageMask(of: FritzVisionPeopleClass.person)
    DispatchQueue.main.async {
        self?.maskView.image = maskImage
    }
}
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.

Features

Supports 3 Scenes

Use Image Segmentation to recognize different objects in one of 3 scenes:

  • People - Identify people in the view.
  • Outdoor - Identify different objects when you’re exploring the city or your neighborhood.
    • 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
  • Living Room - Identify different objects when you’re at home.
    • Chair
    • Wall
    • Coffee Table
    • Ceiling
    • Floor
    • Bed
    • Lamp
    • Sofa
    • Window
    • Pillow
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.

Customize Scenes

Our team can create custom image segmentation scenes upon request.

Technical Specifications

Architecture

ICNet variant

Model Size

~25 MB

FLOPS

8,750 M

Input

384x384-pixel image

768x768 in Premium

Output

Height and width of the mask

Number of classes the model predicts

Probability that pixel belongs to class

Formats

Core ML, TensorFlow, TensorFlow Mobile, Keras

Benchmarks

12 FPS on iPhone X

1 FPS on Pixel 2