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. Latency 1 Micro 2 Model size Downloads

U-Net MobileNet v2

37 pets
Oxford-IIIT pets

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

U-Net MobileNet v2

37 pets
Oxford-IIIT pets

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

MobileNet v2 DeepLab v3

20 objects
PASCAL VOC2012

513x513x3 0.5 N/A 1 36.8 ms No 1.1 MB

MobileNet v2 DeepLab v3

20 objects
PASCAL VOC2012

513x513x3 1.0 N/A 1 43.0 ms No 2.9 MB

EdgeTPU-DeepLab-slim
New

28 objects
Cityscapes

513x513x3 0.75 N/A 1 65.9 ms No 3.1 MB

MobileNet v1 BodyPix

24 body parts

324x324x3 0.75 16 1 N/A Yes 1.6 MB

MobileNet v1 BodyPix

24 body parts

352x480x3 0.75 16 1 6.9 ms Yes* 1.6 MB

MobileNet v1 BodyPix

24 body parts

512x512x3 0.75 16 1 10.7 ms Yes* 1.7 MB

MobileNet v1 BodyPix

24 body parts

480x640x3 0.75 16 1 12.3 ms Yes* 1.8 MB

MobileNet v1 BodyPix

24 body parts

576x768x3 0.75 16 1 17.7 ms Yes* 1.8 MB

MobileNet v1 BodyPix

24 body parts

768x1024x3 0.75 16 1 30.8 ms Yes* 2.0 MB

MobileNet v1 BodyPix

24 body parts

720x1280x3 0.75 16 1 38.8 ms Yes* 2.3 MB

ResNet-50 BodyPix

24 body parts

288x416x3 N/A 16 1 46.9 ms No 24.5 MB

ResNet-50 BodyPix

24 body parts

480x640x3 N/A 16 1 384.0 ms No 26.6 MB

ResNet-50 BodyPix

24 body parts

496x768x3 N/A 32 1 87.0 ms No 26.9 MB

ResNet-50 BodyPix

24 body parts

624x864x3 N/A 32 1 153.5 ms No 28.5 MB

ResNet-50 BodyPix

24 body parts

672x928x3 N/A 16 1 737.2 ms No 35.3 MB

ResNet-50 BodyPix

24 body parts

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

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.

2 Indicates compatibility with the Dev Board Micro. Some models are not compatible because they require a CPU-bound op that is not supported by TensorFlow Lite for Microcontrollers or they require more memory than available on the board. (All models are compatible with all other Coral boards.)

* Although Dev Board Micro supports all the MobileNet v1 BodyPix models, beware that the on-board camera is 324x324 px, so you should use only the 324x324x3 model, unless you connect a larger-resolution camera.

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