Semantic segmentation

A semantic segmentation model can identify the individual pixels that belong to different objects, instead of just a box for each one.

With the Coral Edge TPU™, you can run a semantic segmentation model directly on your device, using real-time video, at over 100 frames per second. You can even run a second model concurrently on one Edge TPU, while maintaining a high frame rate.

This page provides several trained models that are compiled for the Edge TPU, and some example code to run them.

Trained models link

These models are trained and compiled for the Edge TPU.

Notice: These are not production-quality models; they are for demonstration purposes only.
Model name Detections/Dataset Input size Depth mul. Output stride TF ver. Latency1 Model size Downloads

U-Net MobileNet v2

37 pets
Oxford-IIIT pets

128x128x3 N/A N/A 1 2.7 ms 7.2 MB

Edge TPU model, CPU model,
Labels file

U-Net MobileNet v2

37 pets
Oxford-IIIT pets

256x256x3 N/A N/A 1 29.0 ms 7.3 MB

Edge TPU model, CPU model,
Labels file

MobileNet v2 DeepLab v3

20 objects
PASCAL VOC2012

513x513x3 0.5 N/A 1 36.8 ms 1.1 MB

Edge TPU model, CPU model,
Labels file

MobileNet v2 DeepLab v3

20 objects
PASCAL VOC2012

513x513x3 1.0 N/A 1 43.0 ms 2.9 MB

Edge TPU model, CPU model,
Labels file

EdgeTPU-DeepLab-slim
New

28 objects
Cityscapes

513x513x3 0.75 N/A 1 65.9 ms 3.1 MB

Edge TPU model, CPU model,
Model info

MobileNet v1 BodyPix

24 body parts

352x480x3 0.75 16 1 6.9 ms 1.6 MB

Edge TPU model, CPU model

MobileNet v1 BodyPix

24 body parts

512x512x3 0.75 16 1 10.7 ms 1.7 MB

Edge TPU model, CPU model

MobileNet v1 BodyPix

24 body parts

480x640x3 0.75 16 1 12.3 ms 1.8 MB

Edge TPU model, CPU model

MobileNet v1 BodyPix

24 body parts

576x768x3 0.75 16 1 17.7 ms 1.8 MB

Edge TPU model, CPU model

MobileNet v1 BodyPix

24 body parts

768x1024x3 0.75 16 1 30.8 ms 2.0 MB

Edge TPU model, CPU model

MobileNet v1 BodyPix

24 body parts

720x1280x3 0.75 16 1 38.8 ms 2.3 MB

Edge TPU model, CPU model

ResNet-50 BodyPix

24 body parts

288x416x3 N/A 16 1 46.9 ms 24.5 MB

Edge TPU model, CPU model

ResNet-50 BodyPix

24 body parts

480x640x3 N/A 16 1 384.0 ms 26.6 MB

Edge TPU model, CPU model

ResNet-50 BodyPix

24 body parts

496x768x3 N/A 32 1 87.0 ms 26.9 MB

Edge TPU model, CPU model

ResNet-50 BodyPix

24 body parts

624x864x3 N/A 32 1 153.5 ms 28.5 MB

Edge TPU model, CPU model

ResNet-50 BodyPix

24 body parts

672x928x3 N/A 16 1 737.2 ms 35.3 MB

Edge TPU model, CPU model

ResNet-50 BodyPix

24 body parts

736x960x3 N/A 32 1 N/A 38.6 MB

Edge TPU model

1 Latency is the time to perform one inference, as measured with a Coral USB Accelerator on a desktop CPU. Latency varies between systems and is primarily intended for comparison between models. For more comparisons, see the Performance Benchmarks.

If you want to process portrait-orientation images, download BodyPix models for portrait input.

Example code link

videocam

Person segmentation with video

This example takes in a camera feed and performs body-part segmentation using the BodyPix model (with both MobileNet v1 and ResNet50 backbones). In addition to identifying different body parts, it can anonymize people from images.

Languages: Python

Semantic segmentation

This example performs semantic segmentation on an image. It takes an image as input and creates a new version of that image showing which pixels correspond to each recognized object.

Languages: Python